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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate google_cloud_type;
32extern crate serde;
33extern crate serde_json;
34extern crate serde_with;
35extern crate std;
36extern crate tracing;
37extern crate wkt;
38
39mod debug;
40mod deserialize;
41mod serialize;
42
43/// Describes encryption state of a resource.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct DataEncryptionState {
47 /// Required. The KMS key version name with which data of a resource is
48 /// encrypted.
49 pub kms_key_version_name: std::string::String,
50
51 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
52}
53
54impl DataEncryptionState {
55 /// Creates a new default instance.
56 pub fn new() -> Self {
57 std::default::Default::default()
58 }
59
60 /// Sets the value of [kms_key_version_name][crate::model::DataEncryptionState::kms_key_version_name].
61 ///
62 /// # Example
63 /// ```ignore,no_run
64 /// # use google_cloud_dataform_v1::model::DataEncryptionState;
65 /// let x = DataEncryptionState::new().set_kms_key_version_name("example");
66 /// ```
67 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
68 mut self,
69 v: T,
70 ) -> Self {
71 self.kms_key_version_name = v.into();
72 self
73 }
74}
75
76impl wkt::message::Message for DataEncryptionState {
77 fn typename() -> &'static str {
78 "type.googleapis.com/google.cloud.dataform.v1.DataEncryptionState"
79 }
80}
81
82/// Represents a Dataform Git repository.
83#[derive(Clone, Default, PartialEq)]
84#[non_exhaustive]
85pub struct Repository {
86 /// Identifier. The repository's name.
87 pub name: std::string::String,
88
89 /// Optional. The name of the containing folder of the repository.
90 /// The field is immutable and it can be modified via a MoveRepository
91 /// operation.
92 /// Format: `projects/*/locations/*/folders/*`. or
93 /// `projects/*/locations/*/teamFolders/*`.
94 pub containing_folder: std::option::Option<std::string::String>,
95
96 /// Output only. The resource name of the TeamFolder that this Repository is
97 /// associated with. This should take the format:
98 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this
99 /// is not set, the Repository is not associated with a TeamFolder.
100 pub team_folder_name: std::option::Option<std::string::String>,
101
102 /// Output only. The timestamp of when the repository was created.
103 pub create_time: std::option::Option<wkt::Timestamp>,
104
105 /// Optional. The repository's user-friendly name.
106 pub display_name: std::string::String,
107
108 /// Optional. If set, configures this repository to be linked to a Git remote.
109 pub git_remote_settings: std::option::Option<crate::model::repository::GitRemoteSettings>,
110
111 /// Optional. The name of the Secret Manager secret version to be used to
112 /// interpolate variables into the .npmrc file for package installation
113 /// operations. Must be in the format `projects/*/secrets/*/versions/*`. The
114 /// file itself must be in a JSON format.
115 pub npmrc_environment_variables_secret_version: std::string::String,
116
117 /// Optional. If set, fields of `workspace_compilation_overrides` override the
118 /// default compilation settings that are specified in dataform.json when
119 /// creating workspace-scoped compilation results. See documentation for
120 /// `WorkspaceCompilationOverrides` for more information.
121 pub workspace_compilation_overrides:
122 std::option::Option<crate::model::repository::WorkspaceCompilationOverrides>,
123
124 /// Optional. Repository user labels.
125 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
126
127 /// Optional. Input only. If set to true, the authenticated user will be
128 /// granted the roles/dataform.admin role on the created repository.
129 pub set_authenticated_user_admin: bool,
130
131 /// Optional. The service account to run workflow invocations under.
132 pub service_account: std::string::String,
133
134 /// Optional. The reference to a KMS encryption key. If provided, it will be
135 /// used to encrypt user data in the repository and all child resources. It is
136 /// not possible to add or update the encryption key after the repository is
137 /// created. Example:
138 /// `projects/{kms_project}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}`
139 pub kms_key_name: std::string::String,
140
141 /// Output only. A data encryption state of a Git repository if this Repository
142 /// is protected by a KMS key.
143 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
144
145 /// Output only. All the metadata information that is used internally to serve
146 /// the resource. For example: timestamps, flags, status fields, etc. The
147 /// format of this field is a JSON string.
148 pub internal_metadata: std::option::Option<std::string::String>,
149
150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
151}
152
153impl Repository {
154 /// Creates a new default instance.
155 pub fn new() -> Self {
156 std::default::Default::default()
157 }
158
159 /// Sets the value of [name][crate::model::Repository::name].
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_dataform_v1::model::Repository;
164 /// # let project_id = "project_id";
165 /// # let location_id = "location_id";
166 /// # let repository_id = "repository_id";
167 /// let x = Repository::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
168 /// ```
169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
170 self.name = v.into();
171 self
172 }
173
174 /// Sets the value of [containing_folder][crate::model::Repository::containing_folder].
175 ///
176 /// # Example
177 /// ```ignore,no_run
178 /// # use google_cloud_dataform_v1::model::Repository;
179 /// let x = Repository::new().set_containing_folder("example");
180 /// ```
181 pub fn set_containing_folder<T>(mut self, v: T) -> Self
182 where
183 T: std::convert::Into<std::string::String>,
184 {
185 self.containing_folder = std::option::Option::Some(v.into());
186 self
187 }
188
189 /// Sets or clears the value of [containing_folder][crate::model::Repository::containing_folder].
190 ///
191 /// # Example
192 /// ```ignore,no_run
193 /// # use google_cloud_dataform_v1::model::Repository;
194 /// let x = Repository::new().set_or_clear_containing_folder(Some("example"));
195 /// let x = Repository::new().set_or_clear_containing_folder(None::<String>);
196 /// ```
197 pub fn set_or_clear_containing_folder<T>(mut self, v: std::option::Option<T>) -> Self
198 where
199 T: std::convert::Into<std::string::String>,
200 {
201 self.containing_folder = v.map(|x| x.into());
202 self
203 }
204
205 /// Sets the value of [team_folder_name][crate::model::Repository::team_folder_name].
206 ///
207 /// # Example
208 /// ```ignore,no_run
209 /// # use google_cloud_dataform_v1::model::Repository;
210 /// let x = Repository::new().set_team_folder_name("example");
211 /// ```
212 pub fn set_team_folder_name<T>(mut self, v: T) -> Self
213 where
214 T: std::convert::Into<std::string::String>,
215 {
216 self.team_folder_name = std::option::Option::Some(v.into());
217 self
218 }
219
220 /// Sets or clears the value of [team_folder_name][crate::model::Repository::team_folder_name].
221 ///
222 /// # Example
223 /// ```ignore,no_run
224 /// # use google_cloud_dataform_v1::model::Repository;
225 /// let x = Repository::new().set_or_clear_team_folder_name(Some("example"));
226 /// let x = Repository::new().set_or_clear_team_folder_name(None::<String>);
227 /// ```
228 pub fn set_or_clear_team_folder_name<T>(mut self, v: std::option::Option<T>) -> Self
229 where
230 T: std::convert::Into<std::string::String>,
231 {
232 self.team_folder_name = v.map(|x| x.into());
233 self
234 }
235
236 /// Sets the value of [create_time][crate::model::Repository::create_time].
237 ///
238 /// # Example
239 /// ```ignore,no_run
240 /// # use google_cloud_dataform_v1::model::Repository;
241 /// use wkt::Timestamp;
242 /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
243 /// ```
244 pub fn set_create_time<T>(mut self, v: T) -> Self
245 where
246 T: std::convert::Into<wkt::Timestamp>,
247 {
248 self.create_time = std::option::Option::Some(v.into());
249 self
250 }
251
252 /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
253 ///
254 /// # Example
255 /// ```ignore,no_run
256 /// # use google_cloud_dataform_v1::model::Repository;
257 /// use wkt::Timestamp;
258 /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
259 /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
260 /// ```
261 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
262 where
263 T: std::convert::Into<wkt::Timestamp>,
264 {
265 self.create_time = v.map(|x| x.into());
266 self
267 }
268
269 /// Sets the value of [display_name][crate::model::Repository::display_name].
270 ///
271 /// # Example
272 /// ```ignore,no_run
273 /// # use google_cloud_dataform_v1::model::Repository;
274 /// let x = Repository::new().set_display_name("example");
275 /// ```
276 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
277 self.display_name = v.into();
278 self
279 }
280
281 /// Sets the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
282 ///
283 /// # Example
284 /// ```ignore,no_run
285 /// # use google_cloud_dataform_v1::model::Repository;
286 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
287 /// let x = Repository::new().set_git_remote_settings(GitRemoteSettings::default()/* use setters */);
288 /// ```
289 pub fn set_git_remote_settings<T>(mut self, v: T) -> Self
290 where
291 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
292 {
293 self.git_remote_settings = std::option::Option::Some(v.into());
294 self
295 }
296
297 /// Sets or clears the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
298 ///
299 /// # Example
300 /// ```ignore,no_run
301 /// # use google_cloud_dataform_v1::model::Repository;
302 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
303 /// let x = Repository::new().set_or_clear_git_remote_settings(Some(GitRemoteSettings::default()/* use setters */));
304 /// let x = Repository::new().set_or_clear_git_remote_settings(None::<GitRemoteSettings>);
305 /// ```
306 pub fn set_or_clear_git_remote_settings<T>(mut self, v: std::option::Option<T>) -> Self
307 where
308 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
309 {
310 self.git_remote_settings = v.map(|x| x.into());
311 self
312 }
313
314 /// Sets the value of [npmrc_environment_variables_secret_version][crate::model::Repository::npmrc_environment_variables_secret_version].
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_dataform_v1::model::Repository;
319 /// let x = Repository::new().set_npmrc_environment_variables_secret_version("example");
320 /// ```
321 pub fn set_npmrc_environment_variables_secret_version<
322 T: std::convert::Into<std::string::String>,
323 >(
324 mut self,
325 v: T,
326 ) -> Self {
327 self.npmrc_environment_variables_secret_version = v.into();
328 self
329 }
330
331 /// Sets the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
332 ///
333 /// # Example
334 /// ```ignore,no_run
335 /// # use google_cloud_dataform_v1::model::Repository;
336 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
337 /// let x = Repository::new().set_workspace_compilation_overrides(WorkspaceCompilationOverrides::default()/* use setters */);
338 /// ```
339 pub fn set_workspace_compilation_overrides<T>(mut self, v: T) -> Self
340 where
341 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
342 {
343 self.workspace_compilation_overrides = std::option::Option::Some(v.into());
344 self
345 }
346
347 /// Sets or clears the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
348 ///
349 /// # Example
350 /// ```ignore,no_run
351 /// # use google_cloud_dataform_v1::model::Repository;
352 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
353 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(Some(WorkspaceCompilationOverrides::default()/* use setters */));
354 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(None::<WorkspaceCompilationOverrides>);
355 /// ```
356 pub fn set_or_clear_workspace_compilation_overrides<T>(
357 mut self,
358 v: std::option::Option<T>,
359 ) -> Self
360 where
361 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
362 {
363 self.workspace_compilation_overrides = v.map(|x| x.into());
364 self
365 }
366
367 /// Sets the value of [labels][crate::model::Repository::labels].
368 ///
369 /// # Example
370 /// ```ignore,no_run
371 /// # use google_cloud_dataform_v1::model::Repository;
372 /// let x = Repository::new().set_labels([
373 /// ("key0", "abc"),
374 /// ("key1", "xyz"),
375 /// ]);
376 /// ```
377 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
378 where
379 T: std::iter::IntoIterator<Item = (K, V)>,
380 K: std::convert::Into<std::string::String>,
381 V: std::convert::Into<std::string::String>,
382 {
383 use std::iter::Iterator;
384 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
385 self
386 }
387
388 /// Sets the value of [set_authenticated_user_admin][crate::model::Repository::set_authenticated_user_admin].
389 ///
390 /// # Example
391 /// ```ignore,no_run
392 /// # use google_cloud_dataform_v1::model::Repository;
393 /// let x = Repository::new().set_set_authenticated_user_admin(true);
394 /// ```
395 pub fn set_set_authenticated_user_admin<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
396 self.set_authenticated_user_admin = v.into();
397 self
398 }
399
400 /// Sets the value of [service_account][crate::model::Repository::service_account].
401 ///
402 /// # Example
403 /// ```ignore,no_run
404 /// # use google_cloud_dataform_v1::model::Repository;
405 /// let x = Repository::new().set_service_account("example");
406 /// ```
407 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
408 self.service_account = v.into();
409 self
410 }
411
412 /// Sets the value of [kms_key_name][crate::model::Repository::kms_key_name].
413 ///
414 /// # Example
415 /// ```ignore,no_run
416 /// # use google_cloud_dataform_v1::model::Repository;
417 /// let x = Repository::new().set_kms_key_name("example");
418 /// ```
419 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
420 self.kms_key_name = v.into();
421 self
422 }
423
424 /// Sets the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_dataform_v1::model::Repository;
429 /// use google_cloud_dataform_v1::model::DataEncryptionState;
430 /// let x = Repository::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
431 /// ```
432 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
433 where
434 T: std::convert::Into<crate::model::DataEncryptionState>,
435 {
436 self.data_encryption_state = std::option::Option::Some(v.into());
437 self
438 }
439
440 /// Sets or clears the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
441 ///
442 /// # Example
443 /// ```ignore,no_run
444 /// # use google_cloud_dataform_v1::model::Repository;
445 /// use google_cloud_dataform_v1::model::DataEncryptionState;
446 /// let x = Repository::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
447 /// let x = Repository::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
448 /// ```
449 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
450 where
451 T: std::convert::Into<crate::model::DataEncryptionState>,
452 {
453 self.data_encryption_state = v.map(|x| x.into());
454 self
455 }
456
457 /// Sets the value of [internal_metadata][crate::model::Repository::internal_metadata].
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_cloud_dataform_v1::model::Repository;
462 /// let x = Repository::new().set_internal_metadata("example");
463 /// ```
464 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
465 where
466 T: std::convert::Into<std::string::String>,
467 {
468 self.internal_metadata = std::option::Option::Some(v.into());
469 self
470 }
471
472 /// Sets or clears the value of [internal_metadata][crate::model::Repository::internal_metadata].
473 ///
474 /// # Example
475 /// ```ignore,no_run
476 /// # use google_cloud_dataform_v1::model::Repository;
477 /// let x = Repository::new().set_or_clear_internal_metadata(Some("example"));
478 /// let x = Repository::new().set_or_clear_internal_metadata(None::<String>);
479 /// ```
480 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
481 where
482 T: std::convert::Into<std::string::String>,
483 {
484 self.internal_metadata = v.map(|x| x.into());
485 self
486 }
487}
488
489impl wkt::message::Message for Repository {
490 fn typename() -> &'static str {
491 "type.googleapis.com/google.cloud.dataform.v1.Repository"
492 }
493}
494
495/// Defines additional types related to [Repository].
496pub mod repository {
497 #[allow(unused_imports)]
498 use super::*;
499
500 /// Controls Git remote configuration for a repository.
501 #[derive(Clone, Default, PartialEq)]
502 #[non_exhaustive]
503 pub struct GitRemoteSettings {
504 /// Required. The Git remote's URL.
505 pub url: std::string::String,
506
507 /// Optional. The Git remote's default branch name.
508 /// If not set, `main` will be used.
509 pub default_branch: std::string::String,
510
511 /// Output only. The Git remote's effective default branch name.
512 /// This is the default branch name of the Git remote if it is set,
513 /// otherwise it is `main`.
514 pub effective_default_branch: std::string::String,
515
516 /// Optional. The name of the Secret Manager secret version to use as an
517 /// authentication token for Git operations. Must be in the format
518 /// `projects/*/secrets/*/versions/*`.
519 pub authentication_token_secret_version: std::string::String,
520
521 /// Optional. Authentication fields for remote uris using SSH protocol.
522 pub ssh_authentication_config: std::option::Option<
523 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
524 >,
525
526 /// Optional. Resource name for the `GitRepositoryLink` used for machine
527 /// credentials. Must be in the format
528 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`
529 pub git_repository_link: std::option::Option<std::string::String>,
530
531 /// Output only. Deprecated: The field does not contain any token status
532 /// information.
533 #[deprecated]
534 pub token_status: crate::model::repository::git_remote_settings::TokenStatus,
535
536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
537 }
538
539 impl GitRemoteSettings {
540 /// Creates a new default instance.
541 pub fn new() -> Self {
542 std::default::Default::default()
543 }
544
545 /// Sets the value of [url][crate::model::repository::GitRemoteSettings::url].
546 ///
547 /// # Example
548 /// ```ignore,no_run
549 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
550 /// let x = GitRemoteSettings::new().set_url("example");
551 /// ```
552 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
553 self.url = v.into();
554 self
555 }
556
557 /// Sets the value of [default_branch][crate::model::repository::GitRemoteSettings::default_branch].
558 ///
559 /// # Example
560 /// ```ignore,no_run
561 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
562 /// let x = GitRemoteSettings::new().set_default_branch("example");
563 /// ```
564 pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
565 mut self,
566 v: T,
567 ) -> Self {
568 self.default_branch = v.into();
569 self
570 }
571
572 /// Sets the value of [effective_default_branch][crate::model::repository::GitRemoteSettings::effective_default_branch].
573 ///
574 /// # Example
575 /// ```ignore,no_run
576 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
577 /// let x = GitRemoteSettings::new().set_effective_default_branch("example");
578 /// ```
579 pub fn set_effective_default_branch<T: std::convert::Into<std::string::String>>(
580 mut self,
581 v: T,
582 ) -> Self {
583 self.effective_default_branch = v.into();
584 self
585 }
586
587 /// Sets the value of [authentication_token_secret_version][crate::model::repository::GitRemoteSettings::authentication_token_secret_version].
588 ///
589 /// # Example
590 /// ```ignore,no_run
591 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
592 /// let x = GitRemoteSettings::new().set_authentication_token_secret_version("example");
593 /// ```
594 pub fn set_authentication_token_secret_version<
595 T: std::convert::Into<std::string::String>,
596 >(
597 mut self,
598 v: T,
599 ) -> Self {
600 self.authentication_token_secret_version = v.into();
601 self
602 }
603
604 /// Sets the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
609 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
610 /// let x = GitRemoteSettings::new().set_ssh_authentication_config(SshAuthenticationConfig::default()/* use setters */);
611 /// ```
612 pub fn set_ssh_authentication_config<T>(mut self, v: T) -> Self
613 where
614 T: std::convert::Into<
615 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
616 >,
617 {
618 self.ssh_authentication_config = std::option::Option::Some(v.into());
619 self
620 }
621
622 /// Sets or clears the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
623 ///
624 /// # Example
625 /// ```ignore,no_run
626 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
627 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
628 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(Some(SshAuthenticationConfig::default()/* use setters */));
629 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(None::<SshAuthenticationConfig>);
630 /// ```
631 pub fn set_or_clear_ssh_authentication_config<T>(
632 mut self,
633 v: std::option::Option<T>,
634 ) -> Self
635 where
636 T: std::convert::Into<
637 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
638 >,
639 {
640 self.ssh_authentication_config = v.map(|x| x.into());
641 self
642 }
643
644 /// Sets the value of [git_repository_link][crate::model::repository::GitRemoteSettings::git_repository_link].
645 ///
646 /// # Example
647 /// ```ignore,no_run
648 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
649 /// let x = GitRemoteSettings::new().set_git_repository_link("example");
650 /// ```
651 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
652 where
653 T: std::convert::Into<std::string::String>,
654 {
655 self.git_repository_link = std::option::Option::Some(v.into());
656 self
657 }
658
659 /// Sets or clears the value of [git_repository_link][crate::model::repository::GitRemoteSettings::git_repository_link].
660 ///
661 /// # Example
662 /// ```ignore,no_run
663 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
664 /// let x = GitRemoteSettings::new().set_or_clear_git_repository_link(Some("example"));
665 /// let x = GitRemoteSettings::new().set_or_clear_git_repository_link(None::<String>);
666 /// ```
667 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
668 where
669 T: std::convert::Into<std::string::String>,
670 {
671 self.git_repository_link = v.map(|x| x.into());
672 self
673 }
674
675 /// Sets the value of [token_status][crate::model::repository::GitRemoteSettings::token_status].
676 ///
677 /// # Example
678 /// ```ignore,no_run
679 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
680 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::TokenStatus;
681 /// let x0 = GitRemoteSettings::new().set_token_status(TokenStatus::NotFound);
682 /// let x1 = GitRemoteSettings::new().set_token_status(TokenStatus::Invalid);
683 /// let x2 = GitRemoteSettings::new().set_token_status(TokenStatus::Valid);
684 /// ```
685 #[deprecated]
686 pub fn set_token_status<
687 T: std::convert::Into<crate::model::repository::git_remote_settings::TokenStatus>,
688 >(
689 mut self,
690 v: T,
691 ) -> Self {
692 self.token_status = v.into();
693 self
694 }
695 }
696
697 impl wkt::message::Message for GitRemoteSettings {
698 fn typename() -> &'static str {
699 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings"
700 }
701 }
702
703 /// Defines additional types related to [GitRemoteSettings].
704 pub mod git_remote_settings {
705 #[allow(unused_imports)]
706 use super::*;
707
708 /// Configures fields for performing SSH authentication.
709 #[derive(Clone, Default, PartialEq)]
710 #[non_exhaustive]
711 pub struct SshAuthenticationConfig {
712 /// Required. The name of the Secret Manager secret version to use as a
713 /// ssh private key for Git operations.
714 /// Must be in the format `projects/*/secrets/*/versions/*`.
715 pub user_private_key_secret_version: std::string::String,
716
717 /// Required. Content of a public SSH key to verify an identity of a remote
718 /// Git host.
719 pub host_public_key: std::string::String,
720
721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
722 }
723
724 impl SshAuthenticationConfig {
725 /// Creates a new default instance.
726 pub fn new() -> Self {
727 std::default::Default::default()
728 }
729
730 /// Sets the value of [user_private_key_secret_version][crate::model::repository::git_remote_settings::SshAuthenticationConfig::user_private_key_secret_version].
731 ///
732 /// # Example
733 /// ```ignore,no_run
734 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
735 /// let x = SshAuthenticationConfig::new().set_user_private_key_secret_version("example");
736 /// ```
737 pub fn set_user_private_key_secret_version<
738 T: std::convert::Into<std::string::String>,
739 >(
740 mut self,
741 v: T,
742 ) -> Self {
743 self.user_private_key_secret_version = v.into();
744 self
745 }
746
747 /// Sets the value of [host_public_key][crate::model::repository::git_remote_settings::SshAuthenticationConfig::host_public_key].
748 ///
749 /// # Example
750 /// ```ignore,no_run
751 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
752 /// let x = SshAuthenticationConfig::new().set_host_public_key("example");
753 /// ```
754 pub fn set_host_public_key<T: std::convert::Into<std::string::String>>(
755 mut self,
756 v: T,
757 ) -> Self {
758 self.host_public_key = v.into();
759 self
760 }
761 }
762
763 impl wkt::message::Message for SshAuthenticationConfig {
764 fn typename() -> &'static str {
765 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings.SshAuthenticationConfig"
766 }
767 }
768
769 /// The status of the authentication token.
770 ///
771 /// # Working with unknown values
772 ///
773 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
774 /// additional enum variants at any time. Adding new variants is not considered
775 /// a breaking change. Applications should write their code in anticipation of:
776 ///
777 /// - New values appearing in future releases of the client library, **and**
778 /// - New values received dynamically, without application changes.
779 ///
780 /// Please consult the [Working with enums] section in the user guide for some
781 /// guidelines.
782 ///
783 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
784 #[derive(Clone, Debug, PartialEq)]
785 #[non_exhaustive]
786 pub enum TokenStatus {
787 /// Default value. This value is unused.
788 Unspecified,
789 /// The token could not be found in Secret Manager (or the Dataform
790 /// Service Account did not have permission to access it).
791 NotFound,
792 /// The token could not be used to authenticate against the Git remote.
793 Invalid,
794 /// The token was used successfully to authenticate against the Git remote.
795 Valid,
796 /// If set, the enum was initialized with an unknown value.
797 ///
798 /// Applications can examine the value using [TokenStatus::value] or
799 /// [TokenStatus::name].
800 UnknownValue(token_status::UnknownValue),
801 }
802
803 #[doc(hidden)]
804 pub mod token_status {
805 #[allow(unused_imports)]
806 use super::*;
807 #[derive(Clone, Debug, PartialEq)]
808 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
809 }
810
811 impl TokenStatus {
812 /// Gets the enum value.
813 ///
814 /// Returns `None` if the enum contains an unknown value deserialized from
815 /// the string representation of enums.
816 pub fn value(&self) -> std::option::Option<i32> {
817 match self {
818 Self::Unspecified => std::option::Option::Some(0),
819 Self::NotFound => std::option::Option::Some(1),
820 Self::Invalid => std::option::Option::Some(2),
821 Self::Valid => std::option::Option::Some(3),
822 Self::UnknownValue(u) => u.0.value(),
823 }
824 }
825
826 /// Gets the enum value as a string.
827 ///
828 /// Returns `None` if the enum contains an unknown value deserialized from
829 /// the integer representation of enums.
830 pub fn name(&self) -> std::option::Option<&str> {
831 match self {
832 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
833 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
834 Self::Invalid => std::option::Option::Some("INVALID"),
835 Self::Valid => std::option::Option::Some("VALID"),
836 Self::UnknownValue(u) => u.0.name(),
837 }
838 }
839 }
840
841 impl std::default::Default for TokenStatus {
842 fn default() -> Self {
843 use std::convert::From;
844 Self::from(0)
845 }
846 }
847
848 impl std::fmt::Display for TokenStatus {
849 fn fmt(
850 &self,
851 f: &mut std::fmt::Formatter<'_>,
852 ) -> std::result::Result<(), std::fmt::Error> {
853 wkt::internal::display_enum(f, self.name(), self.value())
854 }
855 }
856
857 impl std::convert::From<i32> for TokenStatus {
858 fn from(value: i32) -> Self {
859 match value {
860 0 => Self::Unspecified,
861 1 => Self::NotFound,
862 2 => Self::Invalid,
863 3 => Self::Valid,
864 _ => Self::UnknownValue(token_status::UnknownValue(
865 wkt::internal::UnknownEnumValue::Integer(value),
866 )),
867 }
868 }
869 }
870
871 impl std::convert::From<&str> for TokenStatus {
872 fn from(value: &str) -> Self {
873 use std::string::ToString;
874 match value {
875 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
876 "NOT_FOUND" => Self::NotFound,
877 "INVALID" => Self::Invalid,
878 "VALID" => Self::Valid,
879 _ => Self::UnknownValue(token_status::UnknownValue(
880 wkt::internal::UnknownEnumValue::String(value.to_string()),
881 )),
882 }
883 }
884 }
885
886 impl serde::ser::Serialize for TokenStatus {
887 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
888 where
889 S: serde::Serializer,
890 {
891 match self {
892 Self::Unspecified => serializer.serialize_i32(0),
893 Self::NotFound => serializer.serialize_i32(1),
894 Self::Invalid => serializer.serialize_i32(2),
895 Self::Valid => serializer.serialize_i32(3),
896 Self::UnknownValue(u) => u.0.serialize(serializer),
897 }
898 }
899 }
900
901 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
902 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
903 where
904 D: serde::Deserializer<'de>,
905 {
906 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
907 ".google.cloud.dataform.v1.Repository.GitRemoteSettings.TokenStatus",
908 ))
909 }
910 }
911 }
912
913 /// Configures workspace compilation overrides for a repository.
914 #[derive(Clone, Default, PartialEq)]
915 #[non_exhaustive]
916 pub struct WorkspaceCompilationOverrides {
917 /// Optional. The default database (Google Cloud project ID).
918 pub default_database: std::string::String,
919
920 /// Optional. The suffix that should be appended to all schema (BigQuery
921 /// dataset ID) names.
922 pub schema_suffix: std::string::String,
923
924 /// Optional. The prefix that should be prepended to all table names.
925 pub table_prefix: std::string::String,
926
927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
928 }
929
930 impl WorkspaceCompilationOverrides {
931 /// Creates a new default instance.
932 pub fn new() -> Self {
933 std::default::Default::default()
934 }
935
936 /// Sets the value of [default_database][crate::model::repository::WorkspaceCompilationOverrides::default_database].
937 ///
938 /// # Example
939 /// ```ignore,no_run
940 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
941 /// let x = WorkspaceCompilationOverrides::new().set_default_database("example");
942 /// ```
943 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
944 mut self,
945 v: T,
946 ) -> Self {
947 self.default_database = v.into();
948 self
949 }
950
951 /// Sets the value of [schema_suffix][crate::model::repository::WorkspaceCompilationOverrides::schema_suffix].
952 ///
953 /// # Example
954 /// ```ignore,no_run
955 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
956 /// let x = WorkspaceCompilationOverrides::new().set_schema_suffix("example");
957 /// ```
958 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(
959 mut self,
960 v: T,
961 ) -> Self {
962 self.schema_suffix = v.into();
963 self
964 }
965
966 /// Sets the value of [table_prefix][crate::model::repository::WorkspaceCompilationOverrides::table_prefix].
967 ///
968 /// # Example
969 /// ```ignore,no_run
970 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
971 /// let x = WorkspaceCompilationOverrides::new().set_table_prefix("example");
972 /// ```
973 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(
974 mut self,
975 v: T,
976 ) -> Self {
977 self.table_prefix = v.into();
978 self
979 }
980 }
981
982 impl wkt::message::Message for WorkspaceCompilationOverrides {
983 fn typename() -> &'static str {
984 "type.googleapis.com/google.cloud.dataform.v1.Repository.WorkspaceCompilationOverrides"
985 }
986 }
987}
988
989/// Metadata used to identify if a resource is user scoped.
990#[derive(Clone, Default, PartialEq)]
991#[non_exhaustive]
992pub struct PrivateResourceMetadata {
993 /// Output only. If true, this resource is user-scoped, meaning it is either a
994 /// workspace or sourced from a workspace.
995 pub user_scoped: bool,
996
997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
998}
999
1000impl PrivateResourceMetadata {
1001 /// Creates a new default instance.
1002 pub fn new() -> Self {
1003 std::default::Default::default()
1004 }
1005
1006 /// Sets the value of [user_scoped][crate::model::PrivateResourceMetadata::user_scoped].
1007 ///
1008 /// # Example
1009 /// ```ignore,no_run
1010 /// # use google_cloud_dataform_v1::model::PrivateResourceMetadata;
1011 /// let x = PrivateResourceMetadata::new().set_user_scoped(true);
1012 /// ```
1013 pub fn set_user_scoped<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1014 self.user_scoped = v.into();
1015 self
1016 }
1017}
1018
1019impl wkt::message::Message for PrivateResourceMetadata {
1020 fn typename() -> &'static str {
1021 "type.googleapis.com/google.cloud.dataform.v1.PrivateResourceMetadata"
1022 }
1023}
1024
1025/// `ListRepositories` request message.
1026#[derive(Clone, Default, PartialEq)]
1027#[non_exhaustive]
1028pub struct ListRepositoriesRequest {
1029 /// Required. The location in which to list repositories. Must be in the format
1030 /// `projects/*/locations/*`.
1031 pub parent: std::string::String,
1032
1033 /// Optional. Maximum number of repositories to return. The server may return
1034 /// fewer items than requested. If unspecified, the server will pick an
1035 /// appropriate default.
1036 pub page_size: i32,
1037
1038 /// Optional. Page token received from a previous `ListRepositories` call.
1039 /// Provide this to retrieve the subsequent page.
1040 ///
1041 /// When paginating, all other parameters provided to `ListRepositories`,
1042 /// with the exception of `page_size`, must match the call that provided the
1043 /// page token.
1044 pub page_token: std::string::String,
1045
1046 /// Optional. This field only supports ordering by `name`. If unspecified, the
1047 /// server will choose the ordering. If specified, the default order is
1048 /// ascending for the `name` field.
1049 pub order_by: std::string::String,
1050
1051 /// Optional. Filter for the returned list.
1052 pub filter: std::string::String,
1053
1054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1055}
1056
1057impl ListRepositoriesRequest {
1058 /// Creates a new default instance.
1059 pub fn new() -> Self {
1060 std::default::Default::default()
1061 }
1062
1063 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
1064 ///
1065 /// # Example
1066 /// ```ignore,no_run
1067 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1068 /// let x = ListRepositoriesRequest::new().set_parent("example");
1069 /// ```
1070 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1071 self.parent = v.into();
1072 self
1073 }
1074
1075 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
1076 ///
1077 /// # Example
1078 /// ```ignore,no_run
1079 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1080 /// let x = ListRepositoriesRequest::new().set_page_size(42);
1081 /// ```
1082 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1083 self.page_size = v.into();
1084 self
1085 }
1086
1087 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
1088 ///
1089 /// # Example
1090 /// ```ignore,no_run
1091 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1092 /// let x = ListRepositoriesRequest::new().set_page_token("example");
1093 /// ```
1094 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1095 self.page_token = v.into();
1096 self
1097 }
1098
1099 /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1104 /// let x = ListRepositoriesRequest::new().set_order_by("example");
1105 /// ```
1106 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.order_by = v.into();
1108 self
1109 }
1110
1111 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
1112 ///
1113 /// # Example
1114 /// ```ignore,no_run
1115 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1116 /// let x = ListRepositoriesRequest::new().set_filter("example");
1117 /// ```
1118 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.filter = v.into();
1120 self
1121 }
1122}
1123
1124impl wkt::message::Message for ListRepositoriesRequest {
1125 fn typename() -> &'static str {
1126 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesRequest"
1127 }
1128}
1129
1130/// `ListRepositories` response message.
1131#[derive(Clone, Default, PartialEq)]
1132#[non_exhaustive]
1133pub struct ListRepositoriesResponse {
1134 /// List of repositories.
1135 pub repositories: std::vec::Vec<crate::model::Repository>,
1136
1137 /// A token which can be sent as `page_token` to retrieve the next page.
1138 /// If this field is omitted, there are no subsequent pages.
1139 pub next_page_token: std::string::String,
1140
1141 /// Locations which could not be reached.
1142 pub unreachable: std::vec::Vec<std::string::String>,
1143
1144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1145}
1146
1147impl ListRepositoriesResponse {
1148 /// Creates a new default instance.
1149 pub fn new() -> Self {
1150 std::default::Default::default()
1151 }
1152
1153 /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
1154 ///
1155 /// # Example
1156 /// ```ignore,no_run
1157 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1158 /// use google_cloud_dataform_v1::model::Repository;
1159 /// let x = ListRepositoriesResponse::new()
1160 /// .set_repositories([
1161 /// Repository::default()/* use setters */,
1162 /// Repository::default()/* use (different) setters */,
1163 /// ]);
1164 /// ```
1165 pub fn set_repositories<T, V>(mut self, v: T) -> Self
1166 where
1167 T: std::iter::IntoIterator<Item = V>,
1168 V: std::convert::Into<crate::model::Repository>,
1169 {
1170 use std::iter::Iterator;
1171 self.repositories = v.into_iter().map(|i| i.into()).collect();
1172 self
1173 }
1174
1175 /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
1176 ///
1177 /// # Example
1178 /// ```ignore,no_run
1179 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1180 /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
1181 /// ```
1182 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.next_page_token = v.into();
1184 self
1185 }
1186
1187 /// Sets the value of [unreachable][crate::model::ListRepositoriesResponse::unreachable].
1188 ///
1189 /// # Example
1190 /// ```ignore,no_run
1191 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1192 /// let x = ListRepositoriesResponse::new().set_unreachable(["a", "b", "c"]);
1193 /// ```
1194 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1195 where
1196 T: std::iter::IntoIterator<Item = V>,
1197 V: std::convert::Into<std::string::String>,
1198 {
1199 use std::iter::Iterator;
1200 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1201 self
1202 }
1203}
1204
1205impl wkt::message::Message for ListRepositoriesResponse {
1206 fn typename() -> &'static str {
1207 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesResponse"
1208 }
1209}
1210
1211#[doc(hidden)]
1212impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
1213 type PageItem = crate::model::Repository;
1214
1215 fn items(self) -> std::vec::Vec<Self::PageItem> {
1216 self.repositories
1217 }
1218
1219 fn next_page_token(&self) -> std::string::String {
1220 use std::clone::Clone;
1221 self.next_page_token.clone()
1222 }
1223}
1224
1225/// `MoveRepository` request message.
1226#[derive(Clone, Default, PartialEq)]
1227#[non_exhaustive]
1228pub struct MoveRepositoryRequest {
1229 /// Required. The full resource name of the repository to move.
1230 pub name: std::string::String,
1231
1232 /// Optional. The name of the Folder, TeamFolder, or root location to move the
1233 /// repository to. Can be in the format of: "" to move into the root User
1234 /// folder, `projects/*/locations/*/folders/*`,
1235 /// `projects/*/locations/*/teamFolders/*`
1236 pub destination_containing_folder: std::option::Option<std::string::String>,
1237
1238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1239}
1240
1241impl MoveRepositoryRequest {
1242 /// Creates a new default instance.
1243 pub fn new() -> Self {
1244 std::default::Default::default()
1245 }
1246
1247 /// Sets the value of [name][crate::model::MoveRepositoryRequest::name].
1248 ///
1249 /// # Example
1250 /// ```ignore,no_run
1251 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1252 /// # let project_id = "project_id";
1253 /// # let location_id = "location_id";
1254 /// # let repository_id = "repository_id";
1255 /// let x = MoveRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1256 /// ```
1257 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1258 self.name = v.into();
1259 self
1260 }
1261
1262 /// Sets the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1263 ///
1264 /// # Example
1265 /// ```ignore,no_run
1266 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1267 /// let x = MoveRepositoryRequest::new().set_destination_containing_folder("example");
1268 /// ```
1269 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
1270 where
1271 T: std::convert::Into<std::string::String>,
1272 {
1273 self.destination_containing_folder = std::option::Option::Some(v.into());
1274 self
1275 }
1276
1277 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1278 ///
1279 /// # Example
1280 /// ```ignore,no_run
1281 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1282 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(Some("example"));
1283 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(None::<String>);
1284 /// ```
1285 pub fn set_or_clear_destination_containing_folder<T>(
1286 mut self,
1287 v: std::option::Option<T>,
1288 ) -> Self
1289 where
1290 T: std::convert::Into<std::string::String>,
1291 {
1292 self.destination_containing_folder = v.map(|x| x.into());
1293 self
1294 }
1295}
1296
1297impl wkt::message::Message for MoveRepositoryRequest {
1298 fn typename() -> &'static str {
1299 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryRequest"
1300 }
1301}
1302
1303/// `GetRepository` request message.
1304#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct GetRepositoryRequest {
1307 /// Required. The repository's name.
1308 pub name: std::string::String,
1309
1310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1311}
1312
1313impl GetRepositoryRequest {
1314 /// Creates a new default instance.
1315 pub fn new() -> Self {
1316 std::default::Default::default()
1317 }
1318
1319 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
1320 ///
1321 /// # Example
1322 /// ```ignore,no_run
1323 /// # use google_cloud_dataform_v1::model::GetRepositoryRequest;
1324 /// # let project_id = "project_id";
1325 /// # let location_id = "location_id";
1326 /// # let repository_id = "repository_id";
1327 /// let x = GetRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1328 /// ```
1329 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.name = v.into();
1331 self
1332 }
1333}
1334
1335impl wkt::message::Message for GetRepositoryRequest {
1336 fn typename() -> &'static str {
1337 "type.googleapis.com/google.cloud.dataform.v1.GetRepositoryRequest"
1338 }
1339}
1340
1341/// `CreateRepository` request message.
1342#[derive(Clone, Default, PartialEq)]
1343#[non_exhaustive]
1344pub struct CreateRepositoryRequest {
1345 /// Required. The location in which to create the repository. Must be in the
1346 /// format `projects/*/locations/*`.
1347 pub parent: std::string::String,
1348
1349 /// Required. The repository to create.
1350 pub repository: std::option::Option<crate::model::Repository>,
1351
1352 /// Required. The ID to use for the repository, which will become the final
1353 /// component of the repository's resource name.
1354 pub repository_id: std::string::String,
1355
1356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1357}
1358
1359impl CreateRepositoryRequest {
1360 /// Creates a new default instance.
1361 pub fn new() -> Self {
1362 std::default::Default::default()
1363 }
1364
1365 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
1366 ///
1367 /// # Example
1368 /// ```ignore,no_run
1369 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1370 /// let x = CreateRepositoryRequest::new().set_parent("example");
1371 /// ```
1372 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1373 self.parent = v.into();
1374 self
1375 }
1376
1377 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
1378 ///
1379 /// # Example
1380 /// ```ignore,no_run
1381 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1382 /// use google_cloud_dataform_v1::model::Repository;
1383 /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1384 /// ```
1385 pub fn set_repository<T>(mut self, v: T) -> Self
1386 where
1387 T: std::convert::Into<crate::model::Repository>,
1388 {
1389 self.repository = std::option::Option::Some(v.into());
1390 self
1391 }
1392
1393 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
1394 ///
1395 /// # Example
1396 /// ```ignore,no_run
1397 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1398 /// use google_cloud_dataform_v1::model::Repository;
1399 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1400 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1401 /// ```
1402 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1403 where
1404 T: std::convert::Into<crate::model::Repository>,
1405 {
1406 self.repository = v.map(|x| x.into());
1407 self
1408 }
1409
1410 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
1411 ///
1412 /// # Example
1413 /// ```ignore,no_run
1414 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1415 /// let x = CreateRepositoryRequest::new().set_repository_id("example");
1416 /// ```
1417 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.repository_id = v.into();
1419 self
1420 }
1421}
1422
1423impl wkt::message::Message for CreateRepositoryRequest {
1424 fn typename() -> &'static str {
1425 "type.googleapis.com/google.cloud.dataform.v1.CreateRepositoryRequest"
1426 }
1427}
1428
1429/// `UpdateRepository` request message.
1430#[derive(Clone, Default, PartialEq)]
1431#[non_exhaustive]
1432pub struct UpdateRepositoryRequest {
1433 /// Optional. Specifies the fields to be updated in the repository. If left
1434 /// unset, all fields will be updated.
1435 pub update_mask: std::option::Option<wkt::FieldMask>,
1436
1437 /// Required. The repository to update.
1438 pub repository: std::option::Option<crate::model::Repository>,
1439
1440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1441}
1442
1443impl UpdateRepositoryRequest {
1444 /// Creates a new default instance.
1445 pub fn new() -> Self {
1446 std::default::Default::default()
1447 }
1448
1449 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1450 ///
1451 /// # Example
1452 /// ```ignore,no_run
1453 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1454 /// use wkt::FieldMask;
1455 /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1456 /// ```
1457 pub fn set_update_mask<T>(mut self, v: T) -> Self
1458 where
1459 T: std::convert::Into<wkt::FieldMask>,
1460 {
1461 self.update_mask = std::option::Option::Some(v.into());
1462 self
1463 }
1464
1465 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1466 ///
1467 /// # Example
1468 /// ```ignore,no_run
1469 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1470 /// use wkt::FieldMask;
1471 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1472 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1473 /// ```
1474 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1475 where
1476 T: std::convert::Into<wkt::FieldMask>,
1477 {
1478 self.update_mask = v.map(|x| x.into());
1479 self
1480 }
1481
1482 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1483 ///
1484 /// # Example
1485 /// ```ignore,no_run
1486 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1487 /// use google_cloud_dataform_v1::model::Repository;
1488 /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1489 /// ```
1490 pub fn set_repository<T>(mut self, v: T) -> Self
1491 where
1492 T: std::convert::Into<crate::model::Repository>,
1493 {
1494 self.repository = std::option::Option::Some(v.into());
1495 self
1496 }
1497
1498 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1499 ///
1500 /// # Example
1501 /// ```ignore,no_run
1502 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1503 /// use google_cloud_dataform_v1::model::Repository;
1504 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1505 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1506 /// ```
1507 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1508 where
1509 T: std::convert::Into<crate::model::Repository>,
1510 {
1511 self.repository = v.map(|x| x.into());
1512 self
1513 }
1514}
1515
1516impl wkt::message::Message for UpdateRepositoryRequest {
1517 fn typename() -> &'static str {
1518 "type.googleapis.com/google.cloud.dataform.v1.UpdateRepositoryRequest"
1519 }
1520}
1521
1522/// `DeleteRepository` request message.
1523#[derive(Clone, Default, PartialEq)]
1524#[non_exhaustive]
1525pub struct DeleteRepositoryRequest {
1526 /// Required. The repository's name.
1527 pub name: std::string::String,
1528
1529 /// Optional. If set to true, child resources of this repository (compilation
1530 /// results and workflow invocations) will also be deleted. Otherwise, the
1531 /// request will only succeed if the repository has no child resources.
1532 ///
1533 /// **Note:** *This flag doesn't support deletion of workspaces, release
1534 /// configs or workflow configs. If any of such resources exists in the
1535 /// repository, the request will fail.*.
1536 pub force: bool,
1537
1538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1539}
1540
1541impl DeleteRepositoryRequest {
1542 /// Creates a new default instance.
1543 pub fn new() -> Self {
1544 std::default::Default::default()
1545 }
1546
1547 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1548 ///
1549 /// # Example
1550 /// ```ignore,no_run
1551 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1552 /// # let project_id = "project_id";
1553 /// # let location_id = "location_id";
1554 /// # let repository_id = "repository_id";
1555 /// let x = DeleteRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1556 /// ```
1557 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1558 self.name = v.into();
1559 self
1560 }
1561
1562 /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
1563 ///
1564 /// # Example
1565 /// ```ignore,no_run
1566 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1567 /// let x = DeleteRepositoryRequest::new().set_force(true);
1568 /// ```
1569 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1570 self.force = v.into();
1571 self
1572 }
1573}
1574
1575impl wkt::message::Message for DeleteRepositoryRequest {
1576 fn typename() -> &'static str {
1577 "type.googleapis.com/google.cloud.dataform.v1.DeleteRepositoryRequest"
1578 }
1579}
1580
1581/// `CommitRepositoryChanges` request message.
1582#[derive(Clone, Default, PartialEq)]
1583#[non_exhaustive]
1584pub struct CommitRepositoryChangesRequest {
1585 /// Required. The repository's name.
1586 pub name: std::string::String,
1587
1588 /// Required. The changes to commit to the repository.
1589 pub commit_metadata: std::option::Option<crate::model::CommitMetadata>,
1590
1591 /// Optional. The commit SHA which must be the repository's current HEAD before
1592 /// applying this commit; otherwise this request will fail. If unset, no
1593 /// validation on the current HEAD commit SHA is performed.
1594 pub required_head_commit_sha: std::string::String,
1595
1596 /// Optional. A map to the path of the file to the operation. The path is the
1597 /// full file path including filename, from repository root.
1598 pub file_operations: std::collections::HashMap<
1599 std::string::String,
1600 crate::model::commit_repository_changes_request::FileOperation,
1601 >,
1602
1603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1604}
1605
1606impl CommitRepositoryChangesRequest {
1607 /// Creates a new default instance.
1608 pub fn new() -> Self {
1609 std::default::Default::default()
1610 }
1611
1612 /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
1613 ///
1614 /// # Example
1615 /// ```ignore,no_run
1616 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1617 /// # let project_id = "project_id";
1618 /// # let location_id = "location_id";
1619 /// # let repository_id = "repository_id";
1620 /// let x = CommitRepositoryChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1621 /// ```
1622 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.name = v.into();
1624 self
1625 }
1626
1627 /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1628 ///
1629 /// # Example
1630 /// ```ignore,no_run
1631 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1632 /// use google_cloud_dataform_v1::model::CommitMetadata;
1633 /// let x = CommitRepositoryChangesRequest::new().set_commit_metadata(CommitMetadata::default()/* use setters */);
1634 /// ```
1635 pub fn set_commit_metadata<T>(mut self, v: T) -> Self
1636 where
1637 T: std::convert::Into<crate::model::CommitMetadata>,
1638 {
1639 self.commit_metadata = std::option::Option::Some(v.into());
1640 self
1641 }
1642
1643 /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1644 ///
1645 /// # Example
1646 /// ```ignore,no_run
1647 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1648 /// use google_cloud_dataform_v1::model::CommitMetadata;
1649 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(Some(CommitMetadata::default()/* use setters */));
1650 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(None::<CommitMetadata>);
1651 /// ```
1652 pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1653 where
1654 T: std::convert::Into<crate::model::CommitMetadata>,
1655 {
1656 self.commit_metadata = v.map(|x| x.into());
1657 self
1658 }
1659
1660 /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
1661 ///
1662 /// # Example
1663 /// ```ignore,no_run
1664 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1665 /// let x = CommitRepositoryChangesRequest::new().set_required_head_commit_sha("example");
1666 /// ```
1667 pub fn set_required_head_commit_sha<T: std::convert::Into<std::string::String>>(
1668 mut self,
1669 v: T,
1670 ) -> Self {
1671 self.required_head_commit_sha = v.into();
1672 self
1673 }
1674
1675 /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1680 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1681 /// let x = CommitRepositoryChangesRequest::new().set_file_operations([
1682 /// ("key0", FileOperation::default()/* use setters */),
1683 /// ("key1", FileOperation::default()/* use (different) setters */),
1684 /// ]);
1685 /// ```
1686 pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
1687 where
1688 T: std::iter::IntoIterator<Item = (K, V)>,
1689 K: std::convert::Into<std::string::String>,
1690 V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
1691 {
1692 use std::iter::Iterator;
1693 self.file_operations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1694 self
1695 }
1696}
1697
1698impl wkt::message::Message for CommitRepositoryChangesRequest {
1699 fn typename() -> &'static str {
1700 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest"
1701 }
1702}
1703
1704/// Defines additional types related to [CommitRepositoryChangesRequest].
1705pub mod commit_repository_changes_request {
1706 #[allow(unused_imports)]
1707 use super::*;
1708
1709 /// Represents a single file operation to the repository.
1710 #[derive(Clone, Default, PartialEq)]
1711 #[non_exhaustive]
1712 pub struct FileOperation {
1713 /// The operation to perform on the file.
1714 pub operation: std::option::Option<
1715 crate::model::commit_repository_changes_request::file_operation::Operation,
1716 >,
1717
1718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1719 }
1720
1721 impl FileOperation {
1722 /// Creates a new default instance.
1723 pub fn new() -> Self {
1724 std::default::Default::default()
1725 }
1726
1727 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation].
1728 ///
1729 /// Note that all the setters affecting `operation` are mutually
1730 /// exclusive.
1731 ///
1732 /// # Example
1733 /// ```ignore,no_run
1734 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1735 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1736 /// let x = FileOperation::new().set_operation(Some(
1737 /// google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::Operation::WriteFile(WriteFile::default().into())));
1738 /// ```
1739 pub fn set_operation<
1740 T: std::convert::Into<
1741 std::option::Option<
1742 crate::model::commit_repository_changes_request::file_operation::Operation,
1743 >,
1744 >,
1745 >(
1746 mut self,
1747 v: T,
1748 ) -> Self {
1749 self.operation = v.into();
1750 self
1751 }
1752
1753 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1754 /// if it holds a `WriteFile`, `None` if the field is not set or
1755 /// holds a different branch.
1756 pub fn write_file(
1757 &self,
1758 ) -> std::option::Option<
1759 &std::boxed::Box<
1760 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1761 >,
1762 > {
1763 #[allow(unreachable_patterns)]
1764 self.operation.as_ref().and_then(|v| match v {
1765 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(v) => std::option::Option::Some(v),
1766 _ => std::option::Option::None,
1767 })
1768 }
1769
1770 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1771 /// to hold a `WriteFile`.
1772 ///
1773 /// Note that all the setters affecting `operation` are
1774 /// mutually exclusive.
1775 ///
1776 /// # Example
1777 /// ```ignore,no_run
1778 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1779 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1780 /// let x = FileOperation::new().set_write_file(WriteFile::default()/* use setters */);
1781 /// assert!(x.write_file().is_some());
1782 /// assert!(x.delete_file().is_none());
1783 /// ```
1784 pub fn set_write_file<
1785 T: std::convert::Into<
1786 std::boxed::Box<
1787 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1788 >,
1789 >,
1790 >(
1791 mut self,
1792 v: T,
1793 ) -> Self {
1794 self.operation = std::option::Option::Some(
1795 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(
1796 v.into()
1797 )
1798 );
1799 self
1800 }
1801
1802 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1803 /// if it holds a `DeleteFile`, `None` if the field is not set or
1804 /// holds a different branch.
1805 pub fn delete_file(
1806 &self,
1807 ) -> std::option::Option<
1808 &std::boxed::Box<
1809 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1810 >,
1811 > {
1812 #[allow(unreachable_patterns)]
1813 self.operation.as_ref().and_then(|v| match v {
1814 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(v) => std::option::Option::Some(v),
1815 _ => std::option::Option::None,
1816 })
1817 }
1818
1819 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1820 /// to hold a `DeleteFile`.
1821 ///
1822 /// Note that all the setters affecting `operation` are
1823 /// mutually exclusive.
1824 ///
1825 /// # Example
1826 /// ```ignore,no_run
1827 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1828 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::DeleteFile;
1829 /// let x = FileOperation::new().set_delete_file(DeleteFile::default()/* use setters */);
1830 /// assert!(x.delete_file().is_some());
1831 /// assert!(x.write_file().is_none());
1832 /// ```
1833 pub fn set_delete_file<
1834 T: std::convert::Into<
1835 std::boxed::Box<
1836 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1837 >,
1838 >,
1839 >(
1840 mut self,
1841 v: T,
1842 ) -> Self {
1843 self.operation = std::option::Option::Some(
1844 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(
1845 v.into()
1846 )
1847 );
1848 self
1849 }
1850 }
1851
1852 impl wkt::message::Message for FileOperation {
1853 fn typename() -> &'static str {
1854 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation"
1855 }
1856 }
1857
1858 /// Defines additional types related to [FileOperation].
1859 pub mod file_operation {
1860 #[allow(unused_imports)]
1861 use super::*;
1862
1863 /// Represents the write file operation (for files added or modified).
1864 #[derive(Clone, Default, PartialEq)]
1865 #[non_exhaustive]
1866 pub struct WriteFile {
1867 /// The file's contents.
1868 pub contents: ::bytes::Bytes,
1869
1870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1871 }
1872
1873 impl WriteFile {
1874 /// Creates a new default instance.
1875 pub fn new() -> Self {
1876 std::default::Default::default()
1877 }
1878
1879 /// Sets the value of [contents][crate::model::commit_repository_changes_request::file_operation::WriteFile::contents].
1880 ///
1881 /// # Example
1882 /// ```ignore,no_run
1883 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1884 /// let x = WriteFile::new().set_contents(bytes::Bytes::from_static(b"example"));
1885 /// ```
1886 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1887 self.contents = v.into();
1888 self
1889 }
1890 }
1891
1892 impl wkt::message::Message for WriteFile {
1893 fn typename() -> &'static str {
1894 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.WriteFile"
1895 }
1896 }
1897
1898 /// Represents the delete file operation.
1899 #[derive(Clone, Default, PartialEq)]
1900 #[non_exhaustive]
1901 pub struct DeleteFile {
1902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1903 }
1904
1905 impl DeleteFile {
1906 /// Creates a new default instance.
1907 pub fn new() -> Self {
1908 std::default::Default::default()
1909 }
1910 }
1911
1912 impl wkt::message::Message for DeleteFile {
1913 fn typename() -> &'static str {
1914 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.DeleteFile"
1915 }
1916 }
1917
1918 /// The operation to perform on the file.
1919 #[derive(Clone, Debug, PartialEq)]
1920 #[non_exhaustive]
1921 pub enum Operation {
1922 /// Represents the write operation.
1923 WriteFile(
1924 std::boxed::Box<
1925 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1926 >,
1927 ),
1928 /// Represents the delete operation.
1929 DeleteFile(
1930 std::boxed::Box<
1931 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1932 >,
1933 ),
1934 }
1935 }
1936}
1937
1938/// `CommitRepositoryChanges` response message.
1939#[derive(Clone, Default, PartialEq)]
1940#[non_exhaustive]
1941pub struct CommitRepositoryChangesResponse {
1942 /// The commit SHA of the current commit.
1943 pub commit_sha: std::string::String,
1944
1945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1946}
1947
1948impl CommitRepositoryChangesResponse {
1949 /// Creates a new default instance.
1950 pub fn new() -> Self {
1951 std::default::Default::default()
1952 }
1953
1954 /// Sets the value of [commit_sha][crate::model::CommitRepositoryChangesResponse::commit_sha].
1955 ///
1956 /// # Example
1957 /// ```ignore,no_run
1958 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesResponse;
1959 /// let x = CommitRepositoryChangesResponse::new().set_commit_sha("example");
1960 /// ```
1961 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1962 self.commit_sha = v.into();
1963 self
1964 }
1965}
1966
1967impl wkt::message::Message for CommitRepositoryChangesResponse {
1968 fn typename() -> &'static str {
1969 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesResponse"
1970 }
1971}
1972
1973/// `ReadRepositoryFile` request message.
1974#[derive(Clone, Default, PartialEq)]
1975#[non_exhaustive]
1976pub struct ReadRepositoryFileRequest {
1977 /// Required. The repository's name.
1978 pub name: std::string::String,
1979
1980 /// Optional. The commit SHA for the commit to read from. If unset, the file
1981 /// will be read from HEAD.
1982 pub commit_sha: std::string::String,
1983
1984 /// Required. Full file path to read including filename, from repository root.
1985 pub path: std::string::String,
1986
1987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1988}
1989
1990impl ReadRepositoryFileRequest {
1991 /// Creates a new default instance.
1992 pub fn new() -> Self {
1993 std::default::Default::default()
1994 }
1995
1996 /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
1997 ///
1998 /// # Example
1999 /// ```ignore,no_run
2000 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2001 /// # let project_id = "project_id";
2002 /// # let location_id = "location_id";
2003 /// # let repository_id = "repository_id";
2004 /// let x = ReadRepositoryFileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2005 /// ```
2006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2007 self.name = v.into();
2008 self
2009 }
2010
2011 /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
2012 ///
2013 /// # Example
2014 /// ```ignore,no_run
2015 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2016 /// let x = ReadRepositoryFileRequest::new().set_commit_sha("example");
2017 /// ```
2018 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.commit_sha = v.into();
2020 self
2021 }
2022
2023 /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
2024 ///
2025 /// # Example
2026 /// ```ignore,no_run
2027 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2028 /// let x = ReadRepositoryFileRequest::new().set_path("example");
2029 /// ```
2030 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2031 self.path = v.into();
2032 self
2033 }
2034}
2035
2036impl wkt::message::Message for ReadRepositoryFileRequest {
2037 fn typename() -> &'static str {
2038 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileRequest"
2039 }
2040}
2041
2042/// `ReadRepositoryFile` response message.
2043#[derive(Clone, Default, PartialEq)]
2044#[non_exhaustive]
2045pub struct ReadRepositoryFileResponse {
2046 /// The file's contents.
2047 pub contents: ::bytes::Bytes,
2048
2049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2050}
2051
2052impl ReadRepositoryFileResponse {
2053 /// Creates a new default instance.
2054 pub fn new() -> Self {
2055 std::default::Default::default()
2056 }
2057
2058 /// Sets the value of [contents][crate::model::ReadRepositoryFileResponse::contents].
2059 ///
2060 /// # Example
2061 /// ```ignore,no_run
2062 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileResponse;
2063 /// let x = ReadRepositoryFileResponse::new().set_contents(bytes::Bytes::from_static(b"example"));
2064 /// ```
2065 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2066 self.contents = v.into();
2067 self
2068 }
2069}
2070
2071impl wkt::message::Message for ReadRepositoryFileResponse {
2072 fn typename() -> &'static str {
2073 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileResponse"
2074 }
2075}
2076
2077/// `QueryRepositoryDirectoryContents` request message.
2078#[derive(Clone, Default, PartialEq)]
2079#[non_exhaustive]
2080pub struct QueryRepositoryDirectoryContentsRequest {
2081 /// Required. The repository's name.
2082 pub name: std::string::String,
2083
2084 /// Optional. The Commit SHA for the commit to query from. If unset, the
2085 /// directory will be queried from HEAD.
2086 pub commit_sha: std::string::String,
2087
2088 /// Optional. The directory's full path including directory name, relative to
2089 /// root. If left unset, the root is used.
2090 pub path: std::string::String,
2091
2092 /// Optional. Maximum number of paths to return. The server may return fewer
2093 /// items than requested. If unspecified, the server will pick an appropriate
2094 /// default.
2095 pub page_size: i32,
2096
2097 /// Optional. Page token received from a previous
2098 /// `QueryRepositoryDirectoryContents` call. Provide this to retrieve the
2099 /// subsequent page.
2100 ///
2101 /// When paginating, all other parameters provided to
2102 /// `QueryRepositoryDirectoryContents`, with the exception of `page_size`, must
2103 /// match the call that provided the page token.
2104 pub page_token: std::string::String,
2105
2106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2107}
2108
2109impl QueryRepositoryDirectoryContentsRequest {
2110 /// Creates a new default instance.
2111 pub fn new() -> Self {
2112 std::default::Default::default()
2113 }
2114
2115 /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
2116 ///
2117 /// # Example
2118 /// ```ignore,no_run
2119 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2120 /// # let project_id = "project_id";
2121 /// # let location_id = "location_id";
2122 /// # let repository_id = "repository_id";
2123 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2124 /// ```
2125 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2126 self.name = v.into();
2127 self
2128 }
2129
2130 /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
2131 ///
2132 /// # Example
2133 /// ```ignore,no_run
2134 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2135 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_commit_sha("example");
2136 /// ```
2137 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2138 self.commit_sha = v.into();
2139 self
2140 }
2141
2142 /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
2143 ///
2144 /// # Example
2145 /// ```ignore,no_run
2146 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2147 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_path("example");
2148 /// ```
2149 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2150 self.path = v.into();
2151 self
2152 }
2153
2154 /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
2155 ///
2156 /// # Example
2157 /// ```ignore,no_run
2158 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2159 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_size(42);
2160 /// ```
2161 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2162 self.page_size = v.into();
2163 self
2164 }
2165
2166 /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
2167 ///
2168 /// # Example
2169 /// ```ignore,no_run
2170 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2171 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_token("example");
2172 /// ```
2173 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2174 self.page_token = v.into();
2175 self
2176 }
2177}
2178
2179impl wkt::message::Message for QueryRepositoryDirectoryContentsRequest {
2180 fn typename() -> &'static str {
2181 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest"
2182 }
2183}
2184
2185/// `QueryRepositoryDirectoryContents` response message.
2186#[derive(Clone, Default, PartialEq)]
2187#[non_exhaustive]
2188pub struct QueryRepositoryDirectoryContentsResponse {
2189 /// List of entries in the directory.
2190 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
2191
2192 /// A token, which can be sent as `page_token` to retrieve the next page.
2193 /// If this field is omitted, there are no subsequent pages.
2194 pub next_page_token: std::string::String,
2195
2196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2197}
2198
2199impl QueryRepositoryDirectoryContentsResponse {
2200 /// Creates a new default instance.
2201 pub fn new() -> Self {
2202 std::default::Default::default()
2203 }
2204
2205 /// Sets the value of [directory_entries][crate::model::QueryRepositoryDirectoryContentsResponse::directory_entries].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2210 /// use google_cloud_dataform_v1::model::DirectoryEntry;
2211 /// let x = QueryRepositoryDirectoryContentsResponse::new()
2212 /// .set_directory_entries([
2213 /// DirectoryEntry::default()/* use setters */,
2214 /// DirectoryEntry::default()/* use (different) setters */,
2215 /// ]);
2216 /// ```
2217 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
2218 where
2219 T: std::iter::IntoIterator<Item = V>,
2220 V: std::convert::Into<crate::model::DirectoryEntry>,
2221 {
2222 use std::iter::Iterator;
2223 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
2224 self
2225 }
2226
2227 /// Sets the value of [next_page_token][crate::model::QueryRepositoryDirectoryContentsResponse::next_page_token].
2228 ///
2229 /// # Example
2230 /// ```ignore,no_run
2231 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2232 /// let x = QueryRepositoryDirectoryContentsResponse::new().set_next_page_token("example");
2233 /// ```
2234 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2235 self.next_page_token = v.into();
2236 self
2237 }
2238}
2239
2240impl wkt::message::Message for QueryRepositoryDirectoryContentsResponse {
2241 fn typename() -> &'static str {
2242 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsResponse"
2243 }
2244}
2245
2246#[doc(hidden)]
2247impl google_cloud_gax::paginator::internal::PageableResponse
2248 for QueryRepositoryDirectoryContentsResponse
2249{
2250 type PageItem = crate::model::DirectoryEntry;
2251
2252 fn items(self) -> std::vec::Vec<Self::PageItem> {
2253 self.directory_entries
2254 }
2255
2256 fn next_page_token(&self) -> std::string::String {
2257 use std::clone::Clone;
2258 self.next_page_token.clone()
2259 }
2260}
2261
2262/// `FetchRepositoryHistory` request message.
2263#[derive(Clone, Default, PartialEq)]
2264#[non_exhaustive]
2265pub struct FetchRepositoryHistoryRequest {
2266 /// Required. The repository's name.
2267 pub name: std::string::String,
2268
2269 /// Optional. Maximum number of commits to return. The server may return fewer
2270 /// items than requested. If unspecified, the server will pick an appropriate
2271 /// default.
2272 pub page_size: i32,
2273
2274 /// Optional. Page token received from a previous `FetchRepositoryHistory`
2275 /// call. Provide this to retrieve the subsequent page.
2276 ///
2277 /// When paginating, all other parameters provided to `FetchRepositoryHistory`,
2278 /// with the exception of `page_size`, must match the call that provided the
2279 /// page token.
2280 pub page_token: std::string::String,
2281
2282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2283}
2284
2285impl FetchRepositoryHistoryRequest {
2286 /// Creates a new default instance.
2287 pub fn new() -> Self {
2288 std::default::Default::default()
2289 }
2290
2291 /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2296 /// # let project_id = "project_id";
2297 /// # let location_id = "location_id";
2298 /// # let repository_id = "repository_id";
2299 /// let x = FetchRepositoryHistoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2300 /// ```
2301 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2302 self.name = v.into();
2303 self
2304 }
2305
2306 /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
2307 ///
2308 /// # Example
2309 /// ```ignore,no_run
2310 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2311 /// let x = FetchRepositoryHistoryRequest::new().set_page_size(42);
2312 /// ```
2313 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2314 self.page_size = v.into();
2315 self
2316 }
2317
2318 /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
2319 ///
2320 /// # Example
2321 /// ```ignore,no_run
2322 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2323 /// let x = FetchRepositoryHistoryRequest::new().set_page_token("example");
2324 /// ```
2325 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2326 self.page_token = v.into();
2327 self
2328 }
2329}
2330
2331impl wkt::message::Message for FetchRepositoryHistoryRequest {
2332 fn typename() -> &'static str {
2333 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryRequest"
2334 }
2335}
2336
2337/// `FetchRepositoryHistory` response message.
2338#[derive(Clone, Default, PartialEq)]
2339#[non_exhaustive]
2340pub struct FetchRepositoryHistoryResponse {
2341 /// A list of commit logs, ordered by 'git log' default order.
2342 pub commits: std::vec::Vec<crate::model::CommitLogEntry>,
2343
2344 /// A token, which can be sent as `page_token` to retrieve the next page.
2345 /// If this field is omitted, there are no subsequent pages.
2346 pub next_page_token: std::string::String,
2347
2348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2349}
2350
2351impl FetchRepositoryHistoryResponse {
2352 /// Creates a new default instance.
2353 pub fn new() -> Self {
2354 std::default::Default::default()
2355 }
2356
2357 /// Sets the value of [commits][crate::model::FetchRepositoryHistoryResponse::commits].
2358 ///
2359 /// # Example
2360 /// ```ignore,no_run
2361 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2362 /// use google_cloud_dataform_v1::model::CommitLogEntry;
2363 /// let x = FetchRepositoryHistoryResponse::new()
2364 /// .set_commits([
2365 /// CommitLogEntry::default()/* use setters */,
2366 /// CommitLogEntry::default()/* use (different) setters */,
2367 /// ]);
2368 /// ```
2369 pub fn set_commits<T, V>(mut self, v: T) -> Self
2370 where
2371 T: std::iter::IntoIterator<Item = V>,
2372 V: std::convert::Into<crate::model::CommitLogEntry>,
2373 {
2374 use std::iter::Iterator;
2375 self.commits = v.into_iter().map(|i| i.into()).collect();
2376 self
2377 }
2378
2379 /// Sets the value of [next_page_token][crate::model::FetchRepositoryHistoryResponse::next_page_token].
2380 ///
2381 /// # Example
2382 /// ```ignore,no_run
2383 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2384 /// let x = FetchRepositoryHistoryResponse::new().set_next_page_token("example");
2385 /// ```
2386 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2387 self.next_page_token = v.into();
2388 self
2389 }
2390}
2391
2392impl wkt::message::Message for FetchRepositoryHistoryResponse {
2393 fn typename() -> &'static str {
2394 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryResponse"
2395 }
2396}
2397
2398#[doc(hidden)]
2399impl google_cloud_gax::paginator::internal::PageableResponse for FetchRepositoryHistoryResponse {
2400 type PageItem = crate::model::CommitLogEntry;
2401
2402 fn items(self) -> std::vec::Vec<Self::PageItem> {
2403 self.commits
2404 }
2405
2406 fn next_page_token(&self) -> std::string::String {
2407 use std::clone::Clone;
2408 self.next_page_token.clone()
2409 }
2410}
2411
2412/// Represents a single commit log.
2413#[derive(Clone, Default, PartialEq)]
2414#[non_exhaustive]
2415pub struct CommitLogEntry {
2416 /// Commit timestamp.
2417 pub commit_time: std::option::Option<wkt::Timestamp>,
2418
2419 /// The commit SHA for this commit log entry.
2420 pub commit_sha: std::string::String,
2421
2422 /// The commit author for this commit log entry.
2423 pub author: std::option::Option<crate::model::CommitAuthor>,
2424
2425 /// The commit message for this commit log entry.
2426 pub commit_message: std::string::String,
2427
2428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2429}
2430
2431impl CommitLogEntry {
2432 /// Creates a new default instance.
2433 pub fn new() -> Self {
2434 std::default::Default::default()
2435 }
2436
2437 /// Sets the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2438 ///
2439 /// # Example
2440 /// ```ignore,no_run
2441 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2442 /// use wkt::Timestamp;
2443 /// let x = CommitLogEntry::new().set_commit_time(Timestamp::default()/* use setters */);
2444 /// ```
2445 pub fn set_commit_time<T>(mut self, v: T) -> Self
2446 where
2447 T: std::convert::Into<wkt::Timestamp>,
2448 {
2449 self.commit_time = std::option::Option::Some(v.into());
2450 self
2451 }
2452
2453 /// Sets or clears the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2454 ///
2455 /// # Example
2456 /// ```ignore,no_run
2457 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2458 /// use wkt::Timestamp;
2459 /// let x = CommitLogEntry::new().set_or_clear_commit_time(Some(Timestamp::default()/* use setters */));
2460 /// let x = CommitLogEntry::new().set_or_clear_commit_time(None::<Timestamp>);
2461 /// ```
2462 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
2463 where
2464 T: std::convert::Into<wkt::Timestamp>,
2465 {
2466 self.commit_time = v.map(|x| x.into());
2467 self
2468 }
2469
2470 /// Sets the value of [commit_sha][crate::model::CommitLogEntry::commit_sha].
2471 ///
2472 /// # Example
2473 /// ```ignore,no_run
2474 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2475 /// let x = CommitLogEntry::new().set_commit_sha("example");
2476 /// ```
2477 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2478 self.commit_sha = v.into();
2479 self
2480 }
2481
2482 /// Sets the value of [author][crate::model::CommitLogEntry::author].
2483 ///
2484 /// # Example
2485 /// ```ignore,no_run
2486 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2487 /// use google_cloud_dataform_v1::model::CommitAuthor;
2488 /// let x = CommitLogEntry::new().set_author(CommitAuthor::default()/* use setters */);
2489 /// ```
2490 pub fn set_author<T>(mut self, v: T) -> Self
2491 where
2492 T: std::convert::Into<crate::model::CommitAuthor>,
2493 {
2494 self.author = std::option::Option::Some(v.into());
2495 self
2496 }
2497
2498 /// Sets or clears the value of [author][crate::model::CommitLogEntry::author].
2499 ///
2500 /// # Example
2501 /// ```ignore,no_run
2502 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2503 /// use google_cloud_dataform_v1::model::CommitAuthor;
2504 /// let x = CommitLogEntry::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2505 /// let x = CommitLogEntry::new().set_or_clear_author(None::<CommitAuthor>);
2506 /// ```
2507 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2508 where
2509 T: std::convert::Into<crate::model::CommitAuthor>,
2510 {
2511 self.author = v.map(|x| x.into());
2512 self
2513 }
2514
2515 /// Sets the value of [commit_message][crate::model::CommitLogEntry::commit_message].
2516 ///
2517 /// # Example
2518 /// ```ignore,no_run
2519 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2520 /// let x = CommitLogEntry::new().set_commit_message("example");
2521 /// ```
2522 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2523 self.commit_message = v.into();
2524 self
2525 }
2526}
2527
2528impl wkt::message::Message for CommitLogEntry {
2529 fn typename() -> &'static str {
2530 "type.googleapis.com/google.cloud.dataform.v1.CommitLogEntry"
2531 }
2532}
2533
2534/// Represents a Dataform Git commit.
2535#[derive(Clone, Default, PartialEq)]
2536#[non_exhaustive]
2537pub struct CommitMetadata {
2538 /// Required. The commit's author.
2539 pub author: std::option::Option<crate::model::CommitAuthor>,
2540
2541 /// Optional. The commit's message.
2542 pub commit_message: std::string::String,
2543
2544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2545}
2546
2547impl CommitMetadata {
2548 /// Creates a new default instance.
2549 pub fn new() -> Self {
2550 std::default::Default::default()
2551 }
2552
2553 /// Sets the value of [author][crate::model::CommitMetadata::author].
2554 ///
2555 /// # Example
2556 /// ```ignore,no_run
2557 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2558 /// use google_cloud_dataform_v1::model::CommitAuthor;
2559 /// let x = CommitMetadata::new().set_author(CommitAuthor::default()/* use setters */);
2560 /// ```
2561 pub fn set_author<T>(mut self, v: T) -> Self
2562 where
2563 T: std::convert::Into<crate::model::CommitAuthor>,
2564 {
2565 self.author = std::option::Option::Some(v.into());
2566 self
2567 }
2568
2569 /// Sets or clears the value of [author][crate::model::CommitMetadata::author].
2570 ///
2571 /// # Example
2572 /// ```ignore,no_run
2573 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2574 /// use google_cloud_dataform_v1::model::CommitAuthor;
2575 /// let x = CommitMetadata::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2576 /// let x = CommitMetadata::new().set_or_clear_author(None::<CommitAuthor>);
2577 /// ```
2578 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2579 where
2580 T: std::convert::Into<crate::model::CommitAuthor>,
2581 {
2582 self.author = v.map(|x| x.into());
2583 self
2584 }
2585
2586 /// Sets the value of [commit_message][crate::model::CommitMetadata::commit_message].
2587 ///
2588 /// # Example
2589 /// ```ignore,no_run
2590 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2591 /// let x = CommitMetadata::new().set_commit_message("example");
2592 /// ```
2593 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2594 self.commit_message = v.into();
2595 self
2596 }
2597}
2598
2599impl wkt::message::Message for CommitMetadata {
2600 fn typename() -> &'static str {
2601 "type.googleapis.com/google.cloud.dataform.v1.CommitMetadata"
2602 }
2603}
2604
2605/// `ComputeRepositoryAccessTokenStatus` request message.
2606#[derive(Clone, Default, PartialEq)]
2607#[non_exhaustive]
2608pub struct ComputeRepositoryAccessTokenStatusRequest {
2609 /// Required. The repository's name.
2610 pub name: std::string::String,
2611
2612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2613}
2614
2615impl ComputeRepositoryAccessTokenStatusRequest {
2616 /// Creates a new default instance.
2617 pub fn new() -> Self {
2618 std::default::Default::default()
2619 }
2620
2621 /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
2622 ///
2623 /// # Example
2624 /// ```ignore,no_run
2625 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusRequest;
2626 /// # let project_id = "project_id";
2627 /// # let location_id = "location_id";
2628 /// # let repository_id = "repository_id";
2629 /// let x = ComputeRepositoryAccessTokenStatusRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2630 /// ```
2631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2632 self.name = v.into();
2633 self
2634 }
2635}
2636
2637impl wkt::message::Message for ComputeRepositoryAccessTokenStatusRequest {
2638 fn typename() -> &'static str {
2639 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusRequest"
2640 }
2641}
2642
2643/// `ComputeRepositoryAccessTokenStatus` response message.
2644#[derive(Clone, Default, PartialEq)]
2645#[non_exhaustive]
2646pub struct ComputeRepositoryAccessTokenStatusResponse {
2647 /// Indicates the status of the Git access token.
2648 pub token_status: crate::model::compute_repository_access_token_status_response::TokenStatus,
2649
2650 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2651}
2652
2653impl ComputeRepositoryAccessTokenStatusResponse {
2654 /// Creates a new default instance.
2655 pub fn new() -> Self {
2656 std::default::Default::default()
2657 }
2658
2659 /// Sets the value of [token_status][crate::model::ComputeRepositoryAccessTokenStatusResponse::token_status].
2660 ///
2661 /// # Example
2662 /// ```ignore,no_run
2663 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusResponse;
2664 /// use google_cloud_dataform_v1::model::compute_repository_access_token_status_response::TokenStatus;
2665 /// let x0 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::NotFound);
2666 /// let x1 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Invalid);
2667 /// let x2 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Valid);
2668 /// ```
2669 pub fn set_token_status<
2670 T: std::convert::Into<
2671 crate::model::compute_repository_access_token_status_response::TokenStatus,
2672 >,
2673 >(
2674 mut self,
2675 v: T,
2676 ) -> Self {
2677 self.token_status = v.into();
2678 self
2679 }
2680}
2681
2682impl wkt::message::Message for ComputeRepositoryAccessTokenStatusResponse {
2683 fn typename() -> &'static str {
2684 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse"
2685 }
2686}
2687
2688/// Defines additional types related to [ComputeRepositoryAccessTokenStatusResponse].
2689pub mod compute_repository_access_token_status_response {
2690 #[allow(unused_imports)]
2691 use super::*;
2692
2693 /// Indicates the status of a Git authentication token.
2694 ///
2695 /// # Working with unknown values
2696 ///
2697 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2698 /// additional enum variants at any time. Adding new variants is not considered
2699 /// a breaking change. Applications should write their code in anticipation of:
2700 ///
2701 /// - New values appearing in future releases of the client library, **and**
2702 /// - New values received dynamically, without application changes.
2703 ///
2704 /// Please consult the [Working with enums] section in the user guide for some
2705 /// guidelines.
2706 ///
2707 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2708 #[derive(Clone, Debug, PartialEq)]
2709 #[non_exhaustive]
2710 pub enum TokenStatus {
2711 /// Default value. This value is unused.
2712 Unspecified,
2713 /// The token could not be found in Secret Manager (or the Dataform
2714 /// Service Account did not have permission to access it).
2715 NotFound,
2716 /// The token could not be used to authenticate against the Git remote.
2717 Invalid,
2718 /// The token was used successfully to authenticate against the Git remote.
2719 Valid,
2720 /// The token is not accessible due to permission issues.
2721 PermissionDenied,
2722 /// If set, the enum was initialized with an unknown value.
2723 ///
2724 /// Applications can examine the value using [TokenStatus::value] or
2725 /// [TokenStatus::name].
2726 UnknownValue(token_status::UnknownValue),
2727 }
2728
2729 #[doc(hidden)]
2730 pub mod token_status {
2731 #[allow(unused_imports)]
2732 use super::*;
2733 #[derive(Clone, Debug, PartialEq)]
2734 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2735 }
2736
2737 impl TokenStatus {
2738 /// Gets the enum value.
2739 ///
2740 /// Returns `None` if the enum contains an unknown value deserialized from
2741 /// the string representation of enums.
2742 pub fn value(&self) -> std::option::Option<i32> {
2743 match self {
2744 Self::Unspecified => std::option::Option::Some(0),
2745 Self::NotFound => std::option::Option::Some(1),
2746 Self::Invalid => std::option::Option::Some(2),
2747 Self::Valid => std::option::Option::Some(3),
2748 Self::PermissionDenied => std::option::Option::Some(4),
2749 Self::UnknownValue(u) => u.0.value(),
2750 }
2751 }
2752
2753 /// Gets the enum value as a string.
2754 ///
2755 /// Returns `None` if the enum contains an unknown value deserialized from
2756 /// the integer representation of enums.
2757 pub fn name(&self) -> std::option::Option<&str> {
2758 match self {
2759 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
2760 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
2761 Self::Invalid => std::option::Option::Some("INVALID"),
2762 Self::Valid => std::option::Option::Some("VALID"),
2763 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2764 Self::UnknownValue(u) => u.0.name(),
2765 }
2766 }
2767 }
2768
2769 impl std::default::Default for TokenStatus {
2770 fn default() -> Self {
2771 use std::convert::From;
2772 Self::from(0)
2773 }
2774 }
2775
2776 impl std::fmt::Display for TokenStatus {
2777 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2778 wkt::internal::display_enum(f, self.name(), self.value())
2779 }
2780 }
2781
2782 impl std::convert::From<i32> for TokenStatus {
2783 fn from(value: i32) -> Self {
2784 match value {
2785 0 => Self::Unspecified,
2786 1 => Self::NotFound,
2787 2 => Self::Invalid,
2788 3 => Self::Valid,
2789 4 => Self::PermissionDenied,
2790 _ => Self::UnknownValue(token_status::UnknownValue(
2791 wkt::internal::UnknownEnumValue::Integer(value),
2792 )),
2793 }
2794 }
2795 }
2796
2797 impl std::convert::From<&str> for TokenStatus {
2798 fn from(value: &str) -> Self {
2799 use std::string::ToString;
2800 match value {
2801 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
2802 "NOT_FOUND" => Self::NotFound,
2803 "INVALID" => Self::Invalid,
2804 "VALID" => Self::Valid,
2805 "PERMISSION_DENIED" => Self::PermissionDenied,
2806 _ => Self::UnknownValue(token_status::UnknownValue(
2807 wkt::internal::UnknownEnumValue::String(value.to_string()),
2808 )),
2809 }
2810 }
2811 }
2812
2813 impl serde::ser::Serialize for TokenStatus {
2814 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2815 where
2816 S: serde::Serializer,
2817 {
2818 match self {
2819 Self::Unspecified => serializer.serialize_i32(0),
2820 Self::NotFound => serializer.serialize_i32(1),
2821 Self::Invalid => serializer.serialize_i32(2),
2822 Self::Valid => serializer.serialize_i32(3),
2823 Self::PermissionDenied => serializer.serialize_i32(4),
2824 Self::UnknownValue(u) => u.0.serialize(serializer),
2825 }
2826 }
2827 }
2828
2829 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
2830 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2831 where
2832 D: serde::Deserializer<'de>,
2833 {
2834 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
2835 ".google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse.TokenStatus",
2836 ))
2837 }
2838 }
2839}
2840
2841/// `FetchRemoteBranches` request message.
2842#[derive(Clone, Default, PartialEq)]
2843#[non_exhaustive]
2844pub struct FetchRemoteBranchesRequest {
2845 /// Required. The repository's name.
2846 pub name: std::string::String,
2847
2848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2849}
2850
2851impl FetchRemoteBranchesRequest {
2852 /// Creates a new default instance.
2853 pub fn new() -> Self {
2854 std::default::Default::default()
2855 }
2856
2857 /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
2858 ///
2859 /// # Example
2860 /// ```ignore,no_run
2861 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesRequest;
2862 /// # let project_id = "project_id";
2863 /// # let location_id = "location_id";
2864 /// # let repository_id = "repository_id";
2865 /// let x = FetchRemoteBranchesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2866 /// ```
2867 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2868 self.name = v.into();
2869 self
2870 }
2871}
2872
2873impl wkt::message::Message for FetchRemoteBranchesRequest {
2874 fn typename() -> &'static str {
2875 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesRequest"
2876 }
2877}
2878
2879/// `FetchRemoteBranches` response message.
2880#[derive(Clone, Default, PartialEq)]
2881#[non_exhaustive]
2882pub struct FetchRemoteBranchesResponse {
2883 /// The remote repository's branch names.
2884 pub branches: std::vec::Vec<std::string::String>,
2885
2886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2887}
2888
2889impl FetchRemoteBranchesResponse {
2890 /// Creates a new default instance.
2891 pub fn new() -> Self {
2892 std::default::Default::default()
2893 }
2894
2895 /// Sets the value of [branches][crate::model::FetchRemoteBranchesResponse::branches].
2896 ///
2897 /// # Example
2898 /// ```ignore,no_run
2899 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesResponse;
2900 /// let x = FetchRemoteBranchesResponse::new().set_branches(["a", "b", "c"]);
2901 /// ```
2902 pub fn set_branches<T, V>(mut self, v: T) -> Self
2903 where
2904 T: std::iter::IntoIterator<Item = V>,
2905 V: std::convert::Into<std::string::String>,
2906 {
2907 use std::iter::Iterator;
2908 self.branches = v.into_iter().map(|i| i.into()).collect();
2909 self
2910 }
2911}
2912
2913impl wkt::message::Message for FetchRemoteBranchesResponse {
2914 fn typename() -> &'static str {
2915 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesResponse"
2916 }
2917}
2918
2919/// Represents a Dataform Git workspace.
2920#[derive(Clone, Default, PartialEq)]
2921#[non_exhaustive]
2922pub struct Workspace {
2923 /// Identifier. The workspace's name.
2924 pub name: std::string::String,
2925
2926 /// Output only. The timestamp of when the workspace was created.
2927 pub create_time: std::option::Option<wkt::Timestamp>,
2928
2929 /// Output only. A data encryption state of a Git repository if this Workspace
2930 /// is protected by a KMS key.
2931 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
2932
2933 /// Output only. All the metadata information that is used internally to serve
2934 /// the resource. For example: timestamps, flags, status fields, etc. The
2935 /// format of this field is a JSON string.
2936 pub internal_metadata: std::option::Option<std::string::String>,
2937
2938 /// Optional. If set to true, workspaces will not be moved if its linked
2939 /// Repository is moved. Instead, it will be deleted.
2940 pub disable_moves: std::option::Option<bool>,
2941
2942 /// Output only. Metadata indicating whether this resource is user-scoped. For
2943 /// `Workspace` resources, the `user_scoped` field is always `true`.
2944 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
2945
2946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2947}
2948
2949impl Workspace {
2950 /// Creates a new default instance.
2951 pub fn new() -> Self {
2952 std::default::Default::default()
2953 }
2954
2955 /// Sets the value of [name][crate::model::Workspace::name].
2956 ///
2957 /// # Example
2958 /// ```ignore,no_run
2959 /// # use google_cloud_dataform_v1::model::Workspace;
2960 /// # let project_id = "project_id";
2961 /// # let location_id = "location_id";
2962 /// # let repository_id = "repository_id";
2963 /// # let workspace_id = "workspace_id";
2964 /// let x = Workspace::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
2965 /// ```
2966 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.name = v.into();
2968 self
2969 }
2970
2971 /// Sets the value of [create_time][crate::model::Workspace::create_time].
2972 ///
2973 /// # Example
2974 /// ```ignore,no_run
2975 /// # use google_cloud_dataform_v1::model::Workspace;
2976 /// use wkt::Timestamp;
2977 /// let x = Workspace::new().set_create_time(Timestamp::default()/* use setters */);
2978 /// ```
2979 pub fn set_create_time<T>(mut self, v: T) -> Self
2980 where
2981 T: std::convert::Into<wkt::Timestamp>,
2982 {
2983 self.create_time = std::option::Option::Some(v.into());
2984 self
2985 }
2986
2987 /// Sets or clears the value of [create_time][crate::model::Workspace::create_time].
2988 ///
2989 /// # Example
2990 /// ```ignore,no_run
2991 /// # use google_cloud_dataform_v1::model::Workspace;
2992 /// use wkt::Timestamp;
2993 /// let x = Workspace::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2994 /// let x = Workspace::new().set_or_clear_create_time(None::<Timestamp>);
2995 /// ```
2996 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2997 where
2998 T: std::convert::Into<wkt::Timestamp>,
2999 {
3000 self.create_time = v.map(|x| x.into());
3001 self
3002 }
3003
3004 /// Sets the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
3005 ///
3006 /// # Example
3007 /// ```ignore,no_run
3008 /// # use google_cloud_dataform_v1::model::Workspace;
3009 /// use google_cloud_dataform_v1::model::DataEncryptionState;
3010 /// let x = Workspace::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
3011 /// ```
3012 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
3013 where
3014 T: std::convert::Into<crate::model::DataEncryptionState>,
3015 {
3016 self.data_encryption_state = std::option::Option::Some(v.into());
3017 self
3018 }
3019
3020 /// Sets or clears the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
3021 ///
3022 /// # Example
3023 /// ```ignore,no_run
3024 /// # use google_cloud_dataform_v1::model::Workspace;
3025 /// use google_cloud_dataform_v1::model::DataEncryptionState;
3026 /// let x = Workspace::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
3027 /// let x = Workspace::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
3028 /// ```
3029 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
3030 where
3031 T: std::convert::Into<crate::model::DataEncryptionState>,
3032 {
3033 self.data_encryption_state = v.map(|x| x.into());
3034 self
3035 }
3036
3037 /// Sets the value of [internal_metadata][crate::model::Workspace::internal_metadata].
3038 ///
3039 /// # Example
3040 /// ```ignore,no_run
3041 /// # use google_cloud_dataform_v1::model::Workspace;
3042 /// let x = Workspace::new().set_internal_metadata("example");
3043 /// ```
3044 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
3045 where
3046 T: std::convert::Into<std::string::String>,
3047 {
3048 self.internal_metadata = std::option::Option::Some(v.into());
3049 self
3050 }
3051
3052 /// Sets or clears the value of [internal_metadata][crate::model::Workspace::internal_metadata].
3053 ///
3054 /// # Example
3055 /// ```ignore,no_run
3056 /// # use google_cloud_dataform_v1::model::Workspace;
3057 /// let x = Workspace::new().set_or_clear_internal_metadata(Some("example"));
3058 /// let x = Workspace::new().set_or_clear_internal_metadata(None::<String>);
3059 /// ```
3060 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3061 where
3062 T: std::convert::Into<std::string::String>,
3063 {
3064 self.internal_metadata = v.map(|x| x.into());
3065 self
3066 }
3067
3068 /// Sets the value of [disable_moves][crate::model::Workspace::disable_moves].
3069 ///
3070 /// # Example
3071 /// ```ignore,no_run
3072 /// # use google_cloud_dataform_v1::model::Workspace;
3073 /// let x = Workspace::new().set_disable_moves(true);
3074 /// ```
3075 pub fn set_disable_moves<T>(mut self, v: T) -> Self
3076 where
3077 T: std::convert::Into<bool>,
3078 {
3079 self.disable_moves = std::option::Option::Some(v.into());
3080 self
3081 }
3082
3083 /// Sets or clears the value of [disable_moves][crate::model::Workspace::disable_moves].
3084 ///
3085 /// # Example
3086 /// ```ignore,no_run
3087 /// # use google_cloud_dataform_v1::model::Workspace;
3088 /// let x = Workspace::new().set_or_clear_disable_moves(Some(false));
3089 /// let x = Workspace::new().set_or_clear_disable_moves(None::<bool>);
3090 /// ```
3091 pub fn set_or_clear_disable_moves<T>(mut self, v: std::option::Option<T>) -> Self
3092 where
3093 T: std::convert::Into<bool>,
3094 {
3095 self.disable_moves = v.map(|x| x.into());
3096 self
3097 }
3098
3099 /// Sets the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
3100 ///
3101 /// # Example
3102 /// ```ignore,no_run
3103 /// # use google_cloud_dataform_v1::model::Workspace;
3104 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
3105 /// let x = Workspace::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
3106 /// ```
3107 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
3108 where
3109 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
3110 {
3111 self.private_resource_metadata = std::option::Option::Some(v.into());
3112 self
3113 }
3114
3115 /// Sets or clears the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
3116 ///
3117 /// # Example
3118 /// ```ignore,no_run
3119 /// # use google_cloud_dataform_v1::model::Workspace;
3120 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
3121 /// let x = Workspace::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
3122 /// let x = Workspace::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
3123 /// ```
3124 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3125 where
3126 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
3127 {
3128 self.private_resource_metadata = v.map(|x| x.into());
3129 self
3130 }
3131}
3132
3133impl wkt::message::Message for Workspace {
3134 fn typename() -> &'static str {
3135 "type.googleapis.com/google.cloud.dataform.v1.Workspace"
3136 }
3137}
3138
3139/// `ListWorkspaces` request message.
3140#[derive(Clone, Default, PartialEq)]
3141#[non_exhaustive]
3142pub struct ListWorkspacesRequest {
3143 /// Required. The repository in which to list workspaces. Must be in the
3144 /// format `projects/*/locations/*/repositories/*`.
3145 pub parent: std::string::String,
3146
3147 /// Optional. Maximum number of workspaces to return. The server may return
3148 /// fewer items than requested. If unspecified, the server will pick an
3149 /// appropriate default.
3150 pub page_size: i32,
3151
3152 /// Optional. Page token received from a previous `ListWorkspaces` call.
3153 /// Provide this to retrieve the subsequent page.
3154 ///
3155 /// When paginating, all other parameters provided to `ListWorkspaces`, with
3156 /// the exception of `page_size`, must match the call that provided the page
3157 /// token.
3158 pub page_token: std::string::String,
3159
3160 /// Optional. This field only supports ordering by `name`. If unspecified, the
3161 /// server will choose the ordering. If specified, the default order is
3162 /// ascending for the `name` field.
3163 pub order_by: std::string::String,
3164
3165 /// Optional. Filter for the returned list.
3166 pub filter: std::string::String,
3167
3168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3169}
3170
3171impl ListWorkspacesRequest {
3172 /// Creates a new default instance.
3173 pub fn new() -> Self {
3174 std::default::Default::default()
3175 }
3176
3177 /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
3178 ///
3179 /// # Example
3180 /// ```ignore,no_run
3181 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3182 /// # let project_id = "project_id";
3183 /// # let location_id = "location_id";
3184 /// # let repository_id = "repository_id";
3185 /// let x = ListWorkspacesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
3186 /// ```
3187 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3188 self.parent = v.into();
3189 self
3190 }
3191
3192 /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
3193 ///
3194 /// # Example
3195 /// ```ignore,no_run
3196 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3197 /// let x = ListWorkspacesRequest::new().set_page_size(42);
3198 /// ```
3199 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3200 self.page_size = v.into();
3201 self
3202 }
3203
3204 /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
3205 ///
3206 /// # Example
3207 /// ```ignore,no_run
3208 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3209 /// let x = ListWorkspacesRequest::new().set_page_token("example");
3210 /// ```
3211 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3212 self.page_token = v.into();
3213 self
3214 }
3215
3216 /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
3217 ///
3218 /// # Example
3219 /// ```ignore,no_run
3220 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3221 /// let x = ListWorkspacesRequest::new().set_order_by("example");
3222 /// ```
3223 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3224 self.order_by = v.into();
3225 self
3226 }
3227
3228 /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
3229 ///
3230 /// # Example
3231 /// ```ignore,no_run
3232 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3233 /// let x = ListWorkspacesRequest::new().set_filter("example");
3234 /// ```
3235 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3236 self.filter = v.into();
3237 self
3238 }
3239}
3240
3241impl wkt::message::Message for ListWorkspacesRequest {
3242 fn typename() -> &'static str {
3243 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesRequest"
3244 }
3245}
3246
3247/// `ListWorkspaces` response message.
3248#[derive(Clone, Default, PartialEq)]
3249#[non_exhaustive]
3250pub struct ListWorkspacesResponse {
3251 /// List of workspaces.
3252 pub workspaces: std::vec::Vec<crate::model::Workspace>,
3253
3254 /// A token, which can be sent as `page_token` to retrieve the next page.
3255 /// If this field is omitted, there are no subsequent pages.
3256 pub next_page_token: std::string::String,
3257
3258 /// Locations which could not be reached.
3259 pub unreachable: std::vec::Vec<std::string::String>,
3260
3261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3262}
3263
3264impl ListWorkspacesResponse {
3265 /// Creates a new default instance.
3266 pub fn new() -> Self {
3267 std::default::Default::default()
3268 }
3269
3270 /// Sets the value of [workspaces][crate::model::ListWorkspacesResponse::workspaces].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3275 /// use google_cloud_dataform_v1::model::Workspace;
3276 /// let x = ListWorkspacesResponse::new()
3277 /// .set_workspaces([
3278 /// Workspace::default()/* use setters */,
3279 /// Workspace::default()/* use (different) setters */,
3280 /// ]);
3281 /// ```
3282 pub fn set_workspaces<T, V>(mut self, v: T) -> Self
3283 where
3284 T: std::iter::IntoIterator<Item = V>,
3285 V: std::convert::Into<crate::model::Workspace>,
3286 {
3287 use std::iter::Iterator;
3288 self.workspaces = v.into_iter().map(|i| i.into()).collect();
3289 self
3290 }
3291
3292 /// Sets the value of [next_page_token][crate::model::ListWorkspacesResponse::next_page_token].
3293 ///
3294 /// # Example
3295 /// ```ignore,no_run
3296 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3297 /// let x = ListWorkspacesResponse::new().set_next_page_token("example");
3298 /// ```
3299 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3300 self.next_page_token = v.into();
3301 self
3302 }
3303
3304 /// Sets the value of [unreachable][crate::model::ListWorkspacesResponse::unreachable].
3305 ///
3306 /// # Example
3307 /// ```ignore,no_run
3308 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3309 /// let x = ListWorkspacesResponse::new().set_unreachable(["a", "b", "c"]);
3310 /// ```
3311 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3312 where
3313 T: std::iter::IntoIterator<Item = V>,
3314 V: std::convert::Into<std::string::String>,
3315 {
3316 use std::iter::Iterator;
3317 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3318 self
3319 }
3320}
3321
3322impl wkt::message::Message for ListWorkspacesResponse {
3323 fn typename() -> &'static str {
3324 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesResponse"
3325 }
3326}
3327
3328#[doc(hidden)]
3329impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkspacesResponse {
3330 type PageItem = crate::model::Workspace;
3331
3332 fn items(self) -> std::vec::Vec<Self::PageItem> {
3333 self.workspaces
3334 }
3335
3336 fn next_page_token(&self) -> std::string::String {
3337 use std::clone::Clone;
3338 self.next_page_token.clone()
3339 }
3340}
3341
3342/// `GetWorkspace` request message.
3343#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct GetWorkspaceRequest {
3346 /// Required. The workspace's name.
3347 pub name: std::string::String,
3348
3349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3350}
3351
3352impl GetWorkspaceRequest {
3353 /// Creates a new default instance.
3354 pub fn new() -> Self {
3355 std::default::Default::default()
3356 }
3357
3358 /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
3359 ///
3360 /// # Example
3361 /// ```ignore,no_run
3362 /// # use google_cloud_dataform_v1::model::GetWorkspaceRequest;
3363 /// # let project_id = "project_id";
3364 /// # let location_id = "location_id";
3365 /// # let repository_id = "repository_id";
3366 /// # let workspace_id = "workspace_id";
3367 /// let x = GetWorkspaceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3368 /// ```
3369 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3370 self.name = v.into();
3371 self
3372 }
3373}
3374
3375impl wkt::message::Message for GetWorkspaceRequest {
3376 fn typename() -> &'static str {
3377 "type.googleapis.com/google.cloud.dataform.v1.GetWorkspaceRequest"
3378 }
3379}
3380
3381/// `CreateWorkspace` request message.
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct CreateWorkspaceRequest {
3385 /// Required. The repository in which to create the workspace. Must be in the
3386 /// format `projects/*/locations/*/repositories/*`.
3387 pub parent: std::string::String,
3388
3389 /// Required. The workspace to create.
3390 pub workspace: std::option::Option<crate::model::Workspace>,
3391
3392 /// Required. The ID to use for the workspace, which will become the final
3393 /// component of the workspace's resource name.
3394 pub workspace_id: std::string::String,
3395
3396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3397}
3398
3399impl CreateWorkspaceRequest {
3400 /// Creates a new default instance.
3401 pub fn new() -> Self {
3402 std::default::Default::default()
3403 }
3404
3405 /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
3406 ///
3407 /// # Example
3408 /// ```ignore,no_run
3409 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3410 /// # let project_id = "project_id";
3411 /// # let location_id = "location_id";
3412 /// # let repository_id = "repository_id";
3413 /// let x = CreateWorkspaceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
3414 /// ```
3415 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3416 self.parent = v.into();
3417 self
3418 }
3419
3420 /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3421 ///
3422 /// # Example
3423 /// ```ignore,no_run
3424 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3425 /// use google_cloud_dataform_v1::model::Workspace;
3426 /// let x = CreateWorkspaceRequest::new().set_workspace(Workspace::default()/* use setters */);
3427 /// ```
3428 pub fn set_workspace<T>(mut self, v: T) -> Self
3429 where
3430 T: std::convert::Into<crate::model::Workspace>,
3431 {
3432 self.workspace = std::option::Option::Some(v.into());
3433 self
3434 }
3435
3436 /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3441 /// use google_cloud_dataform_v1::model::Workspace;
3442 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(Some(Workspace::default()/* use setters */));
3443 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(None::<Workspace>);
3444 /// ```
3445 pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3446 where
3447 T: std::convert::Into<crate::model::Workspace>,
3448 {
3449 self.workspace = v.map(|x| x.into());
3450 self
3451 }
3452
3453 /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
3454 ///
3455 /// # Example
3456 /// ```ignore,no_run
3457 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3458 /// let x = CreateWorkspaceRequest::new().set_workspace_id("example");
3459 /// ```
3460 pub fn set_workspace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461 self.workspace_id = v.into();
3462 self
3463 }
3464}
3465
3466impl wkt::message::Message for CreateWorkspaceRequest {
3467 fn typename() -> &'static str {
3468 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkspaceRequest"
3469 }
3470}
3471
3472/// `DeleteWorkspace` request message.
3473#[derive(Clone, Default, PartialEq)]
3474#[non_exhaustive]
3475pub struct DeleteWorkspaceRequest {
3476 /// Required. The workspace resource's name.
3477 pub name: std::string::String,
3478
3479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3480}
3481
3482impl DeleteWorkspaceRequest {
3483 /// Creates a new default instance.
3484 pub fn new() -> Self {
3485 std::default::Default::default()
3486 }
3487
3488 /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_dataform_v1::model::DeleteWorkspaceRequest;
3493 /// # let project_id = "project_id";
3494 /// # let location_id = "location_id";
3495 /// # let repository_id = "repository_id";
3496 /// # let workspace_id = "workspace_id";
3497 /// let x = DeleteWorkspaceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3498 /// ```
3499 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3500 self.name = v.into();
3501 self
3502 }
3503}
3504
3505impl wkt::message::Message for DeleteWorkspaceRequest {
3506 fn typename() -> &'static str {
3507 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkspaceRequest"
3508 }
3509}
3510
3511/// Represents the author of a Git commit.
3512#[derive(Clone, Default, PartialEq)]
3513#[non_exhaustive]
3514pub struct CommitAuthor {
3515 /// Required. The commit author's name.
3516 pub name: std::string::String,
3517
3518 /// Required. The commit author's email address.
3519 pub email_address: std::string::String,
3520
3521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3522}
3523
3524impl CommitAuthor {
3525 /// Creates a new default instance.
3526 pub fn new() -> Self {
3527 std::default::Default::default()
3528 }
3529
3530 /// Sets the value of [name][crate::model::CommitAuthor::name].
3531 ///
3532 /// # Example
3533 /// ```ignore,no_run
3534 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3535 /// let x = CommitAuthor::new().set_name("example");
3536 /// ```
3537 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3538 self.name = v.into();
3539 self
3540 }
3541
3542 /// Sets the value of [email_address][crate::model::CommitAuthor::email_address].
3543 ///
3544 /// # Example
3545 /// ```ignore,no_run
3546 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3547 /// let x = CommitAuthor::new().set_email_address("example");
3548 /// ```
3549 pub fn set_email_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3550 self.email_address = v.into();
3551 self
3552 }
3553}
3554
3555impl wkt::message::Message for CommitAuthor {
3556 fn typename() -> &'static str {
3557 "type.googleapis.com/google.cloud.dataform.v1.CommitAuthor"
3558 }
3559}
3560
3561/// `PullGitCommits` request message.
3562#[derive(Clone, Default, PartialEq)]
3563#[non_exhaustive]
3564pub struct PullGitCommitsRequest {
3565 /// Required. The workspace's name.
3566 pub name: std::string::String,
3567
3568 /// Optional. The name of the branch in the Git remote from which to pull
3569 /// commits. If left unset, the repository's default branch name will be used.
3570 pub remote_branch: std::string::String,
3571
3572 /// Required. The author of any merge commit which may be created as a result
3573 /// of merging fetched Git commits into this workspace.
3574 pub author: std::option::Option<crate::model::CommitAuthor>,
3575
3576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3577}
3578
3579impl PullGitCommitsRequest {
3580 /// Creates a new default instance.
3581 pub fn new() -> Self {
3582 std::default::Default::default()
3583 }
3584
3585 /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
3586 ///
3587 /// # Example
3588 /// ```ignore,no_run
3589 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3590 /// # let project_id = "project_id";
3591 /// # let location_id = "location_id";
3592 /// # let repository_id = "repository_id";
3593 /// # let workspace_id = "workspace_id";
3594 /// let x = PullGitCommitsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3595 /// ```
3596 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3597 self.name = v.into();
3598 self
3599 }
3600
3601 /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
3602 ///
3603 /// # Example
3604 /// ```ignore,no_run
3605 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3606 /// let x = PullGitCommitsRequest::new().set_remote_branch("example");
3607 /// ```
3608 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3609 self.remote_branch = v.into();
3610 self
3611 }
3612
3613 /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
3614 ///
3615 /// # Example
3616 /// ```ignore,no_run
3617 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3618 /// use google_cloud_dataform_v1::model::CommitAuthor;
3619 /// let x = PullGitCommitsRequest::new().set_author(CommitAuthor::default()/* use setters */);
3620 /// ```
3621 pub fn set_author<T>(mut self, v: T) -> Self
3622 where
3623 T: std::convert::Into<crate::model::CommitAuthor>,
3624 {
3625 self.author = std::option::Option::Some(v.into());
3626 self
3627 }
3628
3629 /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
3630 ///
3631 /// # Example
3632 /// ```ignore,no_run
3633 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3634 /// use google_cloud_dataform_v1::model::CommitAuthor;
3635 /// let x = PullGitCommitsRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
3636 /// let x = PullGitCommitsRequest::new().set_or_clear_author(None::<CommitAuthor>);
3637 /// ```
3638 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
3639 where
3640 T: std::convert::Into<crate::model::CommitAuthor>,
3641 {
3642 self.author = v.map(|x| x.into());
3643 self
3644 }
3645}
3646
3647impl wkt::message::Message for PullGitCommitsRequest {
3648 fn typename() -> &'static str {
3649 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsRequest"
3650 }
3651}
3652
3653/// `PullGitCommits` response message.
3654#[derive(Clone, Default, PartialEq)]
3655#[non_exhaustive]
3656pub struct PullGitCommitsResponse {
3657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3658}
3659
3660impl PullGitCommitsResponse {
3661 /// Creates a new default instance.
3662 pub fn new() -> Self {
3663 std::default::Default::default()
3664 }
3665}
3666
3667impl wkt::message::Message for PullGitCommitsResponse {
3668 fn typename() -> &'static str {
3669 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsResponse"
3670 }
3671}
3672
3673/// `PushGitCommits` request message.
3674#[derive(Clone, Default, PartialEq)]
3675#[non_exhaustive]
3676pub struct PushGitCommitsRequest {
3677 /// Required. The workspace's name.
3678 pub name: std::string::String,
3679
3680 /// Optional. The name of the branch in the Git remote to which commits should
3681 /// be pushed. If left unset, the repository's default branch name will be
3682 /// used.
3683 pub remote_branch: std::string::String,
3684
3685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3686}
3687
3688impl PushGitCommitsRequest {
3689 /// Creates a new default instance.
3690 pub fn new() -> Self {
3691 std::default::Default::default()
3692 }
3693
3694 /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
3695 ///
3696 /// # Example
3697 /// ```ignore,no_run
3698 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3699 /// # let project_id = "project_id";
3700 /// # let location_id = "location_id";
3701 /// # let repository_id = "repository_id";
3702 /// # let workspace_id = "workspace_id";
3703 /// let x = PushGitCommitsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3704 /// ```
3705 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3706 self.name = v.into();
3707 self
3708 }
3709
3710 /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
3711 ///
3712 /// # Example
3713 /// ```ignore,no_run
3714 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3715 /// let x = PushGitCommitsRequest::new().set_remote_branch("example");
3716 /// ```
3717 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.remote_branch = v.into();
3719 self
3720 }
3721}
3722
3723impl wkt::message::Message for PushGitCommitsRequest {
3724 fn typename() -> &'static str {
3725 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsRequest"
3726 }
3727}
3728
3729/// `PushGitCommits` response message.
3730#[derive(Clone, Default, PartialEq)]
3731#[non_exhaustive]
3732pub struct PushGitCommitsResponse {
3733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3734}
3735
3736impl PushGitCommitsResponse {
3737 /// Creates a new default instance.
3738 pub fn new() -> Self {
3739 std::default::Default::default()
3740 }
3741}
3742
3743impl wkt::message::Message for PushGitCommitsResponse {
3744 fn typename() -> &'static str {
3745 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsResponse"
3746 }
3747}
3748
3749/// `FetchFileGitStatuses` request message.
3750#[derive(Clone, Default, PartialEq)]
3751#[non_exhaustive]
3752pub struct FetchFileGitStatusesRequest {
3753 /// Required. The workspace's name.
3754 pub name: std::string::String,
3755
3756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3757}
3758
3759impl FetchFileGitStatusesRequest {
3760 /// Creates a new default instance.
3761 pub fn new() -> Self {
3762 std::default::Default::default()
3763 }
3764
3765 /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
3766 ///
3767 /// # Example
3768 /// ```ignore,no_run
3769 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesRequest;
3770 /// # let project_id = "project_id";
3771 /// # let location_id = "location_id";
3772 /// # let repository_id = "repository_id";
3773 /// # let workspace_id = "workspace_id";
3774 /// let x = FetchFileGitStatusesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3775 /// ```
3776 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3777 self.name = v.into();
3778 self
3779 }
3780}
3781
3782impl wkt::message::Message for FetchFileGitStatusesRequest {
3783 fn typename() -> &'static str {
3784 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesRequest"
3785 }
3786}
3787
3788/// `FetchFileGitStatuses` response message.
3789#[derive(Clone, Default, PartialEq)]
3790#[non_exhaustive]
3791pub struct FetchFileGitStatusesResponse {
3792 /// A list of all files which have uncommitted Git changes. There will only be
3793 /// a single entry for any given file.
3794 pub uncommitted_file_changes:
3795 std::vec::Vec<crate::model::fetch_file_git_statuses_response::UncommittedFileChange>,
3796
3797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3798}
3799
3800impl FetchFileGitStatusesResponse {
3801 /// Creates a new default instance.
3802 pub fn new() -> Self {
3803 std::default::Default::default()
3804 }
3805
3806 /// Sets the value of [uncommitted_file_changes][crate::model::FetchFileGitStatusesResponse::uncommitted_file_changes].
3807 ///
3808 /// # Example
3809 /// ```ignore,no_run
3810 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesResponse;
3811 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3812 /// let x = FetchFileGitStatusesResponse::new()
3813 /// .set_uncommitted_file_changes([
3814 /// UncommittedFileChange::default()/* use setters */,
3815 /// UncommittedFileChange::default()/* use (different) setters */,
3816 /// ]);
3817 /// ```
3818 pub fn set_uncommitted_file_changes<T, V>(mut self, v: T) -> Self
3819 where
3820 T: std::iter::IntoIterator<Item = V>,
3821 V: std::convert::Into<
3822 crate::model::fetch_file_git_statuses_response::UncommittedFileChange,
3823 >,
3824 {
3825 use std::iter::Iterator;
3826 self.uncommitted_file_changes = v.into_iter().map(|i| i.into()).collect();
3827 self
3828 }
3829}
3830
3831impl wkt::message::Message for FetchFileGitStatusesResponse {
3832 fn typename() -> &'static str {
3833 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse"
3834 }
3835}
3836
3837/// Defines additional types related to [FetchFileGitStatusesResponse].
3838pub mod fetch_file_git_statuses_response {
3839 #[allow(unused_imports)]
3840 use super::*;
3841
3842 /// Represents the Git state of a file with uncommitted changes.
3843 #[derive(Clone, Default, PartialEq)]
3844 #[non_exhaustive]
3845 pub struct UncommittedFileChange {
3846 /// The file's full path including filename, relative to the workspace root.
3847 pub path: std::string::String,
3848
3849 /// Output only. Indicates the status of the file.
3850 pub state: crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
3851
3852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3853 }
3854
3855 impl UncommittedFileChange {
3856 /// Creates a new default instance.
3857 pub fn new() -> Self {
3858 std::default::Default::default()
3859 }
3860
3861 /// Sets the value of [path][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::path].
3862 ///
3863 /// # Example
3864 /// ```ignore,no_run
3865 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3866 /// let x = UncommittedFileChange::new().set_path("example");
3867 /// ```
3868 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3869 self.path = v.into();
3870 self
3871 }
3872
3873 /// Sets the value of [state][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::state].
3874 ///
3875 /// # Example
3876 /// ```ignore,no_run
3877 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3878 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::uncommitted_file_change::State;
3879 /// let x0 = UncommittedFileChange::new().set_state(State::Added);
3880 /// let x1 = UncommittedFileChange::new().set_state(State::Deleted);
3881 /// let x2 = UncommittedFileChange::new().set_state(State::Modified);
3882 /// ```
3883 pub fn set_state<
3884 T: std::convert::Into<
3885 crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
3886 >,
3887 >(
3888 mut self,
3889 v: T,
3890 ) -> Self {
3891 self.state = v.into();
3892 self
3893 }
3894 }
3895
3896 impl wkt::message::Message for UncommittedFileChange {
3897 fn typename() -> &'static str {
3898 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange"
3899 }
3900 }
3901
3902 /// Defines additional types related to [UncommittedFileChange].
3903 pub mod uncommitted_file_change {
3904 #[allow(unused_imports)]
3905 use super::*;
3906
3907 /// Indicates the status of an uncommitted file change.
3908 ///
3909 /// # Working with unknown values
3910 ///
3911 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3912 /// additional enum variants at any time. Adding new variants is not considered
3913 /// a breaking change. Applications should write their code in anticipation of:
3914 ///
3915 /// - New values appearing in future releases of the client library, **and**
3916 /// - New values received dynamically, without application changes.
3917 ///
3918 /// Please consult the [Working with enums] section in the user guide for some
3919 /// guidelines.
3920 ///
3921 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3922 #[derive(Clone, Debug, PartialEq)]
3923 #[non_exhaustive]
3924 pub enum State {
3925 /// Default value. This value is unused.
3926 Unspecified,
3927 /// The file has been newly added.
3928 Added,
3929 /// The file has been deleted.
3930 Deleted,
3931 /// The file has been modified.
3932 Modified,
3933 /// The file contains merge conflicts.
3934 HasConflicts,
3935 /// If set, the enum was initialized with an unknown value.
3936 ///
3937 /// Applications can examine the value using [State::value] or
3938 /// [State::name].
3939 UnknownValue(state::UnknownValue),
3940 }
3941
3942 #[doc(hidden)]
3943 pub mod state {
3944 #[allow(unused_imports)]
3945 use super::*;
3946 #[derive(Clone, Debug, PartialEq)]
3947 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3948 }
3949
3950 impl State {
3951 /// Gets the enum value.
3952 ///
3953 /// Returns `None` if the enum contains an unknown value deserialized from
3954 /// the string representation of enums.
3955 pub fn value(&self) -> std::option::Option<i32> {
3956 match self {
3957 Self::Unspecified => std::option::Option::Some(0),
3958 Self::Added => std::option::Option::Some(1),
3959 Self::Deleted => std::option::Option::Some(2),
3960 Self::Modified => std::option::Option::Some(3),
3961 Self::HasConflicts => std::option::Option::Some(4),
3962 Self::UnknownValue(u) => u.0.value(),
3963 }
3964 }
3965
3966 /// Gets the enum value as a string.
3967 ///
3968 /// Returns `None` if the enum contains an unknown value deserialized from
3969 /// the integer representation of enums.
3970 pub fn name(&self) -> std::option::Option<&str> {
3971 match self {
3972 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3973 Self::Added => std::option::Option::Some("ADDED"),
3974 Self::Deleted => std::option::Option::Some("DELETED"),
3975 Self::Modified => std::option::Option::Some("MODIFIED"),
3976 Self::HasConflicts => std::option::Option::Some("HAS_CONFLICTS"),
3977 Self::UnknownValue(u) => u.0.name(),
3978 }
3979 }
3980 }
3981
3982 impl std::default::Default for State {
3983 fn default() -> Self {
3984 use std::convert::From;
3985 Self::from(0)
3986 }
3987 }
3988
3989 impl std::fmt::Display for State {
3990 fn fmt(
3991 &self,
3992 f: &mut std::fmt::Formatter<'_>,
3993 ) -> std::result::Result<(), std::fmt::Error> {
3994 wkt::internal::display_enum(f, self.name(), self.value())
3995 }
3996 }
3997
3998 impl std::convert::From<i32> for State {
3999 fn from(value: i32) -> Self {
4000 match value {
4001 0 => Self::Unspecified,
4002 1 => Self::Added,
4003 2 => Self::Deleted,
4004 3 => Self::Modified,
4005 4 => Self::HasConflicts,
4006 _ => Self::UnknownValue(state::UnknownValue(
4007 wkt::internal::UnknownEnumValue::Integer(value),
4008 )),
4009 }
4010 }
4011 }
4012
4013 impl std::convert::From<&str> for State {
4014 fn from(value: &str) -> Self {
4015 use std::string::ToString;
4016 match value {
4017 "STATE_UNSPECIFIED" => Self::Unspecified,
4018 "ADDED" => Self::Added,
4019 "DELETED" => Self::Deleted,
4020 "MODIFIED" => Self::Modified,
4021 "HAS_CONFLICTS" => Self::HasConflicts,
4022 _ => Self::UnknownValue(state::UnknownValue(
4023 wkt::internal::UnknownEnumValue::String(value.to_string()),
4024 )),
4025 }
4026 }
4027 }
4028
4029 impl serde::ser::Serialize for State {
4030 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4031 where
4032 S: serde::Serializer,
4033 {
4034 match self {
4035 Self::Unspecified => serializer.serialize_i32(0),
4036 Self::Added => serializer.serialize_i32(1),
4037 Self::Deleted => serializer.serialize_i32(2),
4038 Self::Modified => serializer.serialize_i32(3),
4039 Self::HasConflicts => serializer.serialize_i32(4),
4040 Self::UnknownValue(u) => u.0.serialize(serializer),
4041 }
4042 }
4043 }
4044
4045 impl<'de> serde::de::Deserialize<'de> for State {
4046 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4047 where
4048 D: serde::Deserializer<'de>,
4049 {
4050 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4051 ".google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange.State"))
4052 }
4053 }
4054 }
4055}
4056
4057/// `FetchGitAheadBehind` request message.
4058#[derive(Clone, Default, PartialEq)]
4059#[non_exhaustive]
4060pub struct FetchGitAheadBehindRequest {
4061 /// Required. The workspace's name.
4062 pub name: std::string::String,
4063
4064 /// Optional. The name of the branch in the Git remote against which this
4065 /// workspace should be compared. If left unset, the repository's default
4066 /// branch name will be used.
4067 pub remote_branch: std::string::String,
4068
4069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4070}
4071
4072impl FetchGitAheadBehindRequest {
4073 /// Creates a new default instance.
4074 pub fn new() -> Self {
4075 std::default::Default::default()
4076 }
4077
4078 /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
4079 ///
4080 /// # Example
4081 /// ```ignore,no_run
4082 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
4083 /// # let project_id = "project_id";
4084 /// # let location_id = "location_id";
4085 /// # let repository_id = "repository_id";
4086 /// # let workspace_id = "workspace_id";
4087 /// let x = FetchGitAheadBehindRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4088 /// ```
4089 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.name = v.into();
4091 self
4092 }
4093
4094 /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
4095 ///
4096 /// # Example
4097 /// ```ignore,no_run
4098 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
4099 /// let x = FetchGitAheadBehindRequest::new().set_remote_branch("example");
4100 /// ```
4101 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4102 self.remote_branch = v.into();
4103 self
4104 }
4105}
4106
4107impl wkt::message::Message for FetchGitAheadBehindRequest {
4108 fn typename() -> &'static str {
4109 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindRequest"
4110 }
4111}
4112
4113/// `FetchGitAheadBehind` response message.
4114#[derive(Clone, Default, PartialEq)]
4115#[non_exhaustive]
4116pub struct FetchGitAheadBehindResponse {
4117 /// The number of commits in the remote branch that are not in the workspace.
4118 pub commits_ahead: i32,
4119
4120 /// The number of commits in the workspace that are not in the remote branch.
4121 pub commits_behind: i32,
4122
4123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4124}
4125
4126impl FetchGitAheadBehindResponse {
4127 /// Creates a new default instance.
4128 pub fn new() -> Self {
4129 std::default::Default::default()
4130 }
4131
4132 /// Sets the value of [commits_ahead][crate::model::FetchGitAheadBehindResponse::commits_ahead].
4133 ///
4134 /// # Example
4135 /// ```ignore,no_run
4136 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
4137 /// let x = FetchGitAheadBehindResponse::new().set_commits_ahead(42);
4138 /// ```
4139 pub fn set_commits_ahead<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4140 self.commits_ahead = v.into();
4141 self
4142 }
4143
4144 /// Sets the value of [commits_behind][crate::model::FetchGitAheadBehindResponse::commits_behind].
4145 ///
4146 /// # Example
4147 /// ```ignore,no_run
4148 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
4149 /// let x = FetchGitAheadBehindResponse::new().set_commits_behind(42);
4150 /// ```
4151 pub fn set_commits_behind<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4152 self.commits_behind = v.into();
4153 self
4154 }
4155}
4156
4157impl wkt::message::Message for FetchGitAheadBehindResponse {
4158 fn typename() -> &'static str {
4159 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindResponse"
4160 }
4161}
4162
4163/// `CommitWorkspaceChanges` request message.
4164#[derive(Clone, Default, PartialEq)]
4165#[non_exhaustive]
4166pub struct CommitWorkspaceChangesRequest {
4167 /// Required. The workspace's name.
4168 pub name: std::string::String,
4169
4170 /// Required. The commit's author.
4171 pub author: std::option::Option<crate::model::CommitAuthor>,
4172
4173 /// Optional. The commit's message.
4174 pub commit_message: std::string::String,
4175
4176 /// Optional. Full file paths to commit including filename, rooted at workspace
4177 /// root. If left empty, all files will be committed.
4178 pub paths: std::vec::Vec<std::string::String>,
4179
4180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4181}
4182
4183impl CommitWorkspaceChangesRequest {
4184 /// Creates a new default instance.
4185 pub fn new() -> Self {
4186 std::default::Default::default()
4187 }
4188
4189 /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
4190 ///
4191 /// # Example
4192 /// ```ignore,no_run
4193 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4194 /// # let project_id = "project_id";
4195 /// # let location_id = "location_id";
4196 /// # let repository_id = "repository_id";
4197 /// # let workspace_id = "workspace_id";
4198 /// let x = CommitWorkspaceChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4199 /// ```
4200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4201 self.name = v.into();
4202 self
4203 }
4204
4205 /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4206 ///
4207 /// # Example
4208 /// ```ignore,no_run
4209 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4210 /// use google_cloud_dataform_v1::model::CommitAuthor;
4211 /// let x = CommitWorkspaceChangesRequest::new().set_author(CommitAuthor::default()/* use setters */);
4212 /// ```
4213 pub fn set_author<T>(mut self, v: T) -> Self
4214 where
4215 T: std::convert::Into<crate::model::CommitAuthor>,
4216 {
4217 self.author = std::option::Option::Some(v.into());
4218 self
4219 }
4220
4221 /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4222 ///
4223 /// # Example
4224 /// ```ignore,no_run
4225 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4226 /// use google_cloud_dataform_v1::model::CommitAuthor;
4227 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
4228 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(None::<CommitAuthor>);
4229 /// ```
4230 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
4231 where
4232 T: std::convert::Into<crate::model::CommitAuthor>,
4233 {
4234 self.author = v.map(|x| x.into());
4235 self
4236 }
4237
4238 /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
4239 ///
4240 /// # Example
4241 /// ```ignore,no_run
4242 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4243 /// let x = CommitWorkspaceChangesRequest::new().set_commit_message("example");
4244 /// ```
4245 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4246 self.commit_message = v.into();
4247 self
4248 }
4249
4250 /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4255 /// let x = CommitWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4256 /// ```
4257 pub fn set_paths<T, V>(mut self, v: T) -> Self
4258 where
4259 T: std::iter::IntoIterator<Item = V>,
4260 V: std::convert::Into<std::string::String>,
4261 {
4262 use std::iter::Iterator;
4263 self.paths = v.into_iter().map(|i| i.into()).collect();
4264 self
4265 }
4266}
4267
4268impl wkt::message::Message for CommitWorkspaceChangesRequest {
4269 fn typename() -> &'static str {
4270 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesRequest"
4271 }
4272}
4273
4274/// `CommitWorkspaceChanges` response message.
4275#[derive(Clone, Default, PartialEq)]
4276#[non_exhaustive]
4277pub struct CommitWorkspaceChangesResponse {
4278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4279}
4280
4281impl CommitWorkspaceChangesResponse {
4282 /// Creates a new default instance.
4283 pub fn new() -> Self {
4284 std::default::Default::default()
4285 }
4286}
4287
4288impl wkt::message::Message for CommitWorkspaceChangesResponse {
4289 fn typename() -> &'static str {
4290 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesResponse"
4291 }
4292}
4293
4294/// `ResetWorkspaceChanges` request message.
4295#[derive(Clone, Default, PartialEq)]
4296#[non_exhaustive]
4297pub struct ResetWorkspaceChangesRequest {
4298 /// Required. The workspace's name.
4299 pub name: std::string::String,
4300
4301 /// Optional. Full file paths to reset back to their committed state including
4302 /// filename, rooted at workspace root. If left empty, all files will be reset.
4303 pub paths: std::vec::Vec<std::string::String>,
4304
4305 /// Optional. If set to true, untracked files will be deleted.
4306 pub clean: bool,
4307
4308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4309}
4310
4311impl ResetWorkspaceChangesRequest {
4312 /// Creates a new default instance.
4313 pub fn new() -> Self {
4314 std::default::Default::default()
4315 }
4316
4317 /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
4318 ///
4319 /// # Example
4320 /// ```ignore,no_run
4321 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4322 /// # let project_id = "project_id";
4323 /// # let location_id = "location_id";
4324 /// # let repository_id = "repository_id";
4325 /// # let workspace_id = "workspace_id";
4326 /// let x = ResetWorkspaceChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4327 /// ```
4328 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4329 self.name = v.into();
4330 self
4331 }
4332
4333 /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
4334 ///
4335 /// # Example
4336 /// ```ignore,no_run
4337 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4338 /// let x = ResetWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4339 /// ```
4340 pub fn set_paths<T, V>(mut self, v: T) -> Self
4341 where
4342 T: std::iter::IntoIterator<Item = V>,
4343 V: std::convert::Into<std::string::String>,
4344 {
4345 use std::iter::Iterator;
4346 self.paths = v.into_iter().map(|i| i.into()).collect();
4347 self
4348 }
4349
4350 /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
4351 ///
4352 /// # Example
4353 /// ```ignore,no_run
4354 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4355 /// let x = ResetWorkspaceChangesRequest::new().set_clean(true);
4356 /// ```
4357 pub fn set_clean<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4358 self.clean = v.into();
4359 self
4360 }
4361}
4362
4363impl wkt::message::Message for ResetWorkspaceChangesRequest {
4364 fn typename() -> &'static str {
4365 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesRequest"
4366 }
4367}
4368
4369/// `ResetWorkspaceChanges` response message.
4370#[derive(Clone, Default, PartialEq)]
4371#[non_exhaustive]
4372pub struct ResetWorkspaceChangesResponse {
4373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4374}
4375
4376impl ResetWorkspaceChangesResponse {
4377 /// Creates a new default instance.
4378 pub fn new() -> Self {
4379 std::default::Default::default()
4380 }
4381}
4382
4383impl wkt::message::Message for ResetWorkspaceChangesResponse {
4384 fn typename() -> &'static str {
4385 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesResponse"
4386 }
4387}
4388
4389/// `FetchFileDiff` request message.
4390#[derive(Clone, Default, PartialEq)]
4391#[non_exhaustive]
4392pub struct FetchFileDiffRequest {
4393 /// Required. The workspace's name.
4394 pub workspace: std::string::String,
4395
4396 /// Required. The file's full path including filename, relative to the
4397 /// workspace root.
4398 pub path: std::string::String,
4399
4400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4401}
4402
4403impl FetchFileDiffRequest {
4404 /// Creates a new default instance.
4405 pub fn new() -> Self {
4406 std::default::Default::default()
4407 }
4408
4409 /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
4410 ///
4411 /// # Example
4412 /// ```ignore,no_run
4413 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4414 /// # let project_id = "project_id";
4415 /// # let location_id = "location_id";
4416 /// # let repository_id = "repository_id";
4417 /// # let workspace_id = "workspace_id";
4418 /// let x = FetchFileDiffRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4419 /// ```
4420 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421 self.workspace = v.into();
4422 self
4423 }
4424
4425 /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
4426 ///
4427 /// # Example
4428 /// ```ignore,no_run
4429 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4430 /// let x = FetchFileDiffRequest::new().set_path("example");
4431 /// ```
4432 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433 self.path = v.into();
4434 self
4435 }
4436}
4437
4438impl wkt::message::Message for FetchFileDiffRequest {
4439 fn typename() -> &'static str {
4440 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffRequest"
4441 }
4442}
4443
4444/// `FetchFileDiff` response message.
4445#[derive(Clone, Default, PartialEq)]
4446#[non_exhaustive]
4447pub struct FetchFileDiffResponse {
4448 /// The raw formatted Git diff for the file.
4449 pub formatted_diff: std::string::String,
4450
4451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4452}
4453
4454impl FetchFileDiffResponse {
4455 /// Creates a new default instance.
4456 pub fn new() -> Self {
4457 std::default::Default::default()
4458 }
4459
4460 /// Sets the value of [formatted_diff][crate::model::FetchFileDiffResponse::formatted_diff].
4461 ///
4462 /// # Example
4463 /// ```ignore,no_run
4464 /// # use google_cloud_dataform_v1::model::FetchFileDiffResponse;
4465 /// let x = FetchFileDiffResponse::new().set_formatted_diff("example");
4466 /// ```
4467 pub fn set_formatted_diff<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4468 self.formatted_diff = v.into();
4469 self
4470 }
4471}
4472
4473impl wkt::message::Message for FetchFileDiffResponse {
4474 fn typename() -> &'static str {
4475 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffResponse"
4476 }
4477}
4478
4479/// `QueryDirectoryContents` request message.
4480#[derive(Clone, Default, PartialEq)]
4481#[non_exhaustive]
4482pub struct QueryDirectoryContentsRequest {
4483 /// Required. The workspace's name.
4484 pub workspace: std::string::String,
4485
4486 /// Optional. The directory's full path including directory name, relative to
4487 /// the workspace root. If left unset, the workspace root is used.
4488 pub path: std::string::String,
4489
4490 /// Optional. Maximum number of paths to return. The server may return fewer
4491 /// items than requested. If unspecified, the server will pick an appropriate
4492 /// default.
4493 pub page_size: i32,
4494
4495 /// Optional. Page token received from a previous `QueryDirectoryContents`
4496 /// call. Provide this to retrieve the subsequent page.
4497 ///
4498 /// When paginating, all other parameters provided to
4499 /// `QueryDirectoryContents`, with the exception of `page_size`, must match the
4500 /// call that provided the page token.
4501 pub page_token: std::string::String,
4502
4503 /// Optional. Specifies the metadata to return for each directory entry.
4504 /// If unspecified, the default is `DIRECTORY_CONTENTS_VIEW_BASIC`.
4505 /// Currently the `DIRECTORY_CONTENTS_VIEW_METADATA` view is not supported by
4506 /// CMEK-protected workspaces.
4507 pub view: crate::model::DirectoryContentsView,
4508
4509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4510}
4511
4512impl QueryDirectoryContentsRequest {
4513 /// Creates a new default instance.
4514 pub fn new() -> Self {
4515 std::default::Default::default()
4516 }
4517
4518 /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
4519 ///
4520 /// # Example
4521 /// ```ignore,no_run
4522 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4523 /// # let project_id = "project_id";
4524 /// # let location_id = "location_id";
4525 /// # let repository_id = "repository_id";
4526 /// # let workspace_id = "workspace_id";
4527 /// let x = QueryDirectoryContentsRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4528 /// ```
4529 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4530 self.workspace = v.into();
4531 self
4532 }
4533
4534 /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
4535 ///
4536 /// # Example
4537 /// ```ignore,no_run
4538 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4539 /// let x = QueryDirectoryContentsRequest::new().set_path("example");
4540 /// ```
4541 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4542 self.path = v.into();
4543 self
4544 }
4545
4546 /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
4547 ///
4548 /// # Example
4549 /// ```ignore,no_run
4550 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4551 /// let x = QueryDirectoryContentsRequest::new().set_page_size(42);
4552 /// ```
4553 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4554 self.page_size = v.into();
4555 self
4556 }
4557
4558 /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
4559 ///
4560 /// # Example
4561 /// ```ignore,no_run
4562 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4563 /// let x = QueryDirectoryContentsRequest::new().set_page_token("example");
4564 /// ```
4565 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566 self.page_token = v.into();
4567 self
4568 }
4569
4570 /// Sets the value of [view][crate::model::QueryDirectoryContentsRequest::view].
4571 ///
4572 /// # Example
4573 /// ```ignore,no_run
4574 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4575 /// use google_cloud_dataform_v1::model::DirectoryContentsView;
4576 /// let x0 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Basic);
4577 /// let x1 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Metadata);
4578 /// ```
4579 pub fn set_view<T: std::convert::Into<crate::model::DirectoryContentsView>>(
4580 mut self,
4581 v: T,
4582 ) -> Self {
4583 self.view = v.into();
4584 self
4585 }
4586}
4587
4588impl wkt::message::Message for QueryDirectoryContentsRequest {
4589 fn typename() -> &'static str {
4590 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsRequest"
4591 }
4592}
4593
4594/// `QueryDirectoryContents` response message.
4595#[derive(Clone, Default, PartialEq)]
4596#[non_exhaustive]
4597pub struct QueryDirectoryContentsResponse {
4598 /// List of entries in the directory.
4599 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
4600
4601 /// A token, which can be sent as `page_token` to retrieve the next page.
4602 /// If this field is omitted, there are no subsequent pages.
4603 pub next_page_token: std::string::String,
4604
4605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4606}
4607
4608impl QueryDirectoryContentsResponse {
4609 /// Creates a new default instance.
4610 pub fn new() -> Self {
4611 std::default::Default::default()
4612 }
4613
4614 /// Sets the value of [directory_entries][crate::model::QueryDirectoryContentsResponse::directory_entries].
4615 ///
4616 /// # Example
4617 /// ```ignore,no_run
4618 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4619 /// use google_cloud_dataform_v1::model::DirectoryEntry;
4620 /// let x = QueryDirectoryContentsResponse::new()
4621 /// .set_directory_entries([
4622 /// DirectoryEntry::default()/* use setters */,
4623 /// DirectoryEntry::default()/* use (different) setters */,
4624 /// ]);
4625 /// ```
4626 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
4627 where
4628 T: std::iter::IntoIterator<Item = V>,
4629 V: std::convert::Into<crate::model::DirectoryEntry>,
4630 {
4631 use std::iter::Iterator;
4632 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
4633 self
4634 }
4635
4636 /// Sets the value of [next_page_token][crate::model::QueryDirectoryContentsResponse::next_page_token].
4637 ///
4638 /// # Example
4639 /// ```ignore,no_run
4640 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4641 /// let x = QueryDirectoryContentsResponse::new().set_next_page_token("example");
4642 /// ```
4643 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4644 self.next_page_token = v.into();
4645 self
4646 }
4647}
4648
4649impl wkt::message::Message for QueryDirectoryContentsResponse {
4650 fn typename() -> &'static str {
4651 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsResponse"
4652 }
4653}
4654
4655#[doc(hidden)]
4656impl google_cloud_gax::paginator::internal::PageableResponse for QueryDirectoryContentsResponse {
4657 type PageItem = crate::model::DirectoryEntry;
4658
4659 fn items(self) -> std::vec::Vec<Self::PageItem> {
4660 self.directory_entries
4661 }
4662
4663 fn next_page_token(&self) -> std::string::String {
4664 use std::clone::Clone;
4665 self.next_page_token.clone()
4666 }
4667}
4668
4669/// Represents a single entry in a directory.
4670#[derive(Clone, Default, PartialEq)]
4671#[non_exhaustive]
4672pub struct DirectoryEntry {
4673 /// Entry with metadata.
4674 pub metadata: std::option::Option<crate::model::FilesystemEntryMetadata>,
4675
4676 /// The entry's contents.
4677 pub entry: std::option::Option<crate::model::directory_entry::Entry>,
4678
4679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4680}
4681
4682impl DirectoryEntry {
4683 /// Creates a new default instance.
4684 pub fn new() -> Self {
4685 std::default::Default::default()
4686 }
4687
4688 /// Sets the value of [metadata][crate::model::DirectoryEntry::metadata].
4689 ///
4690 /// # Example
4691 /// ```ignore,no_run
4692 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4693 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4694 /// let x = DirectoryEntry::new().set_metadata(FilesystemEntryMetadata::default()/* use setters */);
4695 /// ```
4696 pub fn set_metadata<T>(mut self, v: T) -> Self
4697 where
4698 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4699 {
4700 self.metadata = std::option::Option::Some(v.into());
4701 self
4702 }
4703
4704 /// Sets or clears the value of [metadata][crate::model::DirectoryEntry::metadata].
4705 ///
4706 /// # Example
4707 /// ```ignore,no_run
4708 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4709 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4710 /// let x = DirectoryEntry::new().set_or_clear_metadata(Some(FilesystemEntryMetadata::default()/* use setters */));
4711 /// let x = DirectoryEntry::new().set_or_clear_metadata(None::<FilesystemEntryMetadata>);
4712 /// ```
4713 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4714 where
4715 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4716 {
4717 self.metadata = v.map(|x| x.into());
4718 self
4719 }
4720
4721 /// Sets the value of [entry][crate::model::DirectoryEntry::entry].
4722 ///
4723 /// Note that all the setters affecting `entry` are mutually
4724 /// exclusive.
4725 ///
4726 /// # Example
4727 /// ```ignore,no_run
4728 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4729 /// use google_cloud_dataform_v1::model::directory_entry::Entry;
4730 /// let x = DirectoryEntry::new().set_entry(Some(Entry::File("example".to_string())));
4731 /// ```
4732 pub fn set_entry<
4733 T: std::convert::Into<std::option::Option<crate::model::directory_entry::Entry>>,
4734 >(
4735 mut self,
4736 v: T,
4737 ) -> Self {
4738 self.entry = v.into();
4739 self
4740 }
4741
4742 /// The value of [entry][crate::model::DirectoryEntry::entry]
4743 /// if it holds a `File`, `None` if the field is not set or
4744 /// holds a different branch.
4745 pub fn file(&self) -> std::option::Option<&std::string::String> {
4746 #[allow(unreachable_patterns)]
4747 self.entry.as_ref().and_then(|v| match v {
4748 crate::model::directory_entry::Entry::File(v) => std::option::Option::Some(v),
4749 _ => std::option::Option::None,
4750 })
4751 }
4752
4753 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4754 /// to hold a `File`.
4755 ///
4756 /// Note that all the setters affecting `entry` are
4757 /// mutually exclusive.
4758 ///
4759 /// # Example
4760 /// ```ignore,no_run
4761 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4762 /// let x = DirectoryEntry::new().set_file("example");
4763 /// assert!(x.file().is_some());
4764 /// assert!(x.directory().is_none());
4765 /// ```
4766 pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4767 self.entry =
4768 std::option::Option::Some(crate::model::directory_entry::Entry::File(v.into()));
4769 self
4770 }
4771
4772 /// The value of [entry][crate::model::DirectoryEntry::entry]
4773 /// if it holds a `Directory`, `None` if the field is not set or
4774 /// holds a different branch.
4775 pub fn directory(&self) -> std::option::Option<&std::string::String> {
4776 #[allow(unreachable_patterns)]
4777 self.entry.as_ref().and_then(|v| match v {
4778 crate::model::directory_entry::Entry::Directory(v) => std::option::Option::Some(v),
4779 _ => std::option::Option::None,
4780 })
4781 }
4782
4783 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4784 /// to hold a `Directory`.
4785 ///
4786 /// Note that all the setters affecting `entry` are
4787 /// mutually exclusive.
4788 ///
4789 /// # Example
4790 /// ```ignore,no_run
4791 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4792 /// let x = DirectoryEntry::new().set_directory("example");
4793 /// assert!(x.directory().is_some());
4794 /// assert!(x.file().is_none());
4795 /// ```
4796 pub fn set_directory<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4797 self.entry =
4798 std::option::Option::Some(crate::model::directory_entry::Entry::Directory(v.into()));
4799 self
4800 }
4801}
4802
4803impl wkt::message::Message for DirectoryEntry {
4804 fn typename() -> &'static str {
4805 "type.googleapis.com/google.cloud.dataform.v1.DirectoryEntry"
4806 }
4807}
4808
4809/// Defines additional types related to [DirectoryEntry].
4810pub mod directory_entry {
4811 #[allow(unused_imports)]
4812 use super::*;
4813
4814 /// The entry's contents.
4815 #[derive(Clone, Debug, PartialEq)]
4816 #[non_exhaustive]
4817 pub enum Entry {
4818 /// A file in the directory. The path is returned including the full
4819 /// folder structure from the root.
4820 File(std::string::String),
4821 /// A child directory in the directory. The path is returned including
4822 /// the full folder structure from the root.
4823 Directory(std::string::String),
4824 }
4825}
4826
4827/// Represents metadata for a single entry in a filesystem.
4828#[derive(Clone, Default, PartialEq)]
4829#[non_exhaustive]
4830pub struct FilesystemEntryMetadata {
4831 /// Output only. Provides the size of the entry in bytes. For directories, this
4832 /// will be 0.
4833 pub size_bytes: i64,
4834
4835 /// Output only. Represents the time of the last modification of the entry.
4836 pub update_time: std::option::Option<wkt::Timestamp>,
4837
4838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4839}
4840
4841impl FilesystemEntryMetadata {
4842 /// Creates a new default instance.
4843 pub fn new() -> Self {
4844 std::default::Default::default()
4845 }
4846
4847 /// Sets the value of [size_bytes][crate::model::FilesystemEntryMetadata::size_bytes].
4848 ///
4849 /// # Example
4850 /// ```ignore,no_run
4851 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4852 /// let x = FilesystemEntryMetadata::new().set_size_bytes(42);
4853 /// ```
4854 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4855 self.size_bytes = v.into();
4856 self
4857 }
4858
4859 /// Sets the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
4860 ///
4861 /// # Example
4862 /// ```ignore,no_run
4863 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4864 /// use wkt::Timestamp;
4865 /// let x = FilesystemEntryMetadata::new().set_update_time(Timestamp::default()/* use setters */);
4866 /// ```
4867 pub fn set_update_time<T>(mut self, v: T) -> Self
4868 where
4869 T: std::convert::Into<wkt::Timestamp>,
4870 {
4871 self.update_time = std::option::Option::Some(v.into());
4872 self
4873 }
4874
4875 /// Sets or clears the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
4876 ///
4877 /// # Example
4878 /// ```ignore,no_run
4879 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4880 /// use wkt::Timestamp;
4881 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4882 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(None::<Timestamp>);
4883 /// ```
4884 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4885 where
4886 T: std::convert::Into<wkt::Timestamp>,
4887 {
4888 self.update_time = v.map(|x| x.into());
4889 self
4890 }
4891}
4892
4893impl wkt::message::Message for FilesystemEntryMetadata {
4894 fn typename() -> &'static str {
4895 "type.googleapis.com/google.cloud.dataform.v1.FilesystemEntryMetadata"
4896 }
4897}
4898
4899/// Configuration containing file search request parameters.
4900#[derive(Clone, Default, PartialEq)]
4901#[non_exhaustive]
4902pub struct SearchFilesRequest {
4903 /// Required. The workspace's name.
4904 pub workspace: std::string::String,
4905
4906 /// Optional. Maximum number of search results to return. The server may return
4907 /// fewer items than requested. If unspecified, the server will pick an
4908 /// appropriate default.
4909 pub page_size: i32,
4910
4911 /// Optional. Page token received from a previous `SearchFilesRequest`
4912 /// call. Provide this to retrieve the subsequent page.
4913 ///
4914 /// When paginating, all other parameters provided to `SearchFilesRequest`,
4915 /// with the exception of `page_size`, must match the call that provided the
4916 /// page token.
4917 pub page_token: std::string::String,
4918
4919 /// Optional. Optional filter for the returned list in filtering format.
4920 /// Filtering is only currently supported on the `path` field.
4921 /// See <https://google.aip.dev/160> for details.
4922 pub filter: std::string::String,
4923
4924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4925}
4926
4927impl SearchFilesRequest {
4928 /// Creates a new default instance.
4929 pub fn new() -> Self {
4930 std::default::Default::default()
4931 }
4932
4933 /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
4934 ///
4935 /// # Example
4936 /// ```ignore,no_run
4937 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4938 /// # let project_id = "project_id";
4939 /// # let location_id = "location_id";
4940 /// # let repository_id = "repository_id";
4941 /// # let workspace_id = "workspace_id";
4942 /// let x = SearchFilesRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4943 /// ```
4944 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4945 self.workspace = v.into();
4946 self
4947 }
4948
4949 /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
4950 ///
4951 /// # Example
4952 /// ```ignore,no_run
4953 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4954 /// let x = SearchFilesRequest::new().set_page_size(42);
4955 /// ```
4956 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4957 self.page_size = v.into();
4958 self
4959 }
4960
4961 /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
4962 ///
4963 /// # Example
4964 /// ```ignore,no_run
4965 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4966 /// let x = SearchFilesRequest::new().set_page_token("example");
4967 /// ```
4968 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4969 self.page_token = v.into();
4970 self
4971 }
4972
4973 /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4978 /// let x = SearchFilesRequest::new().set_filter("example");
4979 /// ```
4980 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4981 self.filter = v.into();
4982 self
4983 }
4984}
4985
4986impl wkt::message::Message for SearchFilesRequest {
4987 fn typename() -> &'static str {
4988 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesRequest"
4989 }
4990}
4991
4992/// Client-facing representation of a file search response.
4993#[derive(Clone, Default, PartialEq)]
4994#[non_exhaustive]
4995pub struct SearchFilesResponse {
4996 /// List of matched results.
4997 pub search_results: std::vec::Vec<crate::model::SearchResult>,
4998
4999 /// Optional. A token, which can be sent as `page_token` to retrieve the next
5000 /// page. If this field is omitted, there are no subsequent pages.
5001 pub next_page_token: std::string::String,
5002
5003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5004}
5005
5006impl SearchFilesResponse {
5007 /// Creates a new default instance.
5008 pub fn new() -> Self {
5009 std::default::Default::default()
5010 }
5011
5012 /// Sets the value of [search_results][crate::model::SearchFilesResponse::search_results].
5013 ///
5014 /// # Example
5015 /// ```ignore,no_run
5016 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
5017 /// use google_cloud_dataform_v1::model::SearchResult;
5018 /// let x = SearchFilesResponse::new()
5019 /// .set_search_results([
5020 /// SearchResult::default()/* use setters */,
5021 /// SearchResult::default()/* use (different) setters */,
5022 /// ]);
5023 /// ```
5024 pub fn set_search_results<T, V>(mut self, v: T) -> Self
5025 where
5026 T: std::iter::IntoIterator<Item = V>,
5027 V: std::convert::Into<crate::model::SearchResult>,
5028 {
5029 use std::iter::Iterator;
5030 self.search_results = v.into_iter().map(|i| i.into()).collect();
5031 self
5032 }
5033
5034 /// Sets the value of [next_page_token][crate::model::SearchFilesResponse::next_page_token].
5035 ///
5036 /// # Example
5037 /// ```ignore,no_run
5038 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
5039 /// let x = SearchFilesResponse::new().set_next_page_token("example");
5040 /// ```
5041 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5042 self.next_page_token = v.into();
5043 self
5044 }
5045}
5046
5047impl wkt::message::Message for SearchFilesResponse {
5048 fn typename() -> &'static str {
5049 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesResponse"
5050 }
5051}
5052
5053#[doc(hidden)]
5054impl google_cloud_gax::paginator::internal::PageableResponse for SearchFilesResponse {
5055 type PageItem = crate::model::SearchResult;
5056
5057 fn items(self) -> std::vec::Vec<Self::PageItem> {
5058 self.search_results
5059 }
5060
5061 fn next_page_token(&self) -> std::string::String {
5062 use std::clone::Clone;
5063 self.next_page_token.clone()
5064 }
5065}
5066
5067/// Client-facing representation of a search result entry.
5068#[derive(Clone, Default, PartialEq)]
5069#[non_exhaustive]
5070pub struct SearchResult {
5071 /// The entry's contents.
5072 pub entry: std::option::Option<crate::model::search_result::Entry>,
5073
5074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5075}
5076
5077impl SearchResult {
5078 /// Creates a new default instance.
5079 pub fn new() -> Self {
5080 std::default::Default::default()
5081 }
5082
5083 /// Sets the value of [entry][crate::model::SearchResult::entry].
5084 ///
5085 /// Note that all the setters affecting `entry` are mutually
5086 /// exclusive.
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_dataform_v1::model::SearchResult;
5091 /// use google_cloud_dataform_v1::model::FileSearchResult;
5092 /// let x = SearchResult::new().set_entry(Some(
5093 /// google_cloud_dataform_v1::model::search_result::Entry::File(FileSearchResult::default().into())));
5094 /// ```
5095 pub fn set_entry<
5096 T: std::convert::Into<std::option::Option<crate::model::search_result::Entry>>,
5097 >(
5098 mut self,
5099 v: T,
5100 ) -> Self {
5101 self.entry = v.into();
5102 self
5103 }
5104
5105 /// The value of [entry][crate::model::SearchResult::entry]
5106 /// if it holds a `File`, `None` if the field is not set or
5107 /// holds a different branch.
5108 pub fn file(&self) -> std::option::Option<&std::boxed::Box<crate::model::FileSearchResult>> {
5109 #[allow(unreachable_patterns)]
5110 self.entry.as_ref().and_then(|v| match v {
5111 crate::model::search_result::Entry::File(v) => std::option::Option::Some(v),
5112 _ => std::option::Option::None,
5113 })
5114 }
5115
5116 /// Sets the value of [entry][crate::model::SearchResult::entry]
5117 /// to hold a `File`.
5118 ///
5119 /// Note that all the setters affecting `entry` are
5120 /// mutually exclusive.
5121 ///
5122 /// # Example
5123 /// ```ignore,no_run
5124 /// # use google_cloud_dataform_v1::model::SearchResult;
5125 /// use google_cloud_dataform_v1::model::FileSearchResult;
5126 /// let x = SearchResult::new().set_file(FileSearchResult::default()/* use setters */);
5127 /// assert!(x.file().is_some());
5128 /// assert!(x.directory().is_none());
5129 /// ```
5130 pub fn set_file<T: std::convert::Into<std::boxed::Box<crate::model::FileSearchResult>>>(
5131 mut self,
5132 v: T,
5133 ) -> Self {
5134 self.entry = std::option::Option::Some(crate::model::search_result::Entry::File(v.into()));
5135 self
5136 }
5137
5138 /// The value of [entry][crate::model::SearchResult::entry]
5139 /// if it holds a `Directory`, `None` if the field is not set or
5140 /// holds a different branch.
5141 pub fn directory(
5142 &self,
5143 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectorySearchResult>> {
5144 #[allow(unreachable_patterns)]
5145 self.entry.as_ref().and_then(|v| match v {
5146 crate::model::search_result::Entry::Directory(v) => std::option::Option::Some(v),
5147 _ => std::option::Option::None,
5148 })
5149 }
5150
5151 /// Sets the value of [entry][crate::model::SearchResult::entry]
5152 /// to hold a `Directory`.
5153 ///
5154 /// Note that all the setters affecting `entry` are
5155 /// mutually exclusive.
5156 ///
5157 /// # Example
5158 /// ```ignore,no_run
5159 /// # use google_cloud_dataform_v1::model::SearchResult;
5160 /// use google_cloud_dataform_v1::model::DirectorySearchResult;
5161 /// let x = SearchResult::new().set_directory(DirectorySearchResult::default()/* use setters */);
5162 /// assert!(x.directory().is_some());
5163 /// assert!(x.file().is_none());
5164 /// ```
5165 pub fn set_directory<
5166 T: std::convert::Into<std::boxed::Box<crate::model::DirectorySearchResult>>,
5167 >(
5168 mut self,
5169 v: T,
5170 ) -> Self {
5171 self.entry =
5172 std::option::Option::Some(crate::model::search_result::Entry::Directory(v.into()));
5173 self
5174 }
5175}
5176
5177impl wkt::message::Message for SearchResult {
5178 fn typename() -> &'static str {
5179 "type.googleapis.com/google.cloud.dataform.v1.SearchResult"
5180 }
5181}
5182
5183/// Defines additional types related to [SearchResult].
5184pub mod search_result {
5185 #[allow(unused_imports)]
5186 use super::*;
5187
5188 /// The entry's contents.
5189 #[derive(Clone, Debug, PartialEq)]
5190 #[non_exhaustive]
5191 pub enum Entry {
5192 /// Details when search result is a file.
5193 File(std::boxed::Box<crate::model::FileSearchResult>),
5194 /// Details when search result is a directory.
5195 Directory(std::boxed::Box<crate::model::DirectorySearchResult>),
5196 }
5197}
5198
5199/// Client-facing representation of a file entry in search results.
5200#[derive(Clone, Default, PartialEq)]
5201#[non_exhaustive]
5202pub struct FileSearchResult {
5203 /// File system path relative to the workspace root.
5204 pub path: std::string::String,
5205
5206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5207}
5208
5209impl FileSearchResult {
5210 /// Creates a new default instance.
5211 pub fn new() -> Self {
5212 std::default::Default::default()
5213 }
5214
5215 /// Sets the value of [path][crate::model::FileSearchResult::path].
5216 ///
5217 /// # Example
5218 /// ```ignore,no_run
5219 /// # use google_cloud_dataform_v1::model::FileSearchResult;
5220 /// let x = FileSearchResult::new().set_path("example");
5221 /// ```
5222 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5223 self.path = v.into();
5224 self
5225 }
5226}
5227
5228impl wkt::message::Message for FileSearchResult {
5229 fn typename() -> &'static str {
5230 "type.googleapis.com/google.cloud.dataform.v1.FileSearchResult"
5231 }
5232}
5233
5234/// Client-facing representation of a directory entry in search results.
5235#[derive(Clone, Default, PartialEq)]
5236#[non_exhaustive]
5237pub struct DirectorySearchResult {
5238 /// File system path relative to the workspace root.
5239 pub path: std::string::String,
5240
5241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5242}
5243
5244impl DirectorySearchResult {
5245 /// Creates a new default instance.
5246 pub fn new() -> Self {
5247 std::default::Default::default()
5248 }
5249
5250 /// Sets the value of [path][crate::model::DirectorySearchResult::path].
5251 ///
5252 /// # Example
5253 /// ```ignore,no_run
5254 /// # use google_cloud_dataform_v1::model::DirectorySearchResult;
5255 /// let x = DirectorySearchResult::new().set_path("example");
5256 /// ```
5257 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5258 self.path = v.into();
5259 self
5260 }
5261}
5262
5263impl wkt::message::Message for DirectorySearchResult {
5264 fn typename() -> &'static str {
5265 "type.googleapis.com/google.cloud.dataform.v1.DirectorySearchResult"
5266 }
5267}
5268
5269/// `MakeDirectory` request message.
5270#[derive(Clone, Default, PartialEq)]
5271#[non_exhaustive]
5272pub struct MakeDirectoryRequest {
5273 /// Required. The workspace's name.
5274 pub workspace: std::string::String,
5275
5276 /// Required. The directory's full path including directory name, relative to
5277 /// the workspace root.
5278 pub path: std::string::String,
5279
5280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5281}
5282
5283impl MakeDirectoryRequest {
5284 /// Creates a new default instance.
5285 pub fn new() -> Self {
5286 std::default::Default::default()
5287 }
5288
5289 /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
5290 ///
5291 /// # Example
5292 /// ```ignore,no_run
5293 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5294 /// # let project_id = "project_id";
5295 /// # let location_id = "location_id";
5296 /// # let repository_id = "repository_id";
5297 /// # let workspace_id = "workspace_id";
5298 /// let x = MakeDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5299 /// ```
5300 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.workspace = v.into();
5302 self
5303 }
5304
5305 /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
5306 ///
5307 /// # Example
5308 /// ```ignore,no_run
5309 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5310 /// let x = MakeDirectoryRequest::new().set_path("example");
5311 /// ```
5312 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313 self.path = v.into();
5314 self
5315 }
5316}
5317
5318impl wkt::message::Message for MakeDirectoryRequest {
5319 fn typename() -> &'static str {
5320 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryRequest"
5321 }
5322}
5323
5324/// `MakeDirectory` response message.
5325#[derive(Clone, Default, PartialEq)]
5326#[non_exhaustive]
5327pub struct MakeDirectoryResponse {
5328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5329}
5330
5331impl MakeDirectoryResponse {
5332 /// Creates a new default instance.
5333 pub fn new() -> Self {
5334 std::default::Default::default()
5335 }
5336}
5337
5338impl wkt::message::Message for MakeDirectoryResponse {
5339 fn typename() -> &'static str {
5340 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryResponse"
5341 }
5342}
5343
5344/// `RemoveDirectory` request message.
5345#[derive(Clone, Default, PartialEq)]
5346#[non_exhaustive]
5347pub struct RemoveDirectoryRequest {
5348 /// Required. The workspace's name.
5349 pub workspace: std::string::String,
5350
5351 /// Required. The directory's full path including directory name, relative to
5352 /// the workspace root.
5353 pub path: std::string::String,
5354
5355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5356}
5357
5358impl RemoveDirectoryRequest {
5359 /// Creates a new default instance.
5360 pub fn new() -> Self {
5361 std::default::Default::default()
5362 }
5363
5364 /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
5365 ///
5366 /// # Example
5367 /// ```ignore,no_run
5368 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5369 /// # let project_id = "project_id";
5370 /// # let location_id = "location_id";
5371 /// # let repository_id = "repository_id";
5372 /// # let workspace_id = "workspace_id";
5373 /// let x = RemoveDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5374 /// ```
5375 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5376 self.workspace = v.into();
5377 self
5378 }
5379
5380 /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
5381 ///
5382 /// # Example
5383 /// ```ignore,no_run
5384 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5385 /// let x = RemoveDirectoryRequest::new().set_path("example");
5386 /// ```
5387 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.path = v.into();
5389 self
5390 }
5391}
5392
5393impl wkt::message::Message for RemoveDirectoryRequest {
5394 fn typename() -> &'static str {
5395 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryRequest"
5396 }
5397}
5398
5399/// `RemoveDirectory` response message.
5400#[derive(Clone, Default, PartialEq)]
5401#[non_exhaustive]
5402pub struct RemoveDirectoryResponse {
5403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5404}
5405
5406impl RemoveDirectoryResponse {
5407 /// Creates a new default instance.
5408 pub fn new() -> Self {
5409 std::default::Default::default()
5410 }
5411}
5412
5413impl wkt::message::Message for RemoveDirectoryResponse {
5414 fn typename() -> &'static str {
5415 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryResponse"
5416 }
5417}
5418
5419/// `MoveDirectory` request message.
5420#[derive(Clone, Default, PartialEq)]
5421#[non_exhaustive]
5422pub struct MoveDirectoryRequest {
5423 /// Required. The workspace's name.
5424 pub workspace: std::string::String,
5425
5426 /// Required. The directory's full path including directory name, relative to
5427 /// the workspace root.
5428 pub path: std::string::String,
5429
5430 /// Required. The new path for the directory including directory name, rooted
5431 /// at workspace root.
5432 pub new_path: std::string::String,
5433
5434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5435}
5436
5437impl MoveDirectoryRequest {
5438 /// Creates a new default instance.
5439 pub fn new() -> Self {
5440 std::default::Default::default()
5441 }
5442
5443 /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
5444 ///
5445 /// # Example
5446 /// ```ignore,no_run
5447 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5448 /// # let project_id = "project_id";
5449 /// # let location_id = "location_id";
5450 /// # let repository_id = "repository_id";
5451 /// # let workspace_id = "workspace_id";
5452 /// let x = MoveDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5453 /// ```
5454 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5455 self.workspace = v.into();
5456 self
5457 }
5458
5459 /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
5460 ///
5461 /// # Example
5462 /// ```ignore,no_run
5463 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5464 /// let x = MoveDirectoryRequest::new().set_path("example");
5465 /// ```
5466 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5467 self.path = v.into();
5468 self
5469 }
5470
5471 /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
5472 ///
5473 /// # Example
5474 /// ```ignore,no_run
5475 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5476 /// let x = MoveDirectoryRequest::new().set_new_path("example");
5477 /// ```
5478 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5479 self.new_path = v.into();
5480 self
5481 }
5482}
5483
5484impl wkt::message::Message for MoveDirectoryRequest {
5485 fn typename() -> &'static str {
5486 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryRequest"
5487 }
5488}
5489
5490/// `MoveDirectory` response message.
5491#[derive(Clone, Default, PartialEq)]
5492#[non_exhaustive]
5493pub struct MoveDirectoryResponse {
5494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5495}
5496
5497impl MoveDirectoryResponse {
5498 /// Creates a new default instance.
5499 pub fn new() -> Self {
5500 std::default::Default::default()
5501 }
5502}
5503
5504impl wkt::message::Message for MoveDirectoryResponse {
5505 fn typename() -> &'static str {
5506 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryResponse"
5507 }
5508}
5509
5510/// `ReadFile` request message.
5511#[derive(Clone, Default, PartialEq)]
5512#[non_exhaustive]
5513pub struct ReadFileRequest {
5514 /// Required. The workspace's name.
5515 pub workspace: std::string::String,
5516
5517 /// Required. The file's full path including filename, relative to the
5518 /// workspace root.
5519 pub path: std::string::String,
5520
5521 /// Optional. The Git revision of the file to return. If left empty, the
5522 /// current contents of `path` will be returned.
5523 pub revision: std::string::String,
5524
5525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5526}
5527
5528impl ReadFileRequest {
5529 /// Creates a new default instance.
5530 pub fn new() -> Self {
5531 std::default::Default::default()
5532 }
5533
5534 /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
5535 ///
5536 /// # Example
5537 /// ```ignore,no_run
5538 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5539 /// # let project_id = "project_id";
5540 /// # let location_id = "location_id";
5541 /// # let repository_id = "repository_id";
5542 /// # let workspace_id = "workspace_id";
5543 /// let x = ReadFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5544 /// ```
5545 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5546 self.workspace = v.into();
5547 self
5548 }
5549
5550 /// Sets the value of [path][crate::model::ReadFileRequest::path].
5551 ///
5552 /// # Example
5553 /// ```ignore,no_run
5554 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5555 /// let x = ReadFileRequest::new().set_path("example");
5556 /// ```
5557 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5558 self.path = v.into();
5559 self
5560 }
5561
5562 /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
5563 ///
5564 /// # Example
5565 /// ```ignore,no_run
5566 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5567 /// let x = ReadFileRequest::new().set_revision("example");
5568 /// ```
5569 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5570 self.revision = v.into();
5571 self
5572 }
5573}
5574
5575impl wkt::message::Message for ReadFileRequest {
5576 fn typename() -> &'static str {
5577 "type.googleapis.com/google.cloud.dataform.v1.ReadFileRequest"
5578 }
5579}
5580
5581/// `ReadFile` response message.
5582#[derive(Clone, Default, PartialEq)]
5583#[non_exhaustive]
5584pub struct ReadFileResponse {
5585 /// The file's contents.
5586 pub file_contents: ::bytes::Bytes,
5587
5588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5589}
5590
5591impl ReadFileResponse {
5592 /// Creates a new default instance.
5593 pub fn new() -> Self {
5594 std::default::Default::default()
5595 }
5596
5597 /// Sets the value of [file_contents][crate::model::ReadFileResponse::file_contents].
5598 ///
5599 /// # Example
5600 /// ```ignore,no_run
5601 /// # use google_cloud_dataform_v1::model::ReadFileResponse;
5602 /// let x = ReadFileResponse::new().set_file_contents(bytes::Bytes::from_static(b"example"));
5603 /// ```
5604 pub fn set_file_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5605 self.file_contents = v.into();
5606 self
5607 }
5608}
5609
5610impl wkt::message::Message for ReadFileResponse {
5611 fn typename() -> &'static str {
5612 "type.googleapis.com/google.cloud.dataform.v1.ReadFileResponse"
5613 }
5614}
5615
5616/// `RemoveFile` request message.
5617#[derive(Clone, Default, PartialEq)]
5618#[non_exhaustive]
5619pub struct RemoveFileRequest {
5620 /// Required. The workspace's name.
5621 pub workspace: std::string::String,
5622
5623 /// Required. The file's full path including filename, relative to the
5624 /// workspace root.
5625 pub path: std::string::String,
5626
5627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5628}
5629
5630impl RemoveFileRequest {
5631 /// Creates a new default instance.
5632 pub fn new() -> Self {
5633 std::default::Default::default()
5634 }
5635
5636 /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
5637 ///
5638 /// # Example
5639 /// ```ignore,no_run
5640 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5641 /// # let project_id = "project_id";
5642 /// # let location_id = "location_id";
5643 /// # let repository_id = "repository_id";
5644 /// # let workspace_id = "workspace_id";
5645 /// let x = RemoveFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5646 /// ```
5647 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5648 self.workspace = v.into();
5649 self
5650 }
5651
5652 /// Sets the value of [path][crate::model::RemoveFileRequest::path].
5653 ///
5654 /// # Example
5655 /// ```ignore,no_run
5656 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5657 /// let x = RemoveFileRequest::new().set_path("example");
5658 /// ```
5659 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5660 self.path = v.into();
5661 self
5662 }
5663}
5664
5665impl wkt::message::Message for RemoveFileRequest {
5666 fn typename() -> &'static str {
5667 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileRequest"
5668 }
5669}
5670
5671/// `RemoveFile` response message.
5672#[derive(Clone, Default, PartialEq)]
5673#[non_exhaustive]
5674pub struct RemoveFileResponse {
5675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5676}
5677
5678impl RemoveFileResponse {
5679 /// Creates a new default instance.
5680 pub fn new() -> Self {
5681 std::default::Default::default()
5682 }
5683}
5684
5685impl wkt::message::Message for RemoveFileResponse {
5686 fn typename() -> &'static str {
5687 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileResponse"
5688 }
5689}
5690
5691/// `MoveFile` request message.
5692#[derive(Clone, Default, PartialEq)]
5693#[non_exhaustive]
5694pub struct MoveFileRequest {
5695 /// Required. The workspace's name.
5696 pub workspace: std::string::String,
5697
5698 /// Required. The file's full path including filename, relative to the
5699 /// workspace root.
5700 pub path: std::string::String,
5701
5702 /// Required. The file's new path including filename, relative to the workspace
5703 /// root.
5704 pub new_path: std::string::String,
5705
5706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5707}
5708
5709impl MoveFileRequest {
5710 /// Creates a new default instance.
5711 pub fn new() -> Self {
5712 std::default::Default::default()
5713 }
5714
5715 /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
5716 ///
5717 /// # Example
5718 /// ```ignore,no_run
5719 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5720 /// # let project_id = "project_id";
5721 /// # let location_id = "location_id";
5722 /// # let repository_id = "repository_id";
5723 /// # let workspace_id = "workspace_id";
5724 /// let x = MoveFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5725 /// ```
5726 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5727 self.workspace = v.into();
5728 self
5729 }
5730
5731 /// Sets the value of [path][crate::model::MoveFileRequest::path].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5736 /// let x = MoveFileRequest::new().set_path("example");
5737 /// ```
5738 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5739 self.path = v.into();
5740 self
5741 }
5742
5743 /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
5744 ///
5745 /// # Example
5746 /// ```ignore,no_run
5747 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5748 /// let x = MoveFileRequest::new().set_new_path("example");
5749 /// ```
5750 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5751 self.new_path = v.into();
5752 self
5753 }
5754}
5755
5756impl wkt::message::Message for MoveFileRequest {
5757 fn typename() -> &'static str {
5758 "type.googleapis.com/google.cloud.dataform.v1.MoveFileRequest"
5759 }
5760}
5761
5762/// `MoveFile` response message.
5763#[derive(Clone, Default, PartialEq)]
5764#[non_exhaustive]
5765pub struct MoveFileResponse {
5766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5767}
5768
5769impl MoveFileResponse {
5770 /// Creates a new default instance.
5771 pub fn new() -> Self {
5772 std::default::Default::default()
5773 }
5774}
5775
5776impl wkt::message::Message for MoveFileResponse {
5777 fn typename() -> &'static str {
5778 "type.googleapis.com/google.cloud.dataform.v1.MoveFileResponse"
5779 }
5780}
5781
5782/// `WriteFile` request message.
5783#[derive(Clone, Default, PartialEq)]
5784#[non_exhaustive]
5785pub struct WriteFileRequest {
5786 /// Required. The workspace's name.
5787 pub workspace: std::string::String,
5788
5789 /// Required. The file.
5790 pub path: std::string::String,
5791
5792 /// Required. The file's contents.
5793 pub contents: ::bytes::Bytes,
5794
5795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5796}
5797
5798impl WriteFileRequest {
5799 /// Creates a new default instance.
5800 pub fn new() -> Self {
5801 std::default::Default::default()
5802 }
5803
5804 /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
5805 ///
5806 /// # Example
5807 /// ```ignore,no_run
5808 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5809 /// # let project_id = "project_id";
5810 /// # let location_id = "location_id";
5811 /// # let repository_id = "repository_id";
5812 /// # let workspace_id = "workspace_id";
5813 /// let x = WriteFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5814 /// ```
5815 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5816 self.workspace = v.into();
5817 self
5818 }
5819
5820 /// Sets the value of [path][crate::model::WriteFileRequest::path].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5825 /// let x = WriteFileRequest::new().set_path("example");
5826 /// ```
5827 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.path = v.into();
5829 self
5830 }
5831
5832 /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
5833 ///
5834 /// # Example
5835 /// ```ignore,no_run
5836 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5837 /// let x = WriteFileRequest::new().set_contents(bytes::Bytes::from_static(b"example"));
5838 /// ```
5839 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5840 self.contents = v.into();
5841 self
5842 }
5843}
5844
5845impl wkt::message::Message for WriteFileRequest {
5846 fn typename() -> &'static str {
5847 "type.googleapis.com/google.cloud.dataform.v1.WriteFileRequest"
5848 }
5849}
5850
5851/// `WriteFile` response message.
5852#[derive(Clone, Default, PartialEq)]
5853#[non_exhaustive]
5854pub struct WriteFileResponse {
5855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5856}
5857
5858impl WriteFileResponse {
5859 /// Creates a new default instance.
5860 pub fn new() -> Self {
5861 std::default::Default::default()
5862 }
5863}
5864
5865impl wkt::message::Message for WriteFileResponse {
5866 fn typename() -> &'static str {
5867 "type.googleapis.com/google.cloud.dataform.v1.WriteFileResponse"
5868 }
5869}
5870
5871/// `InstallNpmPackages` request message.
5872#[derive(Clone, Default, PartialEq)]
5873#[non_exhaustive]
5874pub struct InstallNpmPackagesRequest {
5875 /// Required. The workspace's name.
5876 pub workspace: std::string::String,
5877
5878 /// Optional. The pipeline options which defines the pipeline type and path
5879 /// within the Git repository.
5880 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
5881
5882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5883}
5884
5885impl InstallNpmPackagesRequest {
5886 /// Creates a new default instance.
5887 pub fn new() -> Self {
5888 std::default::Default::default()
5889 }
5890
5891 /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
5892 ///
5893 /// # Example
5894 /// ```ignore,no_run
5895 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
5896 /// # let project_id = "project_id";
5897 /// # let location_id = "location_id";
5898 /// # let repository_id = "repository_id";
5899 /// # let workspace_id = "workspace_id";
5900 /// let x = InstallNpmPackagesRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5901 /// ```
5902 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5903 self.workspace = v.into();
5904 self
5905 }
5906
5907 /// Sets the value of [pipeline_config][crate::model::InstallNpmPackagesRequest::pipeline_config].
5908 ///
5909 /// # Example
5910 /// ```ignore,no_run
5911 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
5912 /// use google_cloud_dataform_v1::model::PipelineConfig;
5913 /// let x = InstallNpmPackagesRequest::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
5914 /// ```
5915 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
5916 where
5917 T: std::convert::Into<crate::model::PipelineConfig>,
5918 {
5919 self.pipeline_config = std::option::Option::Some(v.into());
5920 self
5921 }
5922
5923 /// Sets or clears the value of [pipeline_config][crate::model::InstallNpmPackagesRequest::pipeline_config].
5924 ///
5925 /// # Example
5926 /// ```ignore,no_run
5927 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
5928 /// use google_cloud_dataform_v1::model::PipelineConfig;
5929 /// let x = InstallNpmPackagesRequest::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
5930 /// let x = InstallNpmPackagesRequest::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
5931 /// ```
5932 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
5933 where
5934 T: std::convert::Into<crate::model::PipelineConfig>,
5935 {
5936 self.pipeline_config = v.map(|x| x.into());
5937 self
5938 }
5939}
5940
5941impl wkt::message::Message for InstallNpmPackagesRequest {
5942 fn typename() -> &'static str {
5943 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesRequest"
5944 }
5945}
5946
5947/// `InstallNpmPackages` response message.
5948#[derive(Clone, Default, PartialEq)]
5949#[non_exhaustive]
5950pub struct InstallNpmPackagesResponse {
5951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5952}
5953
5954impl InstallNpmPackagesResponse {
5955 /// Creates a new default instance.
5956 pub fn new() -> Self {
5957 std::default::Default::default()
5958 }
5959}
5960
5961impl wkt::message::Message for InstallNpmPackagesResponse {
5962 fn typename() -> &'static str {
5963 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesResponse"
5964 }
5965}
5966
5967/// Represents a Dataform release configuration.
5968#[derive(Clone, Default, PartialEq)]
5969#[non_exhaustive]
5970pub struct ReleaseConfig {
5971 /// Identifier. The release config's name.
5972 pub name: std::string::String,
5973
5974 /// Required. Git commit/tag/branch name at which the repository should be
5975 /// compiled. Must exist in the remote repository. Examples:
5976 ///
5977 /// - a commit SHA: `12ade345`
5978 /// - a tag: `tag1`
5979 /// - a branch name: `branch1`
5980 pub git_commitish: std::string::String,
5981
5982 /// Optional. If set, fields of `code_compilation_config` override the default
5983 /// compilation settings that are specified in dataform.json.
5984 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
5985
5986 /// Optional. Optional schedule (in cron format) for automatic creation of
5987 /// compilation results.
5988 pub cron_schedule: std::string::String,
5989
5990 /// Optional. Specifies the time zone to be used when interpreting
5991 /// cron_schedule. Must be a time zone name from the [time zone
5992 /// database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If
5993 /// left unspecified, the default is `UTC`.
5994 pub time_zone: std::string::String,
5995
5996 /// Output only. Records of the 10 most recent scheduled release attempts,
5997 /// ordered in descending order of `release_time`. Updated whenever automatic
5998 /// creation of a compilation result is triggered by cron_schedule.
5999 pub recent_scheduled_release_records:
6000 std::vec::Vec<crate::model::release_config::ScheduledReleaseRecord>,
6001
6002 /// Optional. The name of the currently released compilation result for this
6003 /// release config. This value is updated when a compilation result is
6004 /// automatically created from this release config (using cron_schedule), or
6005 /// when this resource is updated by API call (perhaps to roll back to an
6006 /// earlier release). The compilation result must have been created using this
6007 /// release config. Must be in the format
6008 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
6009 pub release_compilation_result: std::string::String,
6010
6011 /// Optional. Disables automatic creation of compilation results.
6012 pub disabled: bool,
6013
6014 /// Output only. All the metadata information that is used internally to serve
6015 /// the resource. For example: timestamps, flags, status fields, etc. The
6016 /// format of this field is a JSON string.
6017 pub internal_metadata: std::option::Option<std::string::String>,
6018
6019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6020}
6021
6022impl ReleaseConfig {
6023 /// Creates a new default instance.
6024 pub fn new() -> Self {
6025 std::default::Default::default()
6026 }
6027
6028 /// Sets the value of [name][crate::model::ReleaseConfig::name].
6029 ///
6030 /// # Example
6031 /// ```ignore,no_run
6032 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6033 /// # let project_id = "project_id";
6034 /// # let location_id = "location_id";
6035 /// # let repository_id = "repository_id";
6036 /// # let release_config_id = "release_config_id";
6037 /// let x = ReleaseConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6038 /// ```
6039 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.name = v.into();
6041 self
6042 }
6043
6044 /// Sets the value of [git_commitish][crate::model::ReleaseConfig::git_commitish].
6045 ///
6046 /// # Example
6047 /// ```ignore,no_run
6048 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6049 /// let x = ReleaseConfig::new().set_git_commitish("example");
6050 /// ```
6051 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6052 self.git_commitish = v.into();
6053 self
6054 }
6055
6056 /// Sets the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
6057 ///
6058 /// # Example
6059 /// ```ignore,no_run
6060 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6061 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6062 /// let x = ReleaseConfig::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
6063 /// ```
6064 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
6065 where
6066 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6067 {
6068 self.code_compilation_config = std::option::Option::Some(v.into());
6069 self
6070 }
6071
6072 /// Sets or clears the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
6073 ///
6074 /// # Example
6075 /// ```ignore,no_run
6076 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6077 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6078 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
6079 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
6080 /// ```
6081 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
6082 where
6083 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6084 {
6085 self.code_compilation_config = v.map(|x| x.into());
6086 self
6087 }
6088
6089 /// Sets the value of [cron_schedule][crate::model::ReleaseConfig::cron_schedule].
6090 ///
6091 /// # Example
6092 /// ```ignore,no_run
6093 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6094 /// let x = ReleaseConfig::new().set_cron_schedule("example");
6095 /// ```
6096 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6097 self.cron_schedule = v.into();
6098 self
6099 }
6100
6101 /// Sets the value of [time_zone][crate::model::ReleaseConfig::time_zone].
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6106 /// let x = ReleaseConfig::new().set_time_zone("example");
6107 /// ```
6108 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6109 self.time_zone = v.into();
6110 self
6111 }
6112
6113 /// Sets the value of [recent_scheduled_release_records][crate::model::ReleaseConfig::recent_scheduled_release_records].
6114 ///
6115 /// # Example
6116 /// ```ignore,no_run
6117 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6118 /// use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6119 /// let x = ReleaseConfig::new()
6120 /// .set_recent_scheduled_release_records([
6121 /// ScheduledReleaseRecord::default()/* use setters */,
6122 /// ScheduledReleaseRecord::default()/* use (different) setters */,
6123 /// ]);
6124 /// ```
6125 pub fn set_recent_scheduled_release_records<T, V>(mut self, v: T) -> Self
6126 where
6127 T: std::iter::IntoIterator<Item = V>,
6128 V: std::convert::Into<crate::model::release_config::ScheduledReleaseRecord>,
6129 {
6130 use std::iter::Iterator;
6131 self.recent_scheduled_release_records = v.into_iter().map(|i| i.into()).collect();
6132 self
6133 }
6134
6135 /// Sets the value of [release_compilation_result][crate::model::ReleaseConfig::release_compilation_result].
6136 ///
6137 /// # Example
6138 /// ```ignore,no_run
6139 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6140 /// # let project_id = "project_id";
6141 /// # let location_id = "location_id";
6142 /// # let repository_id = "repository_id";
6143 /// # let compilation_result_id = "compilation_result_id";
6144 /// let x = ReleaseConfig::new().set_release_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
6145 /// ```
6146 pub fn set_release_compilation_result<T: std::convert::Into<std::string::String>>(
6147 mut self,
6148 v: T,
6149 ) -> Self {
6150 self.release_compilation_result = v.into();
6151 self
6152 }
6153
6154 /// Sets the value of [disabled][crate::model::ReleaseConfig::disabled].
6155 ///
6156 /// # Example
6157 /// ```ignore,no_run
6158 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6159 /// let x = ReleaseConfig::new().set_disabled(true);
6160 /// ```
6161 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6162 self.disabled = v.into();
6163 self
6164 }
6165
6166 /// Sets the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
6167 ///
6168 /// # Example
6169 /// ```ignore,no_run
6170 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6171 /// let x = ReleaseConfig::new().set_internal_metadata("example");
6172 /// ```
6173 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
6174 where
6175 T: std::convert::Into<std::string::String>,
6176 {
6177 self.internal_metadata = std::option::Option::Some(v.into());
6178 self
6179 }
6180
6181 /// Sets or clears the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
6182 ///
6183 /// # Example
6184 /// ```ignore,no_run
6185 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6186 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(Some("example"));
6187 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(None::<String>);
6188 /// ```
6189 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6190 where
6191 T: std::convert::Into<std::string::String>,
6192 {
6193 self.internal_metadata = v.map(|x| x.into());
6194 self
6195 }
6196}
6197
6198impl wkt::message::Message for ReleaseConfig {
6199 fn typename() -> &'static str {
6200 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig"
6201 }
6202}
6203
6204/// Defines additional types related to [ReleaseConfig].
6205pub mod release_config {
6206 #[allow(unused_imports)]
6207 use super::*;
6208
6209 /// A record of an attempt to create a compilation result for this release
6210 /// config.
6211 #[derive(Clone, Default, PartialEq)]
6212 #[non_exhaustive]
6213 pub struct ScheduledReleaseRecord {
6214 /// Output only. The timestamp of this release attempt.
6215 pub release_time: std::option::Option<wkt::Timestamp>,
6216
6217 /// The result of this release attempt.
6218 pub result:
6219 std::option::Option<crate::model::release_config::scheduled_release_record::Result>,
6220
6221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6222 }
6223
6224 impl ScheduledReleaseRecord {
6225 /// Creates a new default instance.
6226 pub fn new() -> Self {
6227 std::default::Default::default()
6228 }
6229
6230 /// Sets the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
6231 ///
6232 /// # Example
6233 /// ```ignore,no_run
6234 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6235 /// use wkt::Timestamp;
6236 /// let x = ScheduledReleaseRecord::new().set_release_time(Timestamp::default()/* use setters */);
6237 /// ```
6238 pub fn set_release_time<T>(mut self, v: T) -> Self
6239 where
6240 T: std::convert::Into<wkt::Timestamp>,
6241 {
6242 self.release_time = std::option::Option::Some(v.into());
6243 self
6244 }
6245
6246 /// Sets or clears the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
6247 ///
6248 /// # Example
6249 /// ```ignore,no_run
6250 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6251 /// use wkt::Timestamp;
6252 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(Some(Timestamp::default()/* use setters */));
6253 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(None::<Timestamp>);
6254 /// ```
6255 pub fn set_or_clear_release_time<T>(mut self, v: std::option::Option<T>) -> Self
6256 where
6257 T: std::convert::Into<wkt::Timestamp>,
6258 {
6259 self.release_time = v.map(|x| x.into());
6260 self
6261 }
6262
6263 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result].
6264 ///
6265 /// Note that all the setters affecting `result` are mutually
6266 /// exclusive.
6267 ///
6268 /// # Example
6269 /// ```ignore,no_run
6270 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6271 /// use google_cloud_dataform_v1::model::release_config::scheduled_release_record::Result;
6272 /// let x = ScheduledReleaseRecord::new().set_result(Some(Result::CompilationResult("example".to_string())));
6273 /// ```
6274 pub fn set_result<
6275 T: std::convert::Into<
6276 std::option::Option<
6277 crate::model::release_config::scheduled_release_record::Result,
6278 >,
6279 >,
6280 >(
6281 mut self,
6282 v: T,
6283 ) -> Self {
6284 self.result = v.into();
6285 self
6286 }
6287
6288 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6289 /// if it holds a `CompilationResult`, `None` if the field is not set or
6290 /// holds a different branch.
6291 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
6292 #[allow(unreachable_patterns)]
6293 self.result.as_ref().and_then(|v| match v {
6294 crate::model::release_config::scheduled_release_record::Result::CompilationResult(v) => std::option::Option::Some(v),
6295 _ => std::option::Option::None,
6296 })
6297 }
6298
6299 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6300 /// to hold a `CompilationResult`.
6301 ///
6302 /// Note that all the setters affecting `result` are
6303 /// mutually exclusive.
6304 ///
6305 /// # Example
6306 /// ```ignore,no_run
6307 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6308 /// # let project_id = "project_id";
6309 /// # let location_id = "location_id";
6310 /// # let repository_id = "repository_id";
6311 /// # let compilation_result_id = "compilation_result_id";
6312 /// let x = ScheduledReleaseRecord::new().set_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
6313 /// assert!(x.compilation_result().is_some());
6314 /// assert!(x.error_status().is_none());
6315 /// ```
6316 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
6317 mut self,
6318 v: T,
6319 ) -> Self {
6320 self.result = std::option::Option::Some(
6321 crate::model::release_config::scheduled_release_record::Result::CompilationResult(
6322 v.into(),
6323 ),
6324 );
6325 self
6326 }
6327
6328 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6329 /// if it holds a `ErrorStatus`, `None` if the field is not set or
6330 /// holds a different branch.
6331 pub fn error_status(
6332 &self,
6333 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
6334 #[allow(unreachable_patterns)]
6335 self.result.as_ref().and_then(|v| match v {
6336 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(v) => {
6337 std::option::Option::Some(v)
6338 }
6339 _ => std::option::Option::None,
6340 })
6341 }
6342
6343 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6344 /// to hold a `ErrorStatus`.
6345 ///
6346 /// Note that all the setters affecting `result` are
6347 /// mutually exclusive.
6348 ///
6349 /// # Example
6350 /// ```ignore,no_run
6351 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6352 /// use google_cloud_rpc::model::Status;
6353 /// let x = ScheduledReleaseRecord::new().set_error_status(Status::default()/* use setters */);
6354 /// assert!(x.error_status().is_some());
6355 /// assert!(x.compilation_result().is_none());
6356 /// ```
6357 pub fn set_error_status<
6358 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6359 >(
6360 mut self,
6361 v: T,
6362 ) -> Self {
6363 self.result = std::option::Option::Some(
6364 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(
6365 v.into(),
6366 ),
6367 );
6368 self
6369 }
6370 }
6371
6372 impl wkt::message::Message for ScheduledReleaseRecord {
6373 fn typename() -> &'static str {
6374 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig.ScheduledReleaseRecord"
6375 }
6376 }
6377
6378 /// Defines additional types related to [ScheduledReleaseRecord].
6379 pub mod scheduled_release_record {
6380 #[allow(unused_imports)]
6381 use super::*;
6382
6383 /// The result of this release attempt.
6384 #[derive(Clone, Debug, PartialEq)]
6385 #[non_exhaustive]
6386 pub enum Result {
6387 /// The name of the created compilation result, if one was successfully
6388 /// created. Must be in the format
6389 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
6390 CompilationResult(std::string::String),
6391 /// The error status encountered upon this attempt to create the
6392 /// compilation result, if the attempt was unsuccessful.
6393 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
6394 }
6395 }
6396}
6397
6398/// `ListReleaseConfigs` request message.
6399#[derive(Clone, Default, PartialEq)]
6400#[non_exhaustive]
6401pub struct ListReleaseConfigsRequest {
6402 /// Required. The repository in which to list release configs. Must be in the
6403 /// format `projects/*/locations/*/repositories/*`.
6404 pub parent: std::string::String,
6405
6406 /// Optional. Maximum number of release configs to return. The server may
6407 /// return fewer items than requested. If unspecified, the server will pick an
6408 /// appropriate default.
6409 pub page_size: i32,
6410
6411 /// Optional. Page token received from a previous `ListReleaseConfigs` call.
6412 /// Provide this to retrieve the subsequent page.
6413 ///
6414 /// When paginating, all other parameters provided to `ListReleaseConfigs`,
6415 /// with the exception of `page_size`, must match the call that provided the
6416 /// page token.
6417 pub page_token: std::string::String,
6418
6419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6420}
6421
6422impl ListReleaseConfigsRequest {
6423 /// Creates a new default instance.
6424 pub fn new() -> Self {
6425 std::default::Default::default()
6426 }
6427
6428 /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
6429 ///
6430 /// # Example
6431 /// ```ignore,no_run
6432 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6433 /// # let project_id = "project_id";
6434 /// # let location_id = "location_id";
6435 /// # let repository_id = "repository_id";
6436 /// let x = ListReleaseConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6437 /// ```
6438 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439 self.parent = v.into();
6440 self
6441 }
6442
6443 /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
6444 ///
6445 /// # Example
6446 /// ```ignore,no_run
6447 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6448 /// let x = ListReleaseConfigsRequest::new().set_page_size(42);
6449 /// ```
6450 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6451 self.page_size = v.into();
6452 self
6453 }
6454
6455 /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
6456 ///
6457 /// # Example
6458 /// ```ignore,no_run
6459 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6460 /// let x = ListReleaseConfigsRequest::new().set_page_token("example");
6461 /// ```
6462 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6463 self.page_token = v.into();
6464 self
6465 }
6466}
6467
6468impl wkt::message::Message for ListReleaseConfigsRequest {
6469 fn typename() -> &'static str {
6470 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsRequest"
6471 }
6472}
6473
6474/// `ListReleaseConfigs` response message.
6475#[derive(Clone, Default, PartialEq)]
6476#[non_exhaustive]
6477pub struct ListReleaseConfigsResponse {
6478 /// List of release configs.
6479 pub release_configs: std::vec::Vec<crate::model::ReleaseConfig>,
6480
6481 /// A token, which can be sent as `page_token` to retrieve the next page.
6482 /// If this field is omitted, there are no subsequent pages.
6483 pub next_page_token: std::string::String,
6484
6485 /// Locations which could not be reached.
6486 pub unreachable: std::vec::Vec<std::string::String>,
6487
6488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6489}
6490
6491impl ListReleaseConfigsResponse {
6492 /// Creates a new default instance.
6493 pub fn new() -> Self {
6494 std::default::Default::default()
6495 }
6496
6497 /// Sets the value of [release_configs][crate::model::ListReleaseConfigsResponse::release_configs].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6502 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6503 /// let x = ListReleaseConfigsResponse::new()
6504 /// .set_release_configs([
6505 /// ReleaseConfig::default()/* use setters */,
6506 /// ReleaseConfig::default()/* use (different) setters */,
6507 /// ]);
6508 /// ```
6509 pub fn set_release_configs<T, V>(mut self, v: T) -> Self
6510 where
6511 T: std::iter::IntoIterator<Item = V>,
6512 V: std::convert::Into<crate::model::ReleaseConfig>,
6513 {
6514 use std::iter::Iterator;
6515 self.release_configs = v.into_iter().map(|i| i.into()).collect();
6516 self
6517 }
6518
6519 /// Sets the value of [next_page_token][crate::model::ListReleaseConfigsResponse::next_page_token].
6520 ///
6521 /// # Example
6522 /// ```ignore,no_run
6523 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6524 /// let x = ListReleaseConfigsResponse::new().set_next_page_token("example");
6525 /// ```
6526 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6527 self.next_page_token = v.into();
6528 self
6529 }
6530
6531 /// Sets the value of [unreachable][crate::model::ListReleaseConfigsResponse::unreachable].
6532 ///
6533 /// # Example
6534 /// ```ignore,no_run
6535 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6536 /// let x = ListReleaseConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6537 /// ```
6538 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6539 where
6540 T: std::iter::IntoIterator<Item = V>,
6541 V: std::convert::Into<std::string::String>,
6542 {
6543 use std::iter::Iterator;
6544 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6545 self
6546 }
6547}
6548
6549impl wkt::message::Message for ListReleaseConfigsResponse {
6550 fn typename() -> &'static str {
6551 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsResponse"
6552 }
6553}
6554
6555#[doc(hidden)]
6556impl google_cloud_gax::paginator::internal::PageableResponse for ListReleaseConfigsResponse {
6557 type PageItem = crate::model::ReleaseConfig;
6558
6559 fn items(self) -> std::vec::Vec<Self::PageItem> {
6560 self.release_configs
6561 }
6562
6563 fn next_page_token(&self) -> std::string::String {
6564 use std::clone::Clone;
6565 self.next_page_token.clone()
6566 }
6567}
6568
6569/// `GetReleaseConfig` request message.
6570#[derive(Clone, Default, PartialEq)]
6571#[non_exhaustive]
6572pub struct GetReleaseConfigRequest {
6573 /// Required. The release config's name.
6574 pub name: std::string::String,
6575
6576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6577}
6578
6579impl GetReleaseConfigRequest {
6580 /// Creates a new default instance.
6581 pub fn new() -> Self {
6582 std::default::Default::default()
6583 }
6584
6585 /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
6586 ///
6587 /// # Example
6588 /// ```ignore,no_run
6589 /// # use google_cloud_dataform_v1::model::GetReleaseConfigRequest;
6590 /// # let project_id = "project_id";
6591 /// # let location_id = "location_id";
6592 /// # let repository_id = "repository_id";
6593 /// # let release_config_id = "release_config_id";
6594 /// let x = GetReleaseConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6595 /// ```
6596 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6597 self.name = v.into();
6598 self
6599 }
6600}
6601
6602impl wkt::message::Message for GetReleaseConfigRequest {
6603 fn typename() -> &'static str {
6604 "type.googleapis.com/google.cloud.dataform.v1.GetReleaseConfigRequest"
6605 }
6606}
6607
6608/// `CreateReleaseConfig` request message.
6609#[derive(Clone, Default, PartialEq)]
6610#[non_exhaustive]
6611pub struct CreateReleaseConfigRequest {
6612 /// Required. The repository in which to create the release config. Must be in
6613 /// the format `projects/*/locations/*/repositories/*`.
6614 pub parent: std::string::String,
6615
6616 /// Required. The release config to create.
6617 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6618
6619 /// Required. The ID to use for the release config, which will become the final
6620 /// component of the release config's resource name.
6621 pub release_config_id: std::string::String,
6622
6623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6624}
6625
6626impl CreateReleaseConfigRequest {
6627 /// Creates a new default instance.
6628 pub fn new() -> Self {
6629 std::default::Default::default()
6630 }
6631
6632 /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
6633 ///
6634 /// # Example
6635 /// ```ignore,no_run
6636 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6637 /// # let project_id = "project_id";
6638 /// # let location_id = "location_id";
6639 /// # let repository_id = "repository_id";
6640 /// let x = CreateReleaseConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6641 /// ```
6642 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643 self.parent = v.into();
6644 self
6645 }
6646
6647 /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6648 ///
6649 /// # Example
6650 /// ```ignore,no_run
6651 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6652 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6653 /// let x = CreateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6654 /// ```
6655 pub fn set_release_config<T>(mut self, v: T) -> Self
6656 where
6657 T: std::convert::Into<crate::model::ReleaseConfig>,
6658 {
6659 self.release_config = std::option::Option::Some(v.into());
6660 self
6661 }
6662
6663 /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6664 ///
6665 /// # Example
6666 /// ```ignore,no_run
6667 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6668 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6669 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6670 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6671 /// ```
6672 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6673 where
6674 T: std::convert::Into<crate::model::ReleaseConfig>,
6675 {
6676 self.release_config = v.map(|x| x.into());
6677 self
6678 }
6679
6680 /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
6681 ///
6682 /// # Example
6683 /// ```ignore,no_run
6684 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6685 /// let x = CreateReleaseConfigRequest::new().set_release_config_id("example");
6686 /// ```
6687 pub fn set_release_config_id<T: std::convert::Into<std::string::String>>(
6688 mut self,
6689 v: T,
6690 ) -> Self {
6691 self.release_config_id = v.into();
6692 self
6693 }
6694}
6695
6696impl wkt::message::Message for CreateReleaseConfigRequest {
6697 fn typename() -> &'static str {
6698 "type.googleapis.com/google.cloud.dataform.v1.CreateReleaseConfigRequest"
6699 }
6700}
6701
6702/// `UpdateReleaseConfig` request message.
6703#[derive(Clone, Default, PartialEq)]
6704#[non_exhaustive]
6705pub struct UpdateReleaseConfigRequest {
6706 /// Optional. Specifies the fields to be updated in the release config. If left
6707 /// unset, all fields will be updated.
6708 pub update_mask: std::option::Option<wkt::FieldMask>,
6709
6710 /// Required. The release config to update.
6711 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6712
6713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6714}
6715
6716impl UpdateReleaseConfigRequest {
6717 /// Creates a new default instance.
6718 pub fn new() -> Self {
6719 std::default::Default::default()
6720 }
6721
6722 /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6723 ///
6724 /// # Example
6725 /// ```ignore,no_run
6726 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6727 /// use wkt::FieldMask;
6728 /// let x = UpdateReleaseConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6729 /// ```
6730 pub fn set_update_mask<T>(mut self, v: T) -> Self
6731 where
6732 T: std::convert::Into<wkt::FieldMask>,
6733 {
6734 self.update_mask = std::option::Option::Some(v.into());
6735 self
6736 }
6737
6738 /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6739 ///
6740 /// # Example
6741 /// ```ignore,no_run
6742 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6743 /// use wkt::FieldMask;
6744 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6745 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6746 /// ```
6747 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6748 where
6749 T: std::convert::Into<wkt::FieldMask>,
6750 {
6751 self.update_mask = v.map(|x| x.into());
6752 self
6753 }
6754
6755 /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6756 ///
6757 /// # Example
6758 /// ```ignore,no_run
6759 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6760 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6761 /// let x = UpdateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6762 /// ```
6763 pub fn set_release_config<T>(mut self, v: T) -> Self
6764 where
6765 T: std::convert::Into<crate::model::ReleaseConfig>,
6766 {
6767 self.release_config = std::option::Option::Some(v.into());
6768 self
6769 }
6770
6771 /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6772 ///
6773 /// # Example
6774 /// ```ignore,no_run
6775 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6776 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6777 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6778 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6779 /// ```
6780 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6781 where
6782 T: std::convert::Into<crate::model::ReleaseConfig>,
6783 {
6784 self.release_config = v.map(|x| x.into());
6785 self
6786 }
6787}
6788
6789impl wkt::message::Message for UpdateReleaseConfigRequest {
6790 fn typename() -> &'static str {
6791 "type.googleapis.com/google.cloud.dataform.v1.UpdateReleaseConfigRequest"
6792 }
6793}
6794
6795/// `DeleteReleaseConfig` request message.
6796#[derive(Clone, Default, PartialEq)]
6797#[non_exhaustive]
6798pub struct DeleteReleaseConfigRequest {
6799 /// Required. The release config's name.
6800 pub name: std::string::String,
6801
6802 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6803}
6804
6805impl DeleteReleaseConfigRequest {
6806 /// Creates a new default instance.
6807 pub fn new() -> Self {
6808 std::default::Default::default()
6809 }
6810
6811 /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
6812 ///
6813 /// # Example
6814 /// ```ignore,no_run
6815 /// # use google_cloud_dataform_v1::model::DeleteReleaseConfigRequest;
6816 /// # let project_id = "project_id";
6817 /// # let location_id = "location_id";
6818 /// # let repository_id = "repository_id";
6819 /// # let release_config_id = "release_config_id";
6820 /// let x = DeleteReleaseConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6821 /// ```
6822 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6823 self.name = v.into();
6824 self
6825 }
6826}
6827
6828impl wkt::message::Message for DeleteReleaseConfigRequest {
6829 fn typename() -> &'static str {
6830 "type.googleapis.com/google.cloud.dataform.v1.DeleteReleaseConfigRequest"
6831 }
6832}
6833
6834/// Represents the result of compiling a Dataform project.
6835#[derive(Clone, Default, PartialEq)]
6836#[non_exhaustive]
6837pub struct CompilationResult {
6838 /// Output only. The compilation result's name.
6839 pub name: std::string::String,
6840
6841 /// Immutable. If set, fields of `code_compilation_config` override the default
6842 /// compilation settings that are specified in dataform.json.
6843 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
6844
6845 /// Output only. The fully resolved Git commit SHA of the code that was
6846 /// compiled. Not set for compilation results whose source is a workspace.
6847 pub resolved_git_commit_sha: std::string::String,
6848
6849 /// Output only. The version of `@dataform/core` that was used for compilation.
6850 pub dataform_core_version: std::string::String,
6851
6852 /// Output only. Errors encountered during project compilation.
6853 pub compilation_errors: std::vec::Vec<crate::model::compilation_result::CompilationError>,
6854
6855 /// Output only. Only set if the repository has a KMS Key.
6856 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
6857
6858 /// Output only. The timestamp of when the compilation result was created.
6859 pub create_time: std::option::Option<wkt::Timestamp>,
6860
6861 /// Output only. All the metadata information that is used internally to serve
6862 /// the resource. For example: timestamps, flags, status fields, etc. The
6863 /// format of this field is a JSON string.
6864 pub internal_metadata: std::option::Option<std::string::String>,
6865
6866 /// Output only. Metadata indicating whether this resource is user-scoped.
6867 /// `CompilationResult` resource is `user_scoped` only if it is sourced
6868 /// from a workspace.
6869 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
6870
6871 /// Output only. Metadata about the repository snapshot used by scheduled
6872 /// notebooks.
6873 pub gcs_repository_snapshot_metadata:
6874 std::option::Option<crate::model::GcsRepositorySnapshotMetadata>,
6875
6876 /// The source of the compilation result.
6877 pub source: std::option::Option<crate::model::compilation_result::Source>,
6878
6879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6880}
6881
6882impl CompilationResult {
6883 /// Creates a new default instance.
6884 pub fn new() -> Self {
6885 std::default::Default::default()
6886 }
6887
6888 /// Sets the value of [name][crate::model::CompilationResult::name].
6889 ///
6890 /// # Example
6891 /// ```ignore,no_run
6892 /// # use google_cloud_dataform_v1::model::CompilationResult;
6893 /// # let project_id = "project_id";
6894 /// # let location_id = "location_id";
6895 /// # let repository_id = "repository_id";
6896 /// # let compilation_result_id = "compilation_result_id";
6897 /// let x = CompilationResult::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
6898 /// ```
6899 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6900 self.name = v.into();
6901 self
6902 }
6903
6904 /// Sets the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
6905 ///
6906 /// # Example
6907 /// ```ignore,no_run
6908 /// # use google_cloud_dataform_v1::model::CompilationResult;
6909 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6910 /// let x = CompilationResult::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
6911 /// ```
6912 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
6913 where
6914 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6915 {
6916 self.code_compilation_config = std::option::Option::Some(v.into());
6917 self
6918 }
6919
6920 /// Sets or clears the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
6921 ///
6922 /// # Example
6923 /// ```ignore,no_run
6924 /// # use google_cloud_dataform_v1::model::CompilationResult;
6925 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6926 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
6927 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
6928 /// ```
6929 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
6930 where
6931 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6932 {
6933 self.code_compilation_config = v.map(|x| x.into());
6934 self
6935 }
6936
6937 /// Sets the value of [resolved_git_commit_sha][crate::model::CompilationResult::resolved_git_commit_sha].
6938 ///
6939 /// # Example
6940 /// ```ignore,no_run
6941 /// # use google_cloud_dataform_v1::model::CompilationResult;
6942 /// let x = CompilationResult::new().set_resolved_git_commit_sha("example");
6943 /// ```
6944 pub fn set_resolved_git_commit_sha<T: std::convert::Into<std::string::String>>(
6945 mut self,
6946 v: T,
6947 ) -> Self {
6948 self.resolved_git_commit_sha = v.into();
6949 self
6950 }
6951
6952 /// Sets the value of [dataform_core_version][crate::model::CompilationResult::dataform_core_version].
6953 ///
6954 /// # Example
6955 /// ```ignore,no_run
6956 /// # use google_cloud_dataform_v1::model::CompilationResult;
6957 /// let x = CompilationResult::new().set_dataform_core_version("example");
6958 /// ```
6959 pub fn set_dataform_core_version<T: std::convert::Into<std::string::String>>(
6960 mut self,
6961 v: T,
6962 ) -> Self {
6963 self.dataform_core_version = v.into();
6964 self
6965 }
6966
6967 /// Sets the value of [compilation_errors][crate::model::CompilationResult::compilation_errors].
6968 ///
6969 /// # Example
6970 /// ```ignore,no_run
6971 /// # use google_cloud_dataform_v1::model::CompilationResult;
6972 /// use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6973 /// let x = CompilationResult::new()
6974 /// .set_compilation_errors([
6975 /// CompilationError::default()/* use setters */,
6976 /// CompilationError::default()/* use (different) setters */,
6977 /// ]);
6978 /// ```
6979 pub fn set_compilation_errors<T, V>(mut self, v: T) -> Self
6980 where
6981 T: std::iter::IntoIterator<Item = V>,
6982 V: std::convert::Into<crate::model::compilation_result::CompilationError>,
6983 {
6984 use std::iter::Iterator;
6985 self.compilation_errors = v.into_iter().map(|i| i.into()).collect();
6986 self
6987 }
6988
6989 /// Sets the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
6990 ///
6991 /// # Example
6992 /// ```ignore,no_run
6993 /// # use google_cloud_dataform_v1::model::CompilationResult;
6994 /// use google_cloud_dataform_v1::model::DataEncryptionState;
6995 /// let x = CompilationResult::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
6996 /// ```
6997 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
6998 where
6999 T: std::convert::Into<crate::model::DataEncryptionState>,
7000 {
7001 self.data_encryption_state = std::option::Option::Some(v.into());
7002 self
7003 }
7004
7005 /// Sets or clears the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
7006 ///
7007 /// # Example
7008 /// ```ignore,no_run
7009 /// # use google_cloud_dataform_v1::model::CompilationResult;
7010 /// use google_cloud_dataform_v1::model::DataEncryptionState;
7011 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
7012 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
7013 /// ```
7014 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
7015 where
7016 T: std::convert::Into<crate::model::DataEncryptionState>,
7017 {
7018 self.data_encryption_state = v.map(|x| x.into());
7019 self
7020 }
7021
7022 /// Sets the value of [create_time][crate::model::CompilationResult::create_time].
7023 ///
7024 /// # Example
7025 /// ```ignore,no_run
7026 /// # use google_cloud_dataform_v1::model::CompilationResult;
7027 /// use wkt::Timestamp;
7028 /// let x = CompilationResult::new().set_create_time(Timestamp::default()/* use setters */);
7029 /// ```
7030 pub fn set_create_time<T>(mut self, v: T) -> Self
7031 where
7032 T: std::convert::Into<wkt::Timestamp>,
7033 {
7034 self.create_time = std::option::Option::Some(v.into());
7035 self
7036 }
7037
7038 /// Sets or clears the value of [create_time][crate::model::CompilationResult::create_time].
7039 ///
7040 /// # Example
7041 /// ```ignore,no_run
7042 /// # use google_cloud_dataform_v1::model::CompilationResult;
7043 /// use wkt::Timestamp;
7044 /// let x = CompilationResult::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7045 /// let x = CompilationResult::new().set_or_clear_create_time(None::<Timestamp>);
7046 /// ```
7047 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7048 where
7049 T: std::convert::Into<wkt::Timestamp>,
7050 {
7051 self.create_time = v.map(|x| x.into());
7052 self
7053 }
7054
7055 /// Sets the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
7056 ///
7057 /// # Example
7058 /// ```ignore,no_run
7059 /// # use google_cloud_dataform_v1::model::CompilationResult;
7060 /// let x = CompilationResult::new().set_internal_metadata("example");
7061 /// ```
7062 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
7063 where
7064 T: std::convert::Into<std::string::String>,
7065 {
7066 self.internal_metadata = std::option::Option::Some(v.into());
7067 self
7068 }
7069
7070 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
7071 ///
7072 /// # Example
7073 /// ```ignore,no_run
7074 /// # use google_cloud_dataform_v1::model::CompilationResult;
7075 /// let x = CompilationResult::new().set_or_clear_internal_metadata(Some("example"));
7076 /// let x = CompilationResult::new().set_or_clear_internal_metadata(None::<String>);
7077 /// ```
7078 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
7079 where
7080 T: std::convert::Into<std::string::String>,
7081 {
7082 self.internal_metadata = v.map(|x| x.into());
7083 self
7084 }
7085
7086 /// Sets the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_dataform_v1::model::CompilationResult;
7091 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
7092 /// let x = CompilationResult::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
7093 /// ```
7094 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
7095 where
7096 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
7097 {
7098 self.private_resource_metadata = std::option::Option::Some(v.into());
7099 self
7100 }
7101
7102 /// Sets or clears the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
7103 ///
7104 /// # Example
7105 /// ```ignore,no_run
7106 /// # use google_cloud_dataform_v1::model::CompilationResult;
7107 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
7108 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
7109 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
7110 /// ```
7111 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
7112 where
7113 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
7114 {
7115 self.private_resource_metadata = v.map(|x| x.into());
7116 self
7117 }
7118
7119 /// Sets the value of [gcs_repository_snapshot_metadata][crate::model::CompilationResult::gcs_repository_snapshot_metadata].
7120 ///
7121 /// # Example
7122 /// ```ignore,no_run
7123 /// # use google_cloud_dataform_v1::model::CompilationResult;
7124 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7125 /// let x = CompilationResult::new().set_gcs_repository_snapshot_metadata(GcsRepositorySnapshotMetadata::default()/* use setters */);
7126 /// ```
7127 pub fn set_gcs_repository_snapshot_metadata<T>(mut self, v: T) -> Self
7128 where
7129 T: std::convert::Into<crate::model::GcsRepositorySnapshotMetadata>,
7130 {
7131 self.gcs_repository_snapshot_metadata = std::option::Option::Some(v.into());
7132 self
7133 }
7134
7135 /// Sets or clears the value of [gcs_repository_snapshot_metadata][crate::model::CompilationResult::gcs_repository_snapshot_metadata].
7136 ///
7137 /// # Example
7138 /// ```ignore,no_run
7139 /// # use google_cloud_dataform_v1::model::CompilationResult;
7140 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7141 /// let x = CompilationResult::new().set_or_clear_gcs_repository_snapshot_metadata(Some(GcsRepositorySnapshotMetadata::default()/* use setters */));
7142 /// let x = CompilationResult::new().set_or_clear_gcs_repository_snapshot_metadata(None::<GcsRepositorySnapshotMetadata>);
7143 /// ```
7144 pub fn set_or_clear_gcs_repository_snapshot_metadata<T>(
7145 mut self,
7146 v: std::option::Option<T>,
7147 ) -> Self
7148 where
7149 T: std::convert::Into<crate::model::GcsRepositorySnapshotMetadata>,
7150 {
7151 self.gcs_repository_snapshot_metadata = v.map(|x| x.into());
7152 self
7153 }
7154
7155 /// Sets the value of [source][crate::model::CompilationResult::source].
7156 ///
7157 /// Note that all the setters affecting `source` are mutually
7158 /// exclusive.
7159 ///
7160 /// # Example
7161 /// ```ignore,no_run
7162 /// # use google_cloud_dataform_v1::model::CompilationResult;
7163 /// use google_cloud_dataform_v1::model::compilation_result::Source;
7164 /// let x = CompilationResult::new().set_source(Some(Source::GitCommitish("example".to_string())));
7165 /// ```
7166 pub fn set_source<
7167 T: std::convert::Into<std::option::Option<crate::model::compilation_result::Source>>,
7168 >(
7169 mut self,
7170 v: T,
7171 ) -> Self {
7172 self.source = v.into();
7173 self
7174 }
7175
7176 /// The value of [source][crate::model::CompilationResult::source]
7177 /// if it holds a `GitCommitish`, `None` if the field is not set or
7178 /// holds a different branch.
7179 pub fn git_commitish(&self) -> std::option::Option<&std::string::String> {
7180 #[allow(unreachable_patterns)]
7181 self.source.as_ref().and_then(|v| match v {
7182 crate::model::compilation_result::Source::GitCommitish(v) => {
7183 std::option::Option::Some(v)
7184 }
7185 _ => std::option::Option::None,
7186 })
7187 }
7188
7189 /// Sets the value of [source][crate::model::CompilationResult::source]
7190 /// to hold a `GitCommitish`.
7191 ///
7192 /// Note that all the setters affecting `source` are
7193 /// mutually exclusive.
7194 ///
7195 /// # Example
7196 /// ```ignore,no_run
7197 /// # use google_cloud_dataform_v1::model::CompilationResult;
7198 /// let x = CompilationResult::new().set_git_commitish("example");
7199 /// assert!(x.git_commitish().is_some());
7200 /// assert!(x.workspace().is_none());
7201 /// assert!(x.release_config().is_none());
7202 /// ```
7203 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7204 self.source = std::option::Option::Some(
7205 crate::model::compilation_result::Source::GitCommitish(v.into()),
7206 );
7207 self
7208 }
7209
7210 /// The value of [source][crate::model::CompilationResult::source]
7211 /// if it holds a `Workspace`, `None` if the field is not set or
7212 /// holds a different branch.
7213 pub fn workspace(&self) -> std::option::Option<&std::string::String> {
7214 #[allow(unreachable_patterns)]
7215 self.source.as_ref().and_then(|v| match v {
7216 crate::model::compilation_result::Source::Workspace(v) => std::option::Option::Some(v),
7217 _ => std::option::Option::None,
7218 })
7219 }
7220
7221 /// Sets the value of [source][crate::model::CompilationResult::source]
7222 /// to hold a `Workspace`.
7223 ///
7224 /// Note that all the setters affecting `source` are
7225 /// mutually exclusive.
7226 ///
7227 /// # Example
7228 /// ```ignore,no_run
7229 /// # use google_cloud_dataform_v1::model::CompilationResult;
7230 /// # let project_id = "project_id";
7231 /// # let location_id = "location_id";
7232 /// # let repository_id = "repository_id";
7233 /// # let workspace_id = "workspace_id";
7234 /// let x = CompilationResult::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
7235 /// assert!(x.workspace().is_some());
7236 /// assert!(x.git_commitish().is_none());
7237 /// assert!(x.release_config().is_none());
7238 /// ```
7239 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7240 self.source = std::option::Option::Some(
7241 crate::model::compilation_result::Source::Workspace(v.into()),
7242 );
7243 self
7244 }
7245
7246 /// The value of [source][crate::model::CompilationResult::source]
7247 /// if it holds a `ReleaseConfig`, `None` if the field is not set or
7248 /// holds a different branch.
7249 pub fn release_config(&self) -> std::option::Option<&std::string::String> {
7250 #[allow(unreachable_patterns)]
7251 self.source.as_ref().and_then(|v| match v {
7252 crate::model::compilation_result::Source::ReleaseConfig(v) => {
7253 std::option::Option::Some(v)
7254 }
7255 _ => std::option::Option::None,
7256 })
7257 }
7258
7259 /// Sets the value of [source][crate::model::CompilationResult::source]
7260 /// to hold a `ReleaseConfig`.
7261 ///
7262 /// Note that all the setters affecting `source` are
7263 /// mutually exclusive.
7264 ///
7265 /// # Example
7266 /// ```ignore,no_run
7267 /// # use google_cloud_dataform_v1::model::CompilationResult;
7268 /// # let project_id = "project_id";
7269 /// # let location_id = "location_id";
7270 /// # let repository_id = "repository_id";
7271 /// # let release_config_id = "release_config_id";
7272 /// let x = CompilationResult::new().set_release_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
7273 /// assert!(x.release_config().is_some());
7274 /// assert!(x.git_commitish().is_none());
7275 /// assert!(x.workspace().is_none());
7276 /// ```
7277 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7278 self.source = std::option::Option::Some(
7279 crate::model::compilation_result::Source::ReleaseConfig(v.into()),
7280 );
7281 self
7282 }
7283}
7284
7285impl wkt::message::Message for CompilationResult {
7286 fn typename() -> &'static str {
7287 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult"
7288 }
7289}
7290
7291/// Defines additional types related to [CompilationResult].
7292pub mod compilation_result {
7293 #[allow(unused_imports)]
7294 use super::*;
7295
7296 /// An error encountered when attempting to compile a Dataform project.
7297 #[derive(Clone, Default, PartialEq)]
7298 #[non_exhaustive]
7299 pub struct CompilationError {
7300 /// Output only. The error's top level message.
7301 pub message: std::string::String,
7302
7303 /// Output only. The error's full stack trace.
7304 pub stack: std::string::String,
7305
7306 /// Output only. The path of the file where this error occurred, if
7307 /// available, relative to the project root.
7308 pub path: std::string::String,
7309
7310 /// Output only. The identifier of the action where this error occurred, if
7311 /// available.
7312 pub action_target: std::option::Option<crate::model::Target>,
7313
7314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7315 }
7316
7317 impl CompilationError {
7318 /// Creates a new default instance.
7319 pub fn new() -> Self {
7320 std::default::Default::default()
7321 }
7322
7323 /// Sets the value of [message][crate::model::compilation_result::CompilationError::message].
7324 ///
7325 /// # Example
7326 /// ```ignore,no_run
7327 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7328 /// let x = CompilationError::new().set_message("example");
7329 /// ```
7330 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7331 self.message = v.into();
7332 self
7333 }
7334
7335 /// Sets the value of [stack][crate::model::compilation_result::CompilationError::stack].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7340 /// let x = CompilationError::new().set_stack("example");
7341 /// ```
7342 pub fn set_stack<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7343 self.stack = v.into();
7344 self
7345 }
7346
7347 /// Sets the value of [path][crate::model::compilation_result::CompilationError::path].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7352 /// let x = CompilationError::new().set_path("example");
7353 /// ```
7354 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7355 self.path = v.into();
7356 self
7357 }
7358
7359 /// Sets the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
7360 ///
7361 /// # Example
7362 /// ```ignore,no_run
7363 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7364 /// use google_cloud_dataform_v1::model::Target;
7365 /// let x = CompilationError::new().set_action_target(Target::default()/* use setters */);
7366 /// ```
7367 pub fn set_action_target<T>(mut self, v: T) -> Self
7368 where
7369 T: std::convert::Into<crate::model::Target>,
7370 {
7371 self.action_target = std::option::Option::Some(v.into());
7372 self
7373 }
7374
7375 /// Sets or clears the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
7376 ///
7377 /// # Example
7378 /// ```ignore,no_run
7379 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7380 /// use google_cloud_dataform_v1::model::Target;
7381 /// let x = CompilationError::new().set_or_clear_action_target(Some(Target::default()/* use setters */));
7382 /// let x = CompilationError::new().set_or_clear_action_target(None::<Target>);
7383 /// ```
7384 pub fn set_or_clear_action_target<T>(mut self, v: std::option::Option<T>) -> Self
7385 where
7386 T: std::convert::Into<crate::model::Target>,
7387 {
7388 self.action_target = v.map(|x| x.into());
7389 self
7390 }
7391 }
7392
7393 impl wkt::message::Message for CompilationError {
7394 fn typename() -> &'static str {
7395 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult.CompilationError"
7396 }
7397 }
7398
7399 /// The source of the compilation result.
7400 #[derive(Clone, Debug, PartialEq)]
7401 #[non_exhaustive]
7402 pub enum Source {
7403 /// Immutable. Git commit/tag/branch name at which the repository should be
7404 /// compiled. Must exist in the remote repository. Examples:
7405 ///
7406 /// - a commit SHA: `12ade345`
7407 /// - a tag: `tag1`
7408 /// - a branch name: `branch1`
7409 GitCommitish(std::string::String),
7410 /// Immutable. The name of the workspace to compile. Must be in the format
7411 /// `projects/*/locations/*/repositories/*/workspaces/*`.
7412 Workspace(std::string::String),
7413 /// Immutable. The name of the release config to compile. Must be in the
7414 /// format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
7415 ReleaseConfig(std::string::String),
7416 }
7417}
7418
7419/// Configures various aspects of Dataform code compilation.
7420#[derive(Clone, Default, PartialEq)]
7421#[non_exhaustive]
7422pub struct CodeCompilationConfig {
7423 /// Optional. The default database (Google Cloud project ID).
7424 pub default_database: std::string::String,
7425
7426 /// Optional. The default schema (BigQuery dataset ID).
7427 pub default_schema: std::string::String,
7428
7429 /// Optional. The default BigQuery location to use. Defaults to "US".
7430 /// See the BigQuery docs for a full list of locations:
7431 /// <https://cloud.google.com/bigquery/docs/locations>.
7432 pub default_location: std::string::String,
7433
7434 /// Optional. The default schema (BigQuery dataset ID) for assertions.
7435 pub assertion_schema: std::string::String,
7436
7437 /// Optional. User-defined variables that are made available to project code
7438 /// during compilation.
7439 pub vars: std::collections::HashMap<std::string::String, std::string::String>,
7440
7441 /// Optional. The suffix that should be appended to all database (Google Cloud
7442 /// project ID) names.
7443 pub database_suffix: std::string::String,
7444
7445 /// Optional. The suffix that should be appended to all schema (BigQuery
7446 /// dataset ID) names.
7447 pub schema_suffix: std::string::String,
7448
7449 /// Optional. The prefix that should be prepended to all table names.
7450 pub table_prefix: std::string::String,
7451
7452 /// Optional. The prefix to prepend to built-in assertion names.
7453 pub builtin_assertion_name_prefix: std::string::String,
7454
7455 /// Optional. The default notebook runtime options.
7456 pub default_notebook_runtime_options: std::option::Option<crate::model::NotebookRuntimeOptions>,
7457
7458 /// Optional. The pipeline options which defines the pipeline type and path
7459 /// within the Git repository.
7460 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
7461
7462 /// Output only. Whether OpenLineage events are emitted for actions in this
7463 /// workflow. Reflects the `lineage.enabled` setting from
7464 /// `workflow_settings.yaml`.
7465 pub lineage_enabled: std::option::Option<bool>,
7466
7467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7468}
7469
7470impl CodeCompilationConfig {
7471 /// Creates a new default instance.
7472 pub fn new() -> Self {
7473 std::default::Default::default()
7474 }
7475
7476 /// Sets the value of [default_database][crate::model::CodeCompilationConfig::default_database].
7477 ///
7478 /// # Example
7479 /// ```ignore,no_run
7480 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7481 /// let x = CodeCompilationConfig::new().set_default_database("example");
7482 /// ```
7483 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
7484 mut self,
7485 v: T,
7486 ) -> Self {
7487 self.default_database = v.into();
7488 self
7489 }
7490
7491 /// Sets the value of [default_schema][crate::model::CodeCompilationConfig::default_schema].
7492 ///
7493 /// # Example
7494 /// ```ignore,no_run
7495 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7496 /// let x = CodeCompilationConfig::new().set_default_schema("example");
7497 /// ```
7498 pub fn set_default_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7499 self.default_schema = v.into();
7500 self
7501 }
7502
7503 /// Sets the value of [default_location][crate::model::CodeCompilationConfig::default_location].
7504 ///
7505 /// # Example
7506 /// ```ignore,no_run
7507 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7508 /// let x = CodeCompilationConfig::new().set_default_location("example");
7509 /// ```
7510 pub fn set_default_location<T: std::convert::Into<std::string::String>>(
7511 mut self,
7512 v: T,
7513 ) -> Self {
7514 self.default_location = v.into();
7515 self
7516 }
7517
7518 /// Sets the value of [assertion_schema][crate::model::CodeCompilationConfig::assertion_schema].
7519 ///
7520 /// # Example
7521 /// ```ignore,no_run
7522 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7523 /// let x = CodeCompilationConfig::new().set_assertion_schema("example");
7524 /// ```
7525 pub fn set_assertion_schema<T: std::convert::Into<std::string::String>>(
7526 mut self,
7527 v: T,
7528 ) -> Self {
7529 self.assertion_schema = v.into();
7530 self
7531 }
7532
7533 /// Sets the value of [vars][crate::model::CodeCompilationConfig::vars].
7534 ///
7535 /// # Example
7536 /// ```ignore,no_run
7537 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7538 /// let x = CodeCompilationConfig::new().set_vars([
7539 /// ("key0", "abc"),
7540 /// ("key1", "xyz"),
7541 /// ]);
7542 /// ```
7543 pub fn set_vars<T, K, V>(mut self, v: T) -> Self
7544 where
7545 T: std::iter::IntoIterator<Item = (K, V)>,
7546 K: std::convert::Into<std::string::String>,
7547 V: std::convert::Into<std::string::String>,
7548 {
7549 use std::iter::Iterator;
7550 self.vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7551 self
7552 }
7553
7554 /// Sets the value of [database_suffix][crate::model::CodeCompilationConfig::database_suffix].
7555 ///
7556 /// # Example
7557 /// ```ignore,no_run
7558 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7559 /// let x = CodeCompilationConfig::new().set_database_suffix("example");
7560 /// ```
7561 pub fn set_database_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7562 self.database_suffix = v.into();
7563 self
7564 }
7565
7566 /// Sets the value of [schema_suffix][crate::model::CodeCompilationConfig::schema_suffix].
7567 ///
7568 /// # Example
7569 /// ```ignore,no_run
7570 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7571 /// let x = CodeCompilationConfig::new().set_schema_suffix("example");
7572 /// ```
7573 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7574 self.schema_suffix = v.into();
7575 self
7576 }
7577
7578 /// Sets the value of [table_prefix][crate::model::CodeCompilationConfig::table_prefix].
7579 ///
7580 /// # Example
7581 /// ```ignore,no_run
7582 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7583 /// let x = CodeCompilationConfig::new().set_table_prefix("example");
7584 /// ```
7585 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7586 self.table_prefix = v.into();
7587 self
7588 }
7589
7590 /// Sets the value of [builtin_assertion_name_prefix][crate::model::CodeCompilationConfig::builtin_assertion_name_prefix].
7591 ///
7592 /// # Example
7593 /// ```ignore,no_run
7594 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7595 /// let x = CodeCompilationConfig::new().set_builtin_assertion_name_prefix("example");
7596 /// ```
7597 pub fn set_builtin_assertion_name_prefix<T: std::convert::Into<std::string::String>>(
7598 mut self,
7599 v: T,
7600 ) -> Self {
7601 self.builtin_assertion_name_prefix = v.into();
7602 self
7603 }
7604
7605 /// Sets the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7606 ///
7607 /// # Example
7608 /// ```ignore,no_run
7609 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7610 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7611 /// let x = CodeCompilationConfig::new().set_default_notebook_runtime_options(NotebookRuntimeOptions::default()/* use setters */);
7612 /// ```
7613 pub fn set_default_notebook_runtime_options<T>(mut self, v: T) -> Self
7614 where
7615 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7616 {
7617 self.default_notebook_runtime_options = std::option::Option::Some(v.into());
7618 self
7619 }
7620
7621 /// Sets or clears the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7622 ///
7623 /// # Example
7624 /// ```ignore,no_run
7625 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7626 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7627 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(Some(NotebookRuntimeOptions::default()/* use setters */));
7628 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(None::<NotebookRuntimeOptions>);
7629 /// ```
7630 pub fn set_or_clear_default_notebook_runtime_options<T>(
7631 mut self,
7632 v: std::option::Option<T>,
7633 ) -> Self
7634 where
7635 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7636 {
7637 self.default_notebook_runtime_options = v.map(|x| x.into());
7638 self
7639 }
7640
7641 /// Sets the value of [pipeline_config][crate::model::CodeCompilationConfig::pipeline_config].
7642 ///
7643 /// # Example
7644 /// ```ignore,no_run
7645 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7646 /// use google_cloud_dataform_v1::model::PipelineConfig;
7647 /// let x = CodeCompilationConfig::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
7648 /// ```
7649 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
7650 where
7651 T: std::convert::Into<crate::model::PipelineConfig>,
7652 {
7653 self.pipeline_config = std::option::Option::Some(v.into());
7654 self
7655 }
7656
7657 /// Sets or clears the value of [pipeline_config][crate::model::CodeCompilationConfig::pipeline_config].
7658 ///
7659 /// # Example
7660 /// ```ignore,no_run
7661 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7662 /// use google_cloud_dataform_v1::model::PipelineConfig;
7663 /// let x = CodeCompilationConfig::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
7664 /// let x = CodeCompilationConfig::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
7665 /// ```
7666 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
7667 where
7668 T: std::convert::Into<crate::model::PipelineConfig>,
7669 {
7670 self.pipeline_config = v.map(|x| x.into());
7671 self
7672 }
7673
7674 /// Sets the value of [lineage_enabled][crate::model::CodeCompilationConfig::lineage_enabled].
7675 ///
7676 /// # Example
7677 /// ```ignore,no_run
7678 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7679 /// let x = CodeCompilationConfig::new().set_lineage_enabled(true);
7680 /// ```
7681 pub fn set_lineage_enabled<T>(mut self, v: T) -> Self
7682 where
7683 T: std::convert::Into<bool>,
7684 {
7685 self.lineage_enabled = std::option::Option::Some(v.into());
7686 self
7687 }
7688
7689 /// Sets or clears the value of [lineage_enabled][crate::model::CodeCompilationConfig::lineage_enabled].
7690 ///
7691 /// # Example
7692 /// ```ignore,no_run
7693 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7694 /// let x = CodeCompilationConfig::new().set_or_clear_lineage_enabled(Some(false));
7695 /// let x = CodeCompilationConfig::new().set_or_clear_lineage_enabled(None::<bool>);
7696 /// ```
7697 pub fn set_or_clear_lineage_enabled<T>(mut self, v: std::option::Option<T>) -> Self
7698 where
7699 T: std::convert::Into<bool>,
7700 {
7701 self.lineage_enabled = v.map(|x| x.into());
7702 self
7703 }
7704}
7705
7706impl wkt::message::Message for CodeCompilationConfig {
7707 fn typename() -> &'static str {
7708 "type.googleapis.com/google.cloud.dataform.v1.CodeCompilationConfig"
7709 }
7710}
7711
7712/// Metadata about a repository snapshot stored in Google Cloud Storage.
7713#[derive(Clone, Default, PartialEq)]
7714#[non_exhaustive]
7715pub struct GcsRepositorySnapshotMetadata {
7716 /// Output only. The Google Cloud Storage URI of the repository snapshot.
7717 pub repository_snapshot_uri: std::string::String,
7718
7719 /// Output only. The crc32c checksum of the repository snapshot, big-endian
7720 /// base64 encoded.
7721 pub crc32c_checksum: std::string::String,
7722
7723 /// Output only. The generation number of the Cloud Storage object. See
7724 /// <https://cloud.google.com/storage/docs/metadata#generation-number>.
7725 pub generation: i64,
7726
7727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7728}
7729
7730impl GcsRepositorySnapshotMetadata {
7731 /// Creates a new default instance.
7732 pub fn new() -> Self {
7733 std::default::Default::default()
7734 }
7735
7736 /// Sets the value of [repository_snapshot_uri][crate::model::GcsRepositorySnapshotMetadata::repository_snapshot_uri].
7737 ///
7738 /// # Example
7739 /// ```ignore,no_run
7740 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7741 /// let x = GcsRepositorySnapshotMetadata::new().set_repository_snapshot_uri("example");
7742 /// ```
7743 pub fn set_repository_snapshot_uri<T: std::convert::Into<std::string::String>>(
7744 mut self,
7745 v: T,
7746 ) -> Self {
7747 self.repository_snapshot_uri = v.into();
7748 self
7749 }
7750
7751 /// Sets the value of [crc32c_checksum][crate::model::GcsRepositorySnapshotMetadata::crc32c_checksum].
7752 ///
7753 /// # Example
7754 /// ```ignore,no_run
7755 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7756 /// let x = GcsRepositorySnapshotMetadata::new().set_crc32c_checksum("example");
7757 /// ```
7758 pub fn set_crc32c_checksum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7759 self.crc32c_checksum = v.into();
7760 self
7761 }
7762
7763 /// Sets the value of [generation][crate::model::GcsRepositorySnapshotMetadata::generation].
7764 ///
7765 /// # Example
7766 /// ```ignore,no_run
7767 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7768 /// let x = GcsRepositorySnapshotMetadata::new().set_generation(42);
7769 /// ```
7770 pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7771 self.generation = v.into();
7772 self
7773 }
7774}
7775
7776impl wkt::message::Message for GcsRepositorySnapshotMetadata {
7777 fn typename() -> &'static str {
7778 "type.googleapis.com/google.cloud.dataform.v1.GcsRepositorySnapshotMetadata"
7779 }
7780}
7781
7782/// Configures the destination for a repository snapshot.
7783#[derive(Clone, Default, PartialEq)]
7784#[non_exhaustive]
7785pub struct GcsRepositorySnapshotDestination {
7786 /// Optional. The Google Cloud Storage destination to upload the repository
7787 /// snapshot to. Format: `gs://bucket-name/path/`.
7788 pub repository_snapshot_uri: std::string::String,
7789
7790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7791}
7792
7793impl GcsRepositorySnapshotDestination {
7794 /// Creates a new default instance.
7795 pub fn new() -> Self {
7796 std::default::Default::default()
7797 }
7798
7799 /// Sets the value of [repository_snapshot_uri][crate::model::GcsRepositorySnapshotDestination::repository_snapshot_uri].
7800 ///
7801 /// # Example
7802 /// ```ignore,no_run
7803 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
7804 /// let x = GcsRepositorySnapshotDestination::new().set_repository_snapshot_uri("example");
7805 /// ```
7806 pub fn set_repository_snapshot_uri<T: std::convert::Into<std::string::String>>(
7807 mut self,
7808 v: T,
7809 ) -> Self {
7810 self.repository_snapshot_uri = v.into();
7811 self
7812 }
7813}
7814
7815impl wkt::message::Message for GcsRepositorySnapshotDestination {
7816 fn typename() -> &'static str {
7817 "type.googleapis.com/google.cloud.dataform.v1.GcsRepositorySnapshotDestination"
7818 }
7819}
7820
7821/// Configures various aspects of Dataform notebook runtime.
7822#[derive(Clone, Default, PartialEq)]
7823#[non_exhaustive]
7824pub struct NotebookRuntimeOptions {
7825 /// Optional. The resource name of the [Colab runtime template]
7826 /// (<https://cloud.google.com/colab/docs/runtimes>), from which a runtime is
7827 /// created for notebook executions. If not specified, a runtime is created
7828 /// with Colab's default specifications.
7829 pub ai_platform_notebook_runtime_template: std::string::String,
7830
7831 /// The location to store the notebook execution result.
7832 pub execution_sink: std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
7833
7834 /// The destination of the snapshot of repository files to be available for
7835 /// read-only access inside a notebook runtime
7836 pub repository_snapshot_storage:
7837 std::option::Option<crate::model::notebook_runtime_options::RepositorySnapshotStorage>,
7838
7839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7840}
7841
7842impl NotebookRuntimeOptions {
7843 /// Creates a new default instance.
7844 pub fn new() -> Self {
7845 std::default::Default::default()
7846 }
7847
7848 /// Sets the value of [ai_platform_notebook_runtime_template][crate::model::NotebookRuntimeOptions::ai_platform_notebook_runtime_template].
7849 ///
7850 /// # Example
7851 /// ```ignore,no_run
7852 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7853 /// let x = NotebookRuntimeOptions::new().set_ai_platform_notebook_runtime_template("example");
7854 /// ```
7855 pub fn set_ai_platform_notebook_runtime_template<T: std::convert::Into<std::string::String>>(
7856 mut self,
7857 v: T,
7858 ) -> Self {
7859 self.ai_platform_notebook_runtime_template = v.into();
7860 self
7861 }
7862
7863 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink].
7864 ///
7865 /// Note that all the setters affecting `execution_sink` are mutually
7866 /// exclusive.
7867 ///
7868 /// # Example
7869 /// ```ignore,no_run
7870 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7871 /// use google_cloud_dataform_v1::model::notebook_runtime_options::ExecutionSink;
7872 /// let x = NotebookRuntimeOptions::new().set_execution_sink(Some(ExecutionSink::GcsOutputBucket("example".to_string())));
7873 /// ```
7874 pub fn set_execution_sink<
7875 T: std::convert::Into<
7876 std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
7877 >,
7878 >(
7879 mut self,
7880 v: T,
7881 ) -> Self {
7882 self.execution_sink = v.into();
7883 self
7884 }
7885
7886 /// The value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
7887 /// if it holds a `GcsOutputBucket`, `None` if the field is not set or
7888 /// holds a different branch.
7889 pub fn gcs_output_bucket(&self) -> std::option::Option<&std::string::String> {
7890 #[allow(unreachable_patterns)]
7891 self.execution_sink.as_ref().and_then(|v| match v {
7892 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v) => {
7893 std::option::Option::Some(v)
7894 }
7895 _ => std::option::Option::None,
7896 })
7897 }
7898
7899 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
7900 /// to hold a `GcsOutputBucket`.
7901 ///
7902 /// Note that all the setters affecting `execution_sink` are
7903 /// mutually exclusive.
7904 ///
7905 /// # Example
7906 /// ```ignore,no_run
7907 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7908 /// let x = NotebookRuntimeOptions::new().set_gcs_output_bucket("example");
7909 /// assert!(x.gcs_output_bucket().is_some());
7910 /// ```
7911 pub fn set_gcs_output_bucket<T: std::convert::Into<std::string::String>>(
7912 mut self,
7913 v: T,
7914 ) -> Self {
7915 self.execution_sink = std::option::Option::Some(
7916 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v.into()),
7917 );
7918 self
7919 }
7920
7921 /// Sets the value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage].
7922 ///
7923 /// Note that all the setters affecting `repository_snapshot_storage` are mutually
7924 /// exclusive.
7925 ///
7926 /// # Example
7927 /// ```ignore,no_run
7928 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7929 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
7930 /// let x = NotebookRuntimeOptions::new().set_repository_snapshot_storage(Some(
7931 /// google_cloud_dataform_v1::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(GcsRepositorySnapshotDestination::default().into())));
7932 /// ```
7933 pub fn set_repository_snapshot_storage<
7934 T: std::convert::Into<
7935 std::option::Option<
7936 crate::model::notebook_runtime_options::RepositorySnapshotStorage,
7937 >,
7938 >,
7939 >(
7940 mut self,
7941 v: T,
7942 ) -> Self {
7943 self.repository_snapshot_storage = v.into();
7944 self
7945 }
7946
7947 /// The value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage]
7948 /// if it holds a `GcsRepositorySnapshotDestination`, `None` if the field is not set or
7949 /// holds a different branch.
7950 pub fn gcs_repository_snapshot_destination(
7951 &self,
7952 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>> {
7953 #[allow(unreachable_patterns)]
7954 self.repository_snapshot_storage.as_ref().and_then(|v| match v {
7955 crate::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(v) => std::option::Option::Some(v),
7956 _ => std::option::Option::None,
7957 })
7958 }
7959
7960 /// Sets the value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage]
7961 /// to hold a `GcsRepositorySnapshotDestination`.
7962 ///
7963 /// Note that all the setters affecting `repository_snapshot_storage` are
7964 /// mutually exclusive.
7965 ///
7966 /// # Example
7967 /// ```ignore,no_run
7968 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7969 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
7970 /// let x = NotebookRuntimeOptions::new().set_gcs_repository_snapshot_destination(GcsRepositorySnapshotDestination::default()/* use setters */);
7971 /// assert!(x.gcs_repository_snapshot_destination().is_some());
7972 /// ```
7973 pub fn set_gcs_repository_snapshot_destination<
7974 T: std::convert::Into<std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>>,
7975 >(
7976 mut self,
7977 v: T,
7978 ) -> Self {
7979 self.repository_snapshot_storage = std::option::Option::Some(
7980 crate::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(
7981 v.into()
7982 )
7983 );
7984 self
7985 }
7986}
7987
7988impl wkt::message::Message for NotebookRuntimeOptions {
7989 fn typename() -> &'static str {
7990 "type.googleapis.com/google.cloud.dataform.v1.NotebookRuntimeOptions"
7991 }
7992}
7993
7994/// Defines additional types related to [NotebookRuntimeOptions].
7995pub mod notebook_runtime_options {
7996 #[allow(unused_imports)]
7997 use super::*;
7998
7999 /// The location to store the notebook execution result.
8000 #[derive(Clone, Debug, PartialEq)]
8001 #[non_exhaustive]
8002 pub enum ExecutionSink {
8003 /// Optional. The Google Cloud Storage location to upload the result to.
8004 /// Format: `gs://bucket-name`.
8005 GcsOutputBucket(std::string::String),
8006 }
8007
8008 /// The destination of the snapshot of repository files to be available for
8009 /// read-only access inside a notebook runtime
8010 #[derive(Clone, Debug, PartialEq)]
8011 #[non_exhaustive]
8012 pub enum RepositorySnapshotStorage {
8013 /// Optional. The Google Cloud Storage destination to upload the snapshot to.
8014 /// For empty URI it defaults to the provided gcs_output_bucket.
8015 /// Format: `gs://bucket-name/path/`.
8016 GcsRepositorySnapshotDestination(
8017 std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>,
8018 ),
8019 }
8020}
8021
8022/// Defines the pipeline type and path within the Git repository.
8023#[derive(Clone, Default, PartialEq)]
8024#[non_exhaustive]
8025pub struct PipelineConfig {
8026 /// Required. The type of the pipeline.
8027 pub pipeline_type: crate::model::pipeline_config::PipelineType,
8028
8029 /// Required. The relative path within the Git repository where the pipeline is
8030 /// defined. For example, for a Dataform pipeline, it is a path to the folder
8031 /// where `workflow_settings.yaml` or `dataform.json` is located.
8032 pub path: std::string::String,
8033
8034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8035}
8036
8037impl PipelineConfig {
8038 /// Creates a new default instance.
8039 pub fn new() -> Self {
8040 std::default::Default::default()
8041 }
8042
8043 /// Sets the value of [pipeline_type][crate::model::PipelineConfig::pipeline_type].
8044 ///
8045 /// # Example
8046 /// ```ignore,no_run
8047 /// # use google_cloud_dataform_v1::model::PipelineConfig;
8048 /// use google_cloud_dataform_v1::model::pipeline_config::PipelineType;
8049 /// let x0 = PipelineConfig::new().set_pipeline_type(PipelineType::Dataform);
8050 /// let x1 = PipelineConfig::new().set_pipeline_type(PipelineType::Sql);
8051 /// let x2 = PipelineConfig::new().set_pipeline_type(PipelineType::Notebook);
8052 /// ```
8053 pub fn set_pipeline_type<T: std::convert::Into<crate::model::pipeline_config::PipelineType>>(
8054 mut self,
8055 v: T,
8056 ) -> Self {
8057 self.pipeline_type = v.into();
8058 self
8059 }
8060
8061 /// Sets the value of [path][crate::model::PipelineConfig::path].
8062 ///
8063 /// # Example
8064 /// ```ignore,no_run
8065 /// # use google_cloud_dataform_v1::model::PipelineConfig;
8066 /// let x = PipelineConfig::new().set_path("example");
8067 /// ```
8068 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8069 self.path = v.into();
8070 self
8071 }
8072}
8073
8074impl wkt::message::Message for PipelineConfig {
8075 fn typename() -> &'static str {
8076 "type.googleapis.com/google.cloud.dataform.v1.PipelineConfig"
8077 }
8078}
8079
8080/// Defines additional types related to [PipelineConfig].
8081pub mod pipeline_config {
8082 #[allow(unused_imports)]
8083 use super::*;
8084
8085 /// The type of the pipeline. This may be extended in the future.
8086 /// In case of UNSPECIFIED, the error will be thrown.
8087 ///
8088 /// # Working with unknown values
8089 ///
8090 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8091 /// additional enum variants at any time. Adding new variants is not considered
8092 /// a breaking change. Applications should write their code in anticipation of:
8093 ///
8094 /// - New values appearing in future releases of the client library, **and**
8095 /// - New values received dynamically, without application changes.
8096 ///
8097 /// Please consult the [Working with enums] section in the user guide for some
8098 /// guidelines.
8099 ///
8100 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8101 #[derive(Clone, Debug, PartialEq)]
8102 #[non_exhaustive]
8103 pub enum PipelineType {
8104 /// Default value. This value is unused.
8105 Unspecified,
8106 /// Regular Dataform pipeline.
8107 Dataform,
8108 /// SQL single file asset.
8109 Sql,
8110 /// Notebook single file asset.
8111 Notebook,
8112 /// If set, the enum was initialized with an unknown value.
8113 ///
8114 /// Applications can examine the value using [PipelineType::value] or
8115 /// [PipelineType::name].
8116 UnknownValue(pipeline_type::UnknownValue),
8117 }
8118
8119 #[doc(hidden)]
8120 pub mod pipeline_type {
8121 #[allow(unused_imports)]
8122 use super::*;
8123 #[derive(Clone, Debug, PartialEq)]
8124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8125 }
8126
8127 impl PipelineType {
8128 /// Gets the enum value.
8129 ///
8130 /// Returns `None` if the enum contains an unknown value deserialized from
8131 /// the string representation of enums.
8132 pub fn value(&self) -> std::option::Option<i32> {
8133 match self {
8134 Self::Unspecified => std::option::Option::Some(0),
8135 Self::Dataform => std::option::Option::Some(1),
8136 Self::Sql => std::option::Option::Some(3),
8137 Self::Notebook => std::option::Option::Some(4),
8138 Self::UnknownValue(u) => u.0.value(),
8139 }
8140 }
8141
8142 /// Gets the enum value as a string.
8143 ///
8144 /// Returns `None` if the enum contains an unknown value deserialized from
8145 /// the integer representation of enums.
8146 pub fn name(&self) -> std::option::Option<&str> {
8147 match self {
8148 Self::Unspecified => std::option::Option::Some("PIPELINE_TYPE_UNSPECIFIED"),
8149 Self::Dataform => std::option::Option::Some("DATAFORM"),
8150 Self::Sql => std::option::Option::Some("SQL"),
8151 Self::Notebook => std::option::Option::Some("NOTEBOOK"),
8152 Self::UnknownValue(u) => u.0.name(),
8153 }
8154 }
8155 }
8156
8157 impl std::default::Default for PipelineType {
8158 fn default() -> Self {
8159 use std::convert::From;
8160 Self::from(0)
8161 }
8162 }
8163
8164 impl std::fmt::Display for PipelineType {
8165 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8166 wkt::internal::display_enum(f, self.name(), self.value())
8167 }
8168 }
8169
8170 impl std::convert::From<i32> for PipelineType {
8171 fn from(value: i32) -> Self {
8172 match value {
8173 0 => Self::Unspecified,
8174 1 => Self::Dataform,
8175 3 => Self::Sql,
8176 4 => Self::Notebook,
8177 _ => Self::UnknownValue(pipeline_type::UnknownValue(
8178 wkt::internal::UnknownEnumValue::Integer(value),
8179 )),
8180 }
8181 }
8182 }
8183
8184 impl std::convert::From<&str> for PipelineType {
8185 fn from(value: &str) -> Self {
8186 use std::string::ToString;
8187 match value {
8188 "PIPELINE_TYPE_UNSPECIFIED" => Self::Unspecified,
8189 "DATAFORM" => Self::Dataform,
8190 "SQL" => Self::Sql,
8191 "NOTEBOOK" => Self::Notebook,
8192 _ => Self::UnknownValue(pipeline_type::UnknownValue(
8193 wkt::internal::UnknownEnumValue::String(value.to_string()),
8194 )),
8195 }
8196 }
8197 }
8198
8199 impl serde::ser::Serialize for PipelineType {
8200 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8201 where
8202 S: serde::Serializer,
8203 {
8204 match self {
8205 Self::Unspecified => serializer.serialize_i32(0),
8206 Self::Dataform => serializer.serialize_i32(1),
8207 Self::Sql => serializer.serialize_i32(3),
8208 Self::Notebook => serializer.serialize_i32(4),
8209 Self::UnknownValue(u) => u.0.serialize(serializer),
8210 }
8211 }
8212 }
8213
8214 impl<'de> serde::de::Deserialize<'de> for PipelineType {
8215 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8216 where
8217 D: serde::Deserializer<'de>,
8218 {
8219 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PipelineType>::new(
8220 ".google.cloud.dataform.v1.PipelineConfig.PipelineType",
8221 ))
8222 }
8223 }
8224}
8225
8226/// `ListCompilationResults` request message.
8227#[derive(Clone, Default, PartialEq)]
8228#[non_exhaustive]
8229pub struct ListCompilationResultsRequest {
8230 /// Required. The repository in which to list compilation results. Must be in
8231 /// the format `projects/*/locations/*/repositories/*`.
8232 pub parent: std::string::String,
8233
8234 /// Optional. Maximum number of compilation results to return. The server may
8235 /// return fewer items than requested. If unspecified, the server will pick an
8236 /// appropriate default.
8237 pub page_size: i32,
8238
8239 /// Optional. Page token received from a previous `ListCompilationResults`
8240 /// call. Provide this to retrieve the subsequent page.
8241 ///
8242 /// When paginating, all other parameters provided to `ListCompilationResults`,
8243 /// with the exception of `page_size`, must match the call that provided the
8244 /// page token.
8245 pub page_token: std::string::String,
8246
8247 /// Optional. This field only supports ordering by `name` and `create_time`.
8248 /// If unspecified, the server will choose the ordering.
8249 /// If specified, the default order is ascending for the `name` field.
8250 pub order_by: std::string::String,
8251
8252 /// Optional. Filter for the returned list.
8253 pub filter: std::string::String,
8254
8255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8256}
8257
8258impl ListCompilationResultsRequest {
8259 /// Creates a new default instance.
8260 pub fn new() -> Self {
8261 std::default::Default::default()
8262 }
8263
8264 /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
8265 ///
8266 /// # Example
8267 /// ```ignore,no_run
8268 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8269 /// # let project_id = "project_id";
8270 /// # let location_id = "location_id";
8271 /// # let repository_id = "repository_id";
8272 /// let x = ListCompilationResultsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8273 /// ```
8274 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8275 self.parent = v.into();
8276 self
8277 }
8278
8279 /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
8280 ///
8281 /// # Example
8282 /// ```ignore,no_run
8283 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8284 /// let x = ListCompilationResultsRequest::new().set_page_size(42);
8285 /// ```
8286 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8287 self.page_size = v.into();
8288 self
8289 }
8290
8291 /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
8292 ///
8293 /// # Example
8294 /// ```ignore,no_run
8295 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8296 /// let x = ListCompilationResultsRequest::new().set_page_token("example");
8297 /// ```
8298 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8299 self.page_token = v.into();
8300 self
8301 }
8302
8303 /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
8304 ///
8305 /// # Example
8306 /// ```ignore,no_run
8307 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8308 /// let x = ListCompilationResultsRequest::new().set_order_by("example");
8309 /// ```
8310 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8311 self.order_by = v.into();
8312 self
8313 }
8314
8315 /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
8316 ///
8317 /// # Example
8318 /// ```ignore,no_run
8319 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8320 /// let x = ListCompilationResultsRequest::new().set_filter("example");
8321 /// ```
8322 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8323 self.filter = v.into();
8324 self
8325 }
8326}
8327
8328impl wkt::message::Message for ListCompilationResultsRequest {
8329 fn typename() -> &'static str {
8330 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsRequest"
8331 }
8332}
8333
8334/// `ListCompilationResults` response message.
8335#[derive(Clone, Default, PartialEq)]
8336#[non_exhaustive]
8337pub struct ListCompilationResultsResponse {
8338 /// List of compilation results.
8339 pub compilation_results: std::vec::Vec<crate::model::CompilationResult>,
8340
8341 /// A token, which can be sent as `page_token` to retrieve the next page.
8342 /// If this field is omitted, there are no subsequent pages.
8343 pub next_page_token: std::string::String,
8344
8345 /// Locations which could not be reached.
8346 pub unreachable: std::vec::Vec<std::string::String>,
8347
8348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8349}
8350
8351impl ListCompilationResultsResponse {
8352 /// Creates a new default instance.
8353 pub fn new() -> Self {
8354 std::default::Default::default()
8355 }
8356
8357 /// Sets the value of [compilation_results][crate::model::ListCompilationResultsResponse::compilation_results].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8362 /// use google_cloud_dataform_v1::model::CompilationResult;
8363 /// let x = ListCompilationResultsResponse::new()
8364 /// .set_compilation_results([
8365 /// CompilationResult::default()/* use setters */,
8366 /// CompilationResult::default()/* use (different) setters */,
8367 /// ]);
8368 /// ```
8369 pub fn set_compilation_results<T, V>(mut self, v: T) -> Self
8370 where
8371 T: std::iter::IntoIterator<Item = V>,
8372 V: std::convert::Into<crate::model::CompilationResult>,
8373 {
8374 use std::iter::Iterator;
8375 self.compilation_results = v.into_iter().map(|i| i.into()).collect();
8376 self
8377 }
8378
8379 /// Sets the value of [next_page_token][crate::model::ListCompilationResultsResponse::next_page_token].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8384 /// let x = ListCompilationResultsResponse::new().set_next_page_token("example");
8385 /// ```
8386 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8387 self.next_page_token = v.into();
8388 self
8389 }
8390
8391 /// Sets the value of [unreachable][crate::model::ListCompilationResultsResponse::unreachable].
8392 ///
8393 /// # Example
8394 /// ```ignore,no_run
8395 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8396 /// let x = ListCompilationResultsResponse::new().set_unreachable(["a", "b", "c"]);
8397 /// ```
8398 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8399 where
8400 T: std::iter::IntoIterator<Item = V>,
8401 V: std::convert::Into<std::string::String>,
8402 {
8403 use std::iter::Iterator;
8404 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8405 self
8406 }
8407}
8408
8409impl wkt::message::Message for ListCompilationResultsResponse {
8410 fn typename() -> &'static str {
8411 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsResponse"
8412 }
8413}
8414
8415#[doc(hidden)]
8416impl google_cloud_gax::paginator::internal::PageableResponse for ListCompilationResultsResponse {
8417 type PageItem = crate::model::CompilationResult;
8418
8419 fn items(self) -> std::vec::Vec<Self::PageItem> {
8420 self.compilation_results
8421 }
8422
8423 fn next_page_token(&self) -> std::string::String {
8424 use std::clone::Clone;
8425 self.next_page_token.clone()
8426 }
8427}
8428
8429/// `GetCompilationResult` request message.
8430#[derive(Clone, Default, PartialEq)]
8431#[non_exhaustive]
8432pub struct GetCompilationResultRequest {
8433 /// Required. The compilation result's name.
8434 pub name: std::string::String,
8435
8436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8437}
8438
8439impl GetCompilationResultRequest {
8440 /// Creates a new default instance.
8441 pub fn new() -> Self {
8442 std::default::Default::default()
8443 }
8444
8445 /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
8446 ///
8447 /// # Example
8448 /// ```ignore,no_run
8449 /// # use google_cloud_dataform_v1::model::GetCompilationResultRequest;
8450 /// # let project_id = "project_id";
8451 /// # let location_id = "location_id";
8452 /// # let repository_id = "repository_id";
8453 /// # let compilation_result_id = "compilation_result_id";
8454 /// let x = GetCompilationResultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
8455 /// ```
8456 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8457 self.name = v.into();
8458 self
8459 }
8460}
8461
8462impl wkt::message::Message for GetCompilationResultRequest {
8463 fn typename() -> &'static str {
8464 "type.googleapis.com/google.cloud.dataform.v1.GetCompilationResultRequest"
8465 }
8466}
8467
8468/// `CreateCompilationResult` request message.
8469#[derive(Clone, Default, PartialEq)]
8470#[non_exhaustive]
8471pub struct CreateCompilationResultRequest {
8472 /// Required. The repository in which to create the compilation result. Must be
8473 /// in the format `projects/*/locations/*/repositories/*`.
8474 pub parent: std::string::String,
8475
8476 /// Required. The compilation result to create.
8477 pub compilation_result: std::option::Option<crate::model::CompilationResult>,
8478
8479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8480}
8481
8482impl CreateCompilationResultRequest {
8483 /// Creates a new default instance.
8484 pub fn new() -> Self {
8485 std::default::Default::default()
8486 }
8487
8488 /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
8489 ///
8490 /// # Example
8491 /// ```ignore,no_run
8492 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8493 /// # let project_id = "project_id";
8494 /// # let location_id = "location_id";
8495 /// # let repository_id = "repository_id";
8496 /// let x = CreateCompilationResultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8497 /// ```
8498 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8499 self.parent = v.into();
8500 self
8501 }
8502
8503 /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
8504 ///
8505 /// # Example
8506 /// ```ignore,no_run
8507 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8508 /// use google_cloud_dataform_v1::model::CompilationResult;
8509 /// let x = CreateCompilationResultRequest::new().set_compilation_result(CompilationResult::default()/* use setters */);
8510 /// ```
8511 pub fn set_compilation_result<T>(mut self, v: T) -> Self
8512 where
8513 T: std::convert::Into<crate::model::CompilationResult>,
8514 {
8515 self.compilation_result = std::option::Option::Some(v.into());
8516 self
8517 }
8518
8519 /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
8520 ///
8521 /// # Example
8522 /// ```ignore,no_run
8523 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8524 /// use google_cloud_dataform_v1::model::CompilationResult;
8525 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(Some(CompilationResult::default()/* use setters */));
8526 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(None::<CompilationResult>);
8527 /// ```
8528 pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
8529 where
8530 T: std::convert::Into<crate::model::CompilationResult>,
8531 {
8532 self.compilation_result = v.map(|x| x.into());
8533 self
8534 }
8535}
8536
8537impl wkt::message::Message for CreateCompilationResultRequest {
8538 fn typename() -> &'static str {
8539 "type.googleapis.com/google.cloud.dataform.v1.CreateCompilationResultRequest"
8540 }
8541}
8542
8543/// Represents an action identifier. If the action writes output, the output
8544/// will be written to the referenced database object.
8545#[derive(Clone, Default, PartialEq)]
8546#[non_exhaustive]
8547pub struct Target {
8548 /// Optional. The action's database (Google Cloud project ID) .
8549 pub database: std::string::String,
8550
8551 /// Optional. The action's schema (BigQuery dataset ID), within `database`.
8552 pub schema: std::string::String,
8553
8554 /// Optional. The action's name, within `database` and `schema`.
8555 pub name: std::string::String,
8556
8557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8558}
8559
8560impl Target {
8561 /// Creates a new default instance.
8562 pub fn new() -> Self {
8563 std::default::Default::default()
8564 }
8565
8566 /// Sets the value of [database][crate::model::Target::database].
8567 ///
8568 /// # Example
8569 /// ```ignore,no_run
8570 /// # use google_cloud_dataform_v1::model::Target;
8571 /// let x = Target::new().set_database("example");
8572 /// ```
8573 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8574 self.database = v.into();
8575 self
8576 }
8577
8578 /// Sets the value of [schema][crate::model::Target::schema].
8579 ///
8580 /// # Example
8581 /// ```ignore,no_run
8582 /// # use google_cloud_dataform_v1::model::Target;
8583 /// let x = Target::new().set_schema("example");
8584 /// ```
8585 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8586 self.schema = v.into();
8587 self
8588 }
8589
8590 /// Sets the value of [name][crate::model::Target::name].
8591 ///
8592 /// # Example
8593 /// ```ignore,no_run
8594 /// # use google_cloud_dataform_v1::model::Target;
8595 /// let x = Target::new().set_name("example");
8596 /// ```
8597 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8598 self.name = v.into();
8599 self
8600 }
8601}
8602
8603impl wkt::message::Message for Target {
8604 fn typename() -> &'static str {
8605 "type.googleapis.com/google.cloud.dataform.v1.Target"
8606 }
8607}
8608
8609/// Describes a relation and its columns.
8610#[derive(Clone, Default, PartialEq)]
8611#[non_exhaustive]
8612pub struct RelationDescriptor {
8613 /// A text description of the relation.
8614 pub description: std::string::String,
8615
8616 /// A list of descriptions of columns within the relation.
8617 pub columns: std::vec::Vec<crate::model::relation_descriptor::ColumnDescriptor>,
8618
8619 /// A set of BigQuery labels that should be applied to the relation.
8620 pub bigquery_labels: std::collections::HashMap<std::string::String, std::string::String>,
8621
8622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8623}
8624
8625impl RelationDescriptor {
8626 /// Creates a new default instance.
8627 pub fn new() -> Self {
8628 std::default::Default::default()
8629 }
8630
8631 /// Sets the value of [description][crate::model::RelationDescriptor::description].
8632 ///
8633 /// # Example
8634 /// ```ignore,no_run
8635 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8636 /// let x = RelationDescriptor::new().set_description("example");
8637 /// ```
8638 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8639 self.description = v.into();
8640 self
8641 }
8642
8643 /// Sets the value of [columns][crate::model::RelationDescriptor::columns].
8644 ///
8645 /// # Example
8646 /// ```ignore,no_run
8647 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8648 /// use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8649 /// let x = RelationDescriptor::new()
8650 /// .set_columns([
8651 /// ColumnDescriptor::default()/* use setters */,
8652 /// ColumnDescriptor::default()/* use (different) setters */,
8653 /// ]);
8654 /// ```
8655 pub fn set_columns<T, V>(mut self, v: T) -> Self
8656 where
8657 T: std::iter::IntoIterator<Item = V>,
8658 V: std::convert::Into<crate::model::relation_descriptor::ColumnDescriptor>,
8659 {
8660 use std::iter::Iterator;
8661 self.columns = v.into_iter().map(|i| i.into()).collect();
8662 self
8663 }
8664
8665 /// Sets the value of [bigquery_labels][crate::model::RelationDescriptor::bigquery_labels].
8666 ///
8667 /// # Example
8668 /// ```ignore,no_run
8669 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8670 /// let x = RelationDescriptor::new().set_bigquery_labels([
8671 /// ("key0", "abc"),
8672 /// ("key1", "xyz"),
8673 /// ]);
8674 /// ```
8675 pub fn set_bigquery_labels<T, K, V>(mut self, v: T) -> Self
8676 where
8677 T: std::iter::IntoIterator<Item = (K, V)>,
8678 K: std::convert::Into<std::string::String>,
8679 V: std::convert::Into<std::string::String>,
8680 {
8681 use std::iter::Iterator;
8682 self.bigquery_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8683 self
8684 }
8685}
8686
8687impl wkt::message::Message for RelationDescriptor {
8688 fn typename() -> &'static str {
8689 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor"
8690 }
8691}
8692
8693/// Defines additional types related to [RelationDescriptor].
8694pub mod relation_descriptor {
8695 #[allow(unused_imports)]
8696 use super::*;
8697
8698 /// Describes a column.
8699 #[derive(Clone, Default, PartialEq)]
8700 #[non_exhaustive]
8701 pub struct ColumnDescriptor {
8702 /// The identifier for the column. Each entry in `path` represents one level
8703 /// of nesting.
8704 pub path: std::vec::Vec<std::string::String>,
8705
8706 /// A textual description of the column.
8707 pub description: std::string::String,
8708
8709 /// A list of BigQuery policy tags that will be applied to the column.
8710 pub bigquery_policy_tags: std::vec::Vec<std::string::String>,
8711
8712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8713 }
8714
8715 impl ColumnDescriptor {
8716 /// Creates a new default instance.
8717 pub fn new() -> Self {
8718 std::default::Default::default()
8719 }
8720
8721 /// Sets the value of [path][crate::model::relation_descriptor::ColumnDescriptor::path].
8722 ///
8723 /// # Example
8724 /// ```ignore,no_run
8725 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8726 /// let x = ColumnDescriptor::new().set_path(["a", "b", "c"]);
8727 /// ```
8728 pub fn set_path<T, V>(mut self, v: T) -> Self
8729 where
8730 T: std::iter::IntoIterator<Item = V>,
8731 V: std::convert::Into<std::string::String>,
8732 {
8733 use std::iter::Iterator;
8734 self.path = v.into_iter().map(|i| i.into()).collect();
8735 self
8736 }
8737
8738 /// Sets the value of [description][crate::model::relation_descriptor::ColumnDescriptor::description].
8739 ///
8740 /// # Example
8741 /// ```ignore,no_run
8742 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8743 /// let x = ColumnDescriptor::new().set_description("example");
8744 /// ```
8745 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8746 self.description = v.into();
8747 self
8748 }
8749
8750 /// Sets the value of [bigquery_policy_tags][crate::model::relation_descriptor::ColumnDescriptor::bigquery_policy_tags].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8755 /// let x = ColumnDescriptor::new().set_bigquery_policy_tags(["a", "b", "c"]);
8756 /// ```
8757 pub fn set_bigquery_policy_tags<T, V>(mut self, v: T) -> Self
8758 where
8759 T: std::iter::IntoIterator<Item = V>,
8760 V: std::convert::Into<std::string::String>,
8761 {
8762 use std::iter::Iterator;
8763 self.bigquery_policy_tags = v.into_iter().map(|i| i.into()).collect();
8764 self
8765 }
8766 }
8767
8768 impl wkt::message::Message for ColumnDescriptor {
8769 fn typename() -> &'static str {
8770 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor.ColumnDescriptor"
8771 }
8772 }
8773}
8774
8775/// Represents a single Dataform action in a compilation result.
8776#[derive(Clone, Default, PartialEq)]
8777#[non_exhaustive]
8778pub struct CompilationResultAction {
8779 /// This action's identifier. Unique within the compilation result.
8780 pub target: std::option::Option<crate::model::Target>,
8781
8782 /// The action's identifier if the project had been compiled without any
8783 /// overrides configured. Unique within the compilation result.
8784 pub canonical_target: std::option::Option<crate::model::Target>,
8785
8786 /// The full path including filename in which this action is located, relative
8787 /// to the workspace root.
8788 pub file_path: std::string::String,
8789
8790 /// Output only. All the metadata information that is used internally to serve
8791 /// the resource. For example: timestamps, flags, status fields, etc. The
8792 /// format of this field is a JSON string.
8793 pub internal_metadata: std::option::Option<std::string::String>,
8794
8795 /// The compiled object.
8796 pub compiled_object:
8797 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
8798
8799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8800}
8801
8802impl CompilationResultAction {
8803 /// Creates a new default instance.
8804 pub fn new() -> Self {
8805 std::default::Default::default()
8806 }
8807
8808 /// Sets the value of [target][crate::model::CompilationResultAction::target].
8809 ///
8810 /// # Example
8811 /// ```ignore,no_run
8812 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8813 /// use google_cloud_dataform_v1::model::Target;
8814 /// let x = CompilationResultAction::new().set_target(Target::default()/* use setters */);
8815 /// ```
8816 pub fn set_target<T>(mut self, v: T) -> Self
8817 where
8818 T: std::convert::Into<crate::model::Target>,
8819 {
8820 self.target = std::option::Option::Some(v.into());
8821 self
8822 }
8823
8824 /// Sets or clears the value of [target][crate::model::CompilationResultAction::target].
8825 ///
8826 /// # Example
8827 /// ```ignore,no_run
8828 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8829 /// use google_cloud_dataform_v1::model::Target;
8830 /// let x = CompilationResultAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
8831 /// let x = CompilationResultAction::new().set_or_clear_target(None::<Target>);
8832 /// ```
8833 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
8834 where
8835 T: std::convert::Into<crate::model::Target>,
8836 {
8837 self.target = v.map(|x| x.into());
8838 self
8839 }
8840
8841 /// Sets the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
8842 ///
8843 /// # Example
8844 /// ```ignore,no_run
8845 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8846 /// use google_cloud_dataform_v1::model::Target;
8847 /// let x = CompilationResultAction::new().set_canonical_target(Target::default()/* use setters */);
8848 /// ```
8849 pub fn set_canonical_target<T>(mut self, v: T) -> Self
8850 where
8851 T: std::convert::Into<crate::model::Target>,
8852 {
8853 self.canonical_target = std::option::Option::Some(v.into());
8854 self
8855 }
8856
8857 /// Sets or clears the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
8858 ///
8859 /// # Example
8860 /// ```ignore,no_run
8861 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8862 /// use google_cloud_dataform_v1::model::Target;
8863 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
8864 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(None::<Target>);
8865 /// ```
8866 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
8867 where
8868 T: std::convert::Into<crate::model::Target>,
8869 {
8870 self.canonical_target = v.map(|x| x.into());
8871 self
8872 }
8873
8874 /// Sets the value of [file_path][crate::model::CompilationResultAction::file_path].
8875 ///
8876 /// # Example
8877 /// ```ignore,no_run
8878 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8879 /// let x = CompilationResultAction::new().set_file_path("example");
8880 /// ```
8881 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8882 self.file_path = v.into();
8883 self
8884 }
8885
8886 /// Sets the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
8887 ///
8888 /// # Example
8889 /// ```ignore,no_run
8890 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8891 /// let x = CompilationResultAction::new().set_internal_metadata("example");
8892 /// ```
8893 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
8894 where
8895 T: std::convert::Into<std::string::String>,
8896 {
8897 self.internal_metadata = std::option::Option::Some(v.into());
8898 self
8899 }
8900
8901 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
8902 ///
8903 /// # Example
8904 /// ```ignore,no_run
8905 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8906 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(Some("example"));
8907 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(None::<String>);
8908 /// ```
8909 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8910 where
8911 T: std::convert::Into<std::string::String>,
8912 {
8913 self.internal_metadata = v.map(|x| x.into());
8914 self
8915 }
8916
8917 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object].
8918 ///
8919 /// Note that all the setters affecting `compiled_object` are mutually
8920 /// exclusive.
8921 ///
8922 /// # Example
8923 /// ```ignore,no_run
8924 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8925 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8926 /// let x = CompilationResultAction::new().set_compiled_object(Some(
8927 /// google_cloud_dataform_v1::model::compilation_result_action::CompiledObject::Relation(Relation::default().into())));
8928 /// ```
8929 pub fn set_compiled_object<
8930 T: std::convert::Into<
8931 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
8932 >,
8933 >(
8934 mut self,
8935 v: T,
8936 ) -> Self {
8937 self.compiled_object = v.into();
8938 self
8939 }
8940
8941 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8942 /// if it holds a `Relation`, `None` if the field is not set or
8943 /// holds a different branch.
8944 pub fn relation(
8945 &self,
8946 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Relation>>
8947 {
8948 #[allow(unreachable_patterns)]
8949 self.compiled_object.as_ref().and_then(|v| match v {
8950 crate::model::compilation_result_action::CompiledObject::Relation(v) => {
8951 std::option::Option::Some(v)
8952 }
8953 _ => std::option::Option::None,
8954 })
8955 }
8956
8957 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8958 /// to hold a `Relation`.
8959 ///
8960 /// Note that all the setters affecting `compiled_object` are
8961 /// mutually exclusive.
8962 ///
8963 /// # Example
8964 /// ```ignore,no_run
8965 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8966 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8967 /// let x = CompilationResultAction::new().set_relation(Relation::default()/* use setters */);
8968 /// assert!(x.relation().is_some());
8969 /// assert!(x.operations().is_none());
8970 /// assert!(x.assertion().is_none());
8971 /// assert!(x.declaration().is_none());
8972 /// assert!(x.notebook().is_none());
8973 /// assert!(x.data_preparation().is_none());
8974 /// ```
8975 pub fn set_relation<
8976 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Relation>>,
8977 >(
8978 mut self,
8979 v: T,
8980 ) -> Self {
8981 self.compiled_object = std::option::Option::Some(
8982 crate::model::compilation_result_action::CompiledObject::Relation(v.into()),
8983 );
8984 self
8985 }
8986
8987 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8988 /// if it holds a `Operations`, `None` if the field is not set or
8989 /// holds a different branch.
8990 pub fn operations(
8991 &self,
8992 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Operations>>
8993 {
8994 #[allow(unreachable_patterns)]
8995 self.compiled_object.as_ref().and_then(|v| match v {
8996 crate::model::compilation_result_action::CompiledObject::Operations(v) => {
8997 std::option::Option::Some(v)
8998 }
8999 _ => std::option::Option::None,
9000 })
9001 }
9002
9003 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9004 /// to hold a `Operations`.
9005 ///
9006 /// Note that all the setters affecting `compiled_object` are
9007 /// mutually exclusive.
9008 ///
9009 /// # Example
9010 /// ```ignore,no_run
9011 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9012 /// use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9013 /// let x = CompilationResultAction::new().set_operations(Operations::default()/* use setters */);
9014 /// assert!(x.operations().is_some());
9015 /// assert!(x.relation().is_none());
9016 /// assert!(x.assertion().is_none());
9017 /// assert!(x.declaration().is_none());
9018 /// assert!(x.notebook().is_none());
9019 /// assert!(x.data_preparation().is_none());
9020 /// ```
9021 pub fn set_operations<
9022 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Operations>>,
9023 >(
9024 mut self,
9025 v: T,
9026 ) -> Self {
9027 self.compiled_object = std::option::Option::Some(
9028 crate::model::compilation_result_action::CompiledObject::Operations(v.into()),
9029 );
9030 self
9031 }
9032
9033 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9034 /// if it holds a `Assertion`, `None` if the field is not set or
9035 /// holds a different branch.
9036 pub fn assertion(
9037 &self,
9038 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Assertion>>
9039 {
9040 #[allow(unreachable_patterns)]
9041 self.compiled_object.as_ref().and_then(|v| match v {
9042 crate::model::compilation_result_action::CompiledObject::Assertion(v) => {
9043 std::option::Option::Some(v)
9044 }
9045 _ => std::option::Option::None,
9046 })
9047 }
9048
9049 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9050 /// to hold a `Assertion`.
9051 ///
9052 /// Note that all the setters affecting `compiled_object` are
9053 /// mutually exclusive.
9054 ///
9055 /// # Example
9056 /// ```ignore,no_run
9057 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9058 /// use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9059 /// let x = CompilationResultAction::new().set_assertion(Assertion::default()/* use setters */);
9060 /// assert!(x.assertion().is_some());
9061 /// assert!(x.relation().is_none());
9062 /// assert!(x.operations().is_none());
9063 /// assert!(x.declaration().is_none());
9064 /// assert!(x.notebook().is_none());
9065 /// assert!(x.data_preparation().is_none());
9066 /// ```
9067 pub fn set_assertion<
9068 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Assertion>>,
9069 >(
9070 mut self,
9071 v: T,
9072 ) -> Self {
9073 self.compiled_object = std::option::Option::Some(
9074 crate::model::compilation_result_action::CompiledObject::Assertion(v.into()),
9075 );
9076 self
9077 }
9078
9079 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9080 /// if it holds a `Declaration`, `None` if the field is not set or
9081 /// holds a different branch.
9082 pub fn declaration(
9083 &self,
9084 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Declaration>>
9085 {
9086 #[allow(unreachable_patterns)]
9087 self.compiled_object.as_ref().and_then(|v| match v {
9088 crate::model::compilation_result_action::CompiledObject::Declaration(v) => {
9089 std::option::Option::Some(v)
9090 }
9091 _ => std::option::Option::None,
9092 })
9093 }
9094
9095 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9096 /// to hold a `Declaration`.
9097 ///
9098 /// Note that all the setters affecting `compiled_object` are
9099 /// mutually exclusive.
9100 ///
9101 /// # Example
9102 /// ```ignore,no_run
9103 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9104 /// use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
9105 /// let x = CompilationResultAction::new().set_declaration(Declaration::default()/* use setters */);
9106 /// assert!(x.declaration().is_some());
9107 /// assert!(x.relation().is_none());
9108 /// assert!(x.operations().is_none());
9109 /// assert!(x.assertion().is_none());
9110 /// assert!(x.notebook().is_none());
9111 /// assert!(x.data_preparation().is_none());
9112 /// ```
9113 pub fn set_declaration<
9114 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Declaration>>,
9115 >(
9116 mut self,
9117 v: T,
9118 ) -> Self {
9119 self.compiled_object = std::option::Option::Some(
9120 crate::model::compilation_result_action::CompiledObject::Declaration(v.into()),
9121 );
9122 self
9123 }
9124
9125 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9126 /// if it holds a `Notebook`, `None` if the field is not set or
9127 /// holds a different branch.
9128 pub fn notebook(
9129 &self,
9130 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Notebook>>
9131 {
9132 #[allow(unreachable_patterns)]
9133 self.compiled_object.as_ref().and_then(|v| match v {
9134 crate::model::compilation_result_action::CompiledObject::Notebook(v) => {
9135 std::option::Option::Some(v)
9136 }
9137 _ => std::option::Option::None,
9138 })
9139 }
9140
9141 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9142 /// to hold a `Notebook`.
9143 ///
9144 /// Note that all the setters affecting `compiled_object` are
9145 /// mutually exclusive.
9146 ///
9147 /// # Example
9148 /// ```ignore,no_run
9149 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9150 /// use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9151 /// let x = CompilationResultAction::new().set_notebook(Notebook::default()/* use setters */);
9152 /// assert!(x.notebook().is_some());
9153 /// assert!(x.relation().is_none());
9154 /// assert!(x.operations().is_none());
9155 /// assert!(x.assertion().is_none());
9156 /// assert!(x.declaration().is_none());
9157 /// assert!(x.data_preparation().is_none());
9158 /// ```
9159 pub fn set_notebook<
9160 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Notebook>>,
9161 >(
9162 mut self,
9163 v: T,
9164 ) -> Self {
9165 self.compiled_object = std::option::Option::Some(
9166 crate::model::compilation_result_action::CompiledObject::Notebook(v.into()),
9167 );
9168 self
9169 }
9170
9171 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9172 /// if it holds a `DataPreparation`, `None` if the field is not set or
9173 /// holds a different branch.
9174 pub fn data_preparation(
9175 &self,
9176 ) -> std::option::Option<
9177 &std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
9178 > {
9179 #[allow(unreachable_patterns)]
9180 self.compiled_object.as_ref().and_then(|v| match v {
9181 crate::model::compilation_result_action::CompiledObject::DataPreparation(v) => {
9182 std::option::Option::Some(v)
9183 }
9184 _ => std::option::Option::None,
9185 })
9186 }
9187
9188 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9189 /// to hold a `DataPreparation`.
9190 ///
9191 /// Note that all the setters affecting `compiled_object` are
9192 /// mutually exclusive.
9193 ///
9194 /// # Example
9195 /// ```ignore,no_run
9196 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9197 /// use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9198 /// let x = CompilationResultAction::new().set_data_preparation(DataPreparation::default()/* use setters */);
9199 /// assert!(x.data_preparation().is_some());
9200 /// assert!(x.relation().is_none());
9201 /// assert!(x.operations().is_none());
9202 /// assert!(x.assertion().is_none());
9203 /// assert!(x.declaration().is_none());
9204 /// assert!(x.notebook().is_none());
9205 /// ```
9206 pub fn set_data_preparation<
9207 T: std::convert::Into<
9208 std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
9209 >,
9210 >(
9211 mut self,
9212 v: T,
9213 ) -> Self {
9214 self.compiled_object = std::option::Option::Some(
9215 crate::model::compilation_result_action::CompiledObject::DataPreparation(v.into()),
9216 );
9217 self
9218 }
9219}
9220
9221impl wkt::message::Message for CompilationResultAction {
9222 fn typename() -> &'static str {
9223 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction"
9224 }
9225}
9226
9227/// Defines additional types related to [CompilationResultAction].
9228pub mod compilation_result_action {
9229 #[allow(unused_imports)]
9230 use super::*;
9231
9232 /// Represents a database relation.
9233 #[derive(Clone, Default, PartialEq)]
9234 #[non_exhaustive]
9235 pub struct Relation {
9236 /// A list of actions that this action depends on.
9237 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9238
9239 /// Whether this action is disabled (i.e. should not be run).
9240 pub disabled: bool,
9241
9242 /// Arbitrary, user-defined tags on this action.
9243 pub tags: std::vec::Vec<std::string::String>,
9244
9245 /// Descriptor for the relation and its columns.
9246 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
9247
9248 /// The type of this relation.
9249 pub relation_type: crate::model::compilation_result_action::relation::RelationType,
9250
9251 /// The SELECT query which returns rows which this relation should contain.
9252 pub select_query: std::string::String,
9253
9254 /// SQL statements to be executed before creating the relation.
9255 pub pre_operations: std::vec::Vec<std::string::String>,
9256
9257 /// SQL statements to be executed after creating the relation.
9258 pub post_operations: std::vec::Vec<std::string::String>,
9259
9260 /// Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
9261 /// `relation_type` is `INCREMENTAL_TABLE`.
9262 pub incremental_table_config: std::option::Option<
9263 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9264 >,
9265
9266 /// The SQL expression used to partition the relation.
9267 pub partition_expression: std::string::String,
9268
9269 /// A list of columns or SQL expressions used to cluster the table.
9270 pub cluster_expressions: std::vec::Vec<std::string::String>,
9271
9272 /// Sets the partition expiration in days.
9273 pub partition_expiration_days: i32,
9274
9275 /// Specifies whether queries on this table must include a predicate filter
9276 /// that filters on the partitioning column.
9277 pub require_partition_filter: bool,
9278
9279 /// Additional options that will be provided as key/value pairs into the
9280 /// options clause of a create table/view statement. See
9281 /// <https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language>
9282 /// for more information on which options are supported.
9283 pub additional_options: std::collections::HashMap<std::string::String, std::string::String>,
9284
9285 /// Optional. The connection specifying the credentials to be used to read
9286 /// and write to external storage, such as Cloud Storage. The connection can
9287 /// have the form `{project}.{location}.{connection_id}` or
9288 /// `projects/{project}/locations/{location}/connections/{connection_id}`,
9289 /// or be set to DEFAULT.
9290 pub connection: std::string::String,
9291
9292 /// Optional. The table format for the BigQuery table.
9293 pub table_format: crate::model::compilation_result_action::relation::TableFormat,
9294
9295 /// Optional. The file format for the BigQuery table.
9296 pub file_format: crate::model::compilation_result_action::relation::FileFormat,
9297
9298 /// Optional. The fully qualified location prefix of the external folder
9299 /// where table data is stored. The URI should be in the format
9300 /// `gs://bucket/path_to_table/`.
9301 pub storage_uri: std::string::String,
9302
9303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9304 }
9305
9306 impl Relation {
9307 /// Creates a new default instance.
9308 pub fn new() -> Self {
9309 std::default::Default::default()
9310 }
9311
9312 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Relation::dependency_targets].
9313 ///
9314 /// # Example
9315 /// ```ignore,no_run
9316 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9317 /// use google_cloud_dataform_v1::model::Target;
9318 /// let x = Relation::new()
9319 /// .set_dependency_targets([
9320 /// Target::default()/* use setters */,
9321 /// Target::default()/* use (different) setters */,
9322 /// ]);
9323 /// ```
9324 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9325 where
9326 T: std::iter::IntoIterator<Item = V>,
9327 V: std::convert::Into<crate::model::Target>,
9328 {
9329 use std::iter::Iterator;
9330 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9331 self
9332 }
9333
9334 /// Sets the value of [disabled][crate::model::compilation_result_action::Relation::disabled].
9335 ///
9336 /// # Example
9337 /// ```ignore,no_run
9338 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9339 /// let x = Relation::new().set_disabled(true);
9340 /// ```
9341 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9342 self.disabled = v.into();
9343 self
9344 }
9345
9346 /// Sets the value of [tags][crate::model::compilation_result_action::Relation::tags].
9347 ///
9348 /// # Example
9349 /// ```ignore,no_run
9350 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9351 /// let x = Relation::new().set_tags(["a", "b", "c"]);
9352 /// ```
9353 pub fn set_tags<T, V>(mut self, v: T) -> Self
9354 where
9355 T: std::iter::IntoIterator<Item = V>,
9356 V: std::convert::Into<std::string::String>,
9357 {
9358 use std::iter::Iterator;
9359 self.tags = v.into_iter().map(|i| i.into()).collect();
9360 self
9361 }
9362
9363 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
9364 ///
9365 /// # Example
9366 /// ```ignore,no_run
9367 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9368 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9369 /// let x = Relation::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
9370 /// ```
9371 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
9372 where
9373 T: std::convert::Into<crate::model::RelationDescriptor>,
9374 {
9375 self.relation_descriptor = std::option::Option::Some(v.into());
9376 self
9377 }
9378
9379 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9384 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9385 /// let x = Relation::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
9386 /// let x = Relation::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
9387 /// ```
9388 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
9389 where
9390 T: std::convert::Into<crate::model::RelationDescriptor>,
9391 {
9392 self.relation_descriptor = v.map(|x| x.into());
9393 self
9394 }
9395
9396 /// Sets the value of [relation_type][crate::model::compilation_result_action::Relation::relation_type].
9397 ///
9398 /// # Example
9399 /// ```ignore,no_run
9400 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9401 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::RelationType;
9402 /// let x0 = Relation::new().set_relation_type(RelationType::Table);
9403 /// let x1 = Relation::new().set_relation_type(RelationType::View);
9404 /// let x2 = Relation::new().set_relation_type(RelationType::IncrementalTable);
9405 /// ```
9406 pub fn set_relation_type<
9407 T: std::convert::Into<crate::model::compilation_result_action::relation::RelationType>,
9408 >(
9409 mut self,
9410 v: T,
9411 ) -> Self {
9412 self.relation_type = v.into();
9413 self
9414 }
9415
9416 /// Sets the value of [select_query][crate::model::compilation_result_action::Relation::select_query].
9417 ///
9418 /// # Example
9419 /// ```ignore,no_run
9420 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9421 /// let x = Relation::new().set_select_query("example");
9422 /// ```
9423 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9424 mut self,
9425 v: T,
9426 ) -> Self {
9427 self.select_query = v.into();
9428 self
9429 }
9430
9431 /// Sets the value of [pre_operations][crate::model::compilation_result_action::Relation::pre_operations].
9432 ///
9433 /// # Example
9434 /// ```ignore,no_run
9435 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9436 /// let x = Relation::new().set_pre_operations(["a", "b", "c"]);
9437 /// ```
9438 pub fn set_pre_operations<T, V>(mut self, v: T) -> Self
9439 where
9440 T: std::iter::IntoIterator<Item = V>,
9441 V: std::convert::Into<std::string::String>,
9442 {
9443 use std::iter::Iterator;
9444 self.pre_operations = v.into_iter().map(|i| i.into()).collect();
9445 self
9446 }
9447
9448 /// Sets the value of [post_operations][crate::model::compilation_result_action::Relation::post_operations].
9449 ///
9450 /// # Example
9451 /// ```ignore,no_run
9452 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9453 /// let x = Relation::new().set_post_operations(["a", "b", "c"]);
9454 /// ```
9455 pub fn set_post_operations<T, V>(mut self, v: T) -> Self
9456 where
9457 T: std::iter::IntoIterator<Item = V>,
9458 V: std::convert::Into<std::string::String>,
9459 {
9460 use std::iter::Iterator;
9461 self.post_operations = v.into_iter().map(|i| i.into()).collect();
9462 self
9463 }
9464
9465 /// Sets the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
9466 ///
9467 /// # Example
9468 /// ```ignore,no_run
9469 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9470 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9471 /// let x = Relation::new().set_incremental_table_config(IncrementalTableConfig::default()/* use setters */);
9472 /// ```
9473 pub fn set_incremental_table_config<T>(mut self, v: T) -> Self
9474 where
9475 T: std::convert::Into<
9476 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9477 >,
9478 {
9479 self.incremental_table_config = std::option::Option::Some(v.into());
9480 self
9481 }
9482
9483 /// Sets or clears the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
9484 ///
9485 /// # Example
9486 /// ```ignore,no_run
9487 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9488 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9489 /// let x = Relation::new().set_or_clear_incremental_table_config(Some(IncrementalTableConfig::default()/* use setters */));
9490 /// let x = Relation::new().set_or_clear_incremental_table_config(None::<IncrementalTableConfig>);
9491 /// ```
9492 pub fn set_or_clear_incremental_table_config<T>(mut self, v: std::option::Option<T>) -> Self
9493 where
9494 T: std::convert::Into<
9495 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9496 >,
9497 {
9498 self.incremental_table_config = v.map(|x| x.into());
9499 self
9500 }
9501
9502 /// Sets the value of [partition_expression][crate::model::compilation_result_action::Relation::partition_expression].
9503 ///
9504 /// # Example
9505 /// ```ignore,no_run
9506 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9507 /// let x = Relation::new().set_partition_expression("example");
9508 /// ```
9509 pub fn set_partition_expression<T: std::convert::Into<std::string::String>>(
9510 mut self,
9511 v: T,
9512 ) -> Self {
9513 self.partition_expression = v.into();
9514 self
9515 }
9516
9517 /// Sets the value of [cluster_expressions][crate::model::compilation_result_action::Relation::cluster_expressions].
9518 ///
9519 /// # Example
9520 /// ```ignore,no_run
9521 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9522 /// let x = Relation::new().set_cluster_expressions(["a", "b", "c"]);
9523 /// ```
9524 pub fn set_cluster_expressions<T, V>(mut self, v: T) -> Self
9525 where
9526 T: std::iter::IntoIterator<Item = V>,
9527 V: std::convert::Into<std::string::String>,
9528 {
9529 use std::iter::Iterator;
9530 self.cluster_expressions = v.into_iter().map(|i| i.into()).collect();
9531 self
9532 }
9533
9534 /// Sets the value of [partition_expiration_days][crate::model::compilation_result_action::Relation::partition_expiration_days].
9535 ///
9536 /// # Example
9537 /// ```ignore,no_run
9538 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9539 /// let x = Relation::new().set_partition_expiration_days(42);
9540 /// ```
9541 pub fn set_partition_expiration_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9542 self.partition_expiration_days = v.into();
9543 self
9544 }
9545
9546 /// Sets the value of [require_partition_filter][crate::model::compilation_result_action::Relation::require_partition_filter].
9547 ///
9548 /// # Example
9549 /// ```ignore,no_run
9550 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9551 /// let x = Relation::new().set_require_partition_filter(true);
9552 /// ```
9553 pub fn set_require_partition_filter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9554 self.require_partition_filter = v.into();
9555 self
9556 }
9557
9558 /// Sets the value of [additional_options][crate::model::compilation_result_action::Relation::additional_options].
9559 ///
9560 /// # Example
9561 /// ```ignore,no_run
9562 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9563 /// let x = Relation::new().set_additional_options([
9564 /// ("key0", "abc"),
9565 /// ("key1", "xyz"),
9566 /// ]);
9567 /// ```
9568 pub fn set_additional_options<T, K, V>(mut self, v: T) -> Self
9569 where
9570 T: std::iter::IntoIterator<Item = (K, V)>,
9571 K: std::convert::Into<std::string::String>,
9572 V: std::convert::Into<std::string::String>,
9573 {
9574 use std::iter::Iterator;
9575 self.additional_options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9576 self
9577 }
9578
9579 /// Sets the value of [connection][crate::model::compilation_result_action::Relation::connection].
9580 ///
9581 /// # Example
9582 /// ```ignore,no_run
9583 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9584 /// let x = Relation::new().set_connection("example");
9585 /// ```
9586 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9587 self.connection = v.into();
9588 self
9589 }
9590
9591 /// Sets the value of [table_format][crate::model::compilation_result_action::Relation::table_format].
9592 ///
9593 /// # Example
9594 /// ```ignore,no_run
9595 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9596 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::TableFormat;
9597 /// let x0 = Relation::new().set_table_format(TableFormat::Iceberg);
9598 /// ```
9599 pub fn set_table_format<
9600 T: std::convert::Into<crate::model::compilation_result_action::relation::TableFormat>,
9601 >(
9602 mut self,
9603 v: T,
9604 ) -> Self {
9605 self.table_format = v.into();
9606 self
9607 }
9608
9609 /// Sets the value of [file_format][crate::model::compilation_result_action::Relation::file_format].
9610 ///
9611 /// # Example
9612 /// ```ignore,no_run
9613 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9614 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::FileFormat;
9615 /// let x0 = Relation::new().set_file_format(FileFormat::Parquet);
9616 /// ```
9617 pub fn set_file_format<
9618 T: std::convert::Into<crate::model::compilation_result_action::relation::FileFormat>,
9619 >(
9620 mut self,
9621 v: T,
9622 ) -> Self {
9623 self.file_format = v.into();
9624 self
9625 }
9626
9627 /// Sets the value of [storage_uri][crate::model::compilation_result_action::Relation::storage_uri].
9628 ///
9629 /// # Example
9630 /// ```ignore,no_run
9631 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9632 /// let x = Relation::new().set_storage_uri("example");
9633 /// ```
9634 pub fn set_storage_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9635 self.storage_uri = v.into();
9636 self
9637 }
9638 }
9639
9640 impl wkt::message::Message for Relation {
9641 fn typename() -> &'static str {
9642 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation"
9643 }
9644 }
9645
9646 /// Defines additional types related to [Relation].
9647 pub mod relation {
9648 #[allow(unused_imports)]
9649 use super::*;
9650
9651 /// Contains settings for relations of type `INCREMENTAL_TABLE`.
9652 #[derive(Clone, Default, PartialEq)]
9653 #[non_exhaustive]
9654 pub struct IncrementalTableConfig {
9655 /// The SELECT query which returns rows which should be inserted into the
9656 /// relation if it already exists and is not being refreshed.
9657 pub incremental_select_query: std::string::String,
9658
9659 /// Whether this table should be protected from being refreshed.
9660 pub refresh_disabled: bool,
9661
9662 /// A set of columns or SQL expressions used to define row uniqueness.
9663 /// If any duplicates are discovered (as defined by `unique_key_parts`),
9664 /// only the newly selected rows (as defined by `incremental_select_query`)
9665 /// will be included in the relation.
9666 pub unique_key_parts: std::vec::Vec<std::string::String>,
9667
9668 /// A SQL expression conditional used to limit the set of existing rows
9669 /// considered for a merge operation (see `unique_key_parts` for more
9670 /// information).
9671 pub update_partition_filter: std::string::String,
9672
9673 /// SQL statements to be executed before inserting new rows into the
9674 /// relation.
9675 pub incremental_pre_operations: std::vec::Vec<std::string::String>,
9676
9677 /// SQL statements to be executed after inserting new rows into the
9678 /// relation.
9679 pub incremental_post_operations: std::vec::Vec<std::string::String>,
9680
9681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9682 }
9683
9684 impl IncrementalTableConfig {
9685 /// Creates a new default instance.
9686 pub fn new() -> Self {
9687 std::default::Default::default()
9688 }
9689
9690 /// Sets the value of [incremental_select_query][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_select_query].
9691 ///
9692 /// # Example
9693 /// ```ignore,no_run
9694 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9695 /// let x = IncrementalTableConfig::new().set_incremental_select_query("example");
9696 /// ```
9697 pub fn set_incremental_select_query<T: std::convert::Into<std::string::String>>(
9698 mut self,
9699 v: T,
9700 ) -> Self {
9701 self.incremental_select_query = v.into();
9702 self
9703 }
9704
9705 /// Sets the value of [refresh_disabled][crate::model::compilation_result_action::relation::IncrementalTableConfig::refresh_disabled].
9706 ///
9707 /// # Example
9708 /// ```ignore,no_run
9709 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9710 /// let x = IncrementalTableConfig::new().set_refresh_disabled(true);
9711 /// ```
9712 pub fn set_refresh_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9713 self.refresh_disabled = v.into();
9714 self
9715 }
9716
9717 /// Sets the value of [unique_key_parts][crate::model::compilation_result_action::relation::IncrementalTableConfig::unique_key_parts].
9718 ///
9719 /// # Example
9720 /// ```ignore,no_run
9721 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9722 /// let x = IncrementalTableConfig::new().set_unique_key_parts(["a", "b", "c"]);
9723 /// ```
9724 pub fn set_unique_key_parts<T, V>(mut self, v: T) -> Self
9725 where
9726 T: std::iter::IntoIterator<Item = V>,
9727 V: std::convert::Into<std::string::String>,
9728 {
9729 use std::iter::Iterator;
9730 self.unique_key_parts = v.into_iter().map(|i| i.into()).collect();
9731 self
9732 }
9733
9734 /// Sets the value of [update_partition_filter][crate::model::compilation_result_action::relation::IncrementalTableConfig::update_partition_filter].
9735 ///
9736 /// # Example
9737 /// ```ignore,no_run
9738 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9739 /// let x = IncrementalTableConfig::new().set_update_partition_filter("example");
9740 /// ```
9741 pub fn set_update_partition_filter<T: std::convert::Into<std::string::String>>(
9742 mut self,
9743 v: T,
9744 ) -> Self {
9745 self.update_partition_filter = v.into();
9746 self
9747 }
9748
9749 /// Sets the value of [incremental_pre_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_pre_operations].
9750 ///
9751 /// # Example
9752 /// ```ignore,no_run
9753 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9754 /// let x = IncrementalTableConfig::new().set_incremental_pre_operations(["a", "b", "c"]);
9755 /// ```
9756 pub fn set_incremental_pre_operations<T, V>(mut self, v: T) -> Self
9757 where
9758 T: std::iter::IntoIterator<Item = V>,
9759 V: std::convert::Into<std::string::String>,
9760 {
9761 use std::iter::Iterator;
9762 self.incremental_pre_operations = v.into_iter().map(|i| i.into()).collect();
9763 self
9764 }
9765
9766 /// Sets the value of [incremental_post_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_post_operations].
9767 ///
9768 /// # Example
9769 /// ```ignore,no_run
9770 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9771 /// let x = IncrementalTableConfig::new().set_incremental_post_operations(["a", "b", "c"]);
9772 /// ```
9773 pub fn set_incremental_post_operations<T, V>(mut self, v: T) -> Self
9774 where
9775 T: std::iter::IntoIterator<Item = V>,
9776 V: std::convert::Into<std::string::String>,
9777 {
9778 use std::iter::Iterator;
9779 self.incremental_post_operations = v.into_iter().map(|i| i.into()).collect();
9780 self
9781 }
9782 }
9783
9784 impl wkt::message::Message for IncrementalTableConfig {
9785 fn typename() -> &'static str {
9786 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation.IncrementalTableConfig"
9787 }
9788 }
9789
9790 /// Indicates the type of this relation.
9791 ///
9792 /// # Working with unknown values
9793 ///
9794 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9795 /// additional enum variants at any time. Adding new variants is not considered
9796 /// a breaking change. Applications should write their code in anticipation of:
9797 ///
9798 /// - New values appearing in future releases of the client library, **and**
9799 /// - New values received dynamically, without application changes.
9800 ///
9801 /// Please consult the [Working with enums] section in the user guide for some
9802 /// guidelines.
9803 ///
9804 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9805 #[derive(Clone, Debug, PartialEq)]
9806 #[non_exhaustive]
9807 pub enum RelationType {
9808 /// Default value. This value is unused.
9809 Unspecified,
9810 /// The relation is a table.
9811 Table,
9812 /// The relation is a view.
9813 View,
9814 /// The relation is an incrementalized table.
9815 IncrementalTable,
9816 /// The relation is a materialized view.
9817 MaterializedView,
9818 /// If set, the enum was initialized with an unknown value.
9819 ///
9820 /// Applications can examine the value using [RelationType::value] or
9821 /// [RelationType::name].
9822 UnknownValue(relation_type::UnknownValue),
9823 }
9824
9825 #[doc(hidden)]
9826 pub mod relation_type {
9827 #[allow(unused_imports)]
9828 use super::*;
9829 #[derive(Clone, Debug, PartialEq)]
9830 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9831 }
9832
9833 impl RelationType {
9834 /// Gets the enum value.
9835 ///
9836 /// Returns `None` if the enum contains an unknown value deserialized from
9837 /// the string representation of enums.
9838 pub fn value(&self) -> std::option::Option<i32> {
9839 match self {
9840 Self::Unspecified => std::option::Option::Some(0),
9841 Self::Table => std::option::Option::Some(1),
9842 Self::View => std::option::Option::Some(2),
9843 Self::IncrementalTable => std::option::Option::Some(3),
9844 Self::MaterializedView => std::option::Option::Some(4),
9845 Self::UnknownValue(u) => u.0.value(),
9846 }
9847 }
9848
9849 /// Gets the enum value as a string.
9850 ///
9851 /// Returns `None` if the enum contains an unknown value deserialized from
9852 /// the integer representation of enums.
9853 pub fn name(&self) -> std::option::Option<&str> {
9854 match self {
9855 Self::Unspecified => std::option::Option::Some("RELATION_TYPE_UNSPECIFIED"),
9856 Self::Table => std::option::Option::Some("TABLE"),
9857 Self::View => std::option::Option::Some("VIEW"),
9858 Self::IncrementalTable => std::option::Option::Some("INCREMENTAL_TABLE"),
9859 Self::MaterializedView => std::option::Option::Some("MATERIALIZED_VIEW"),
9860 Self::UnknownValue(u) => u.0.name(),
9861 }
9862 }
9863 }
9864
9865 impl std::default::Default for RelationType {
9866 fn default() -> Self {
9867 use std::convert::From;
9868 Self::from(0)
9869 }
9870 }
9871
9872 impl std::fmt::Display for RelationType {
9873 fn fmt(
9874 &self,
9875 f: &mut std::fmt::Formatter<'_>,
9876 ) -> std::result::Result<(), std::fmt::Error> {
9877 wkt::internal::display_enum(f, self.name(), self.value())
9878 }
9879 }
9880
9881 impl std::convert::From<i32> for RelationType {
9882 fn from(value: i32) -> Self {
9883 match value {
9884 0 => Self::Unspecified,
9885 1 => Self::Table,
9886 2 => Self::View,
9887 3 => Self::IncrementalTable,
9888 4 => Self::MaterializedView,
9889 _ => Self::UnknownValue(relation_type::UnknownValue(
9890 wkt::internal::UnknownEnumValue::Integer(value),
9891 )),
9892 }
9893 }
9894 }
9895
9896 impl std::convert::From<&str> for RelationType {
9897 fn from(value: &str) -> Self {
9898 use std::string::ToString;
9899 match value {
9900 "RELATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9901 "TABLE" => Self::Table,
9902 "VIEW" => Self::View,
9903 "INCREMENTAL_TABLE" => Self::IncrementalTable,
9904 "MATERIALIZED_VIEW" => Self::MaterializedView,
9905 _ => Self::UnknownValue(relation_type::UnknownValue(
9906 wkt::internal::UnknownEnumValue::String(value.to_string()),
9907 )),
9908 }
9909 }
9910 }
9911
9912 impl serde::ser::Serialize for RelationType {
9913 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9914 where
9915 S: serde::Serializer,
9916 {
9917 match self {
9918 Self::Unspecified => serializer.serialize_i32(0),
9919 Self::Table => serializer.serialize_i32(1),
9920 Self::View => serializer.serialize_i32(2),
9921 Self::IncrementalTable => serializer.serialize_i32(3),
9922 Self::MaterializedView => serializer.serialize_i32(4),
9923 Self::UnknownValue(u) => u.0.serialize(serializer),
9924 }
9925 }
9926 }
9927
9928 impl<'de> serde::de::Deserialize<'de> for RelationType {
9929 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9930 where
9931 D: serde::Deserializer<'de>,
9932 {
9933 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelationType>::new(
9934 ".google.cloud.dataform.v1.CompilationResultAction.Relation.RelationType",
9935 ))
9936 }
9937 }
9938
9939 /// Supported table formats for BigQuery tables.
9940 ///
9941 /// # Working with unknown values
9942 ///
9943 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9944 /// additional enum variants at any time. Adding new variants is not considered
9945 /// a breaking change. Applications should write their code in anticipation of:
9946 ///
9947 /// - New values appearing in future releases of the client library, **and**
9948 /// - New values received dynamically, without application changes.
9949 ///
9950 /// Please consult the [Working with enums] section in the user guide for some
9951 /// guidelines.
9952 ///
9953 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9954 #[derive(Clone, Debug, PartialEq)]
9955 #[non_exhaustive]
9956 pub enum TableFormat {
9957 /// Default value.
9958 Unspecified,
9959 /// Apache Iceberg format.
9960 Iceberg,
9961 /// If set, the enum was initialized with an unknown value.
9962 ///
9963 /// Applications can examine the value using [TableFormat::value] or
9964 /// [TableFormat::name].
9965 UnknownValue(table_format::UnknownValue),
9966 }
9967
9968 #[doc(hidden)]
9969 pub mod table_format {
9970 #[allow(unused_imports)]
9971 use super::*;
9972 #[derive(Clone, Debug, PartialEq)]
9973 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9974 }
9975
9976 impl TableFormat {
9977 /// Gets the enum value.
9978 ///
9979 /// Returns `None` if the enum contains an unknown value deserialized from
9980 /// the string representation of enums.
9981 pub fn value(&self) -> std::option::Option<i32> {
9982 match self {
9983 Self::Unspecified => std::option::Option::Some(0),
9984 Self::Iceberg => std::option::Option::Some(1),
9985 Self::UnknownValue(u) => u.0.value(),
9986 }
9987 }
9988
9989 /// Gets the enum value as a string.
9990 ///
9991 /// Returns `None` if the enum contains an unknown value deserialized from
9992 /// the integer representation of enums.
9993 pub fn name(&self) -> std::option::Option<&str> {
9994 match self {
9995 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
9996 Self::Iceberg => std::option::Option::Some("ICEBERG"),
9997 Self::UnknownValue(u) => u.0.name(),
9998 }
9999 }
10000 }
10001
10002 impl std::default::Default for TableFormat {
10003 fn default() -> Self {
10004 use std::convert::From;
10005 Self::from(0)
10006 }
10007 }
10008
10009 impl std::fmt::Display for TableFormat {
10010 fn fmt(
10011 &self,
10012 f: &mut std::fmt::Formatter<'_>,
10013 ) -> std::result::Result<(), std::fmt::Error> {
10014 wkt::internal::display_enum(f, self.name(), self.value())
10015 }
10016 }
10017
10018 impl std::convert::From<i32> for TableFormat {
10019 fn from(value: i32) -> Self {
10020 match value {
10021 0 => Self::Unspecified,
10022 1 => Self::Iceberg,
10023 _ => Self::UnknownValue(table_format::UnknownValue(
10024 wkt::internal::UnknownEnumValue::Integer(value),
10025 )),
10026 }
10027 }
10028 }
10029
10030 impl std::convert::From<&str> for TableFormat {
10031 fn from(value: &str) -> Self {
10032 use std::string::ToString;
10033 match value {
10034 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
10035 "ICEBERG" => Self::Iceberg,
10036 _ => Self::UnknownValue(table_format::UnknownValue(
10037 wkt::internal::UnknownEnumValue::String(value.to_string()),
10038 )),
10039 }
10040 }
10041 }
10042
10043 impl serde::ser::Serialize for TableFormat {
10044 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10045 where
10046 S: serde::Serializer,
10047 {
10048 match self {
10049 Self::Unspecified => serializer.serialize_i32(0),
10050 Self::Iceberg => serializer.serialize_i32(1),
10051 Self::UnknownValue(u) => u.0.serialize(serializer),
10052 }
10053 }
10054 }
10055
10056 impl<'de> serde::de::Deserialize<'de> for TableFormat {
10057 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10058 where
10059 D: serde::Deserializer<'de>,
10060 {
10061 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
10062 ".google.cloud.dataform.v1.CompilationResultAction.Relation.TableFormat",
10063 ))
10064 }
10065 }
10066
10067 /// Supported file formats for BigQuery tables.
10068 ///
10069 /// # Working with unknown values
10070 ///
10071 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10072 /// additional enum variants at any time. Adding new variants is not considered
10073 /// a breaking change. Applications should write their code in anticipation of:
10074 ///
10075 /// - New values appearing in future releases of the client library, **and**
10076 /// - New values received dynamically, without application changes.
10077 ///
10078 /// Please consult the [Working with enums] section in the user guide for some
10079 /// guidelines.
10080 ///
10081 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10082 #[derive(Clone, Debug, PartialEq)]
10083 #[non_exhaustive]
10084 pub enum FileFormat {
10085 /// Default value.
10086 Unspecified,
10087 /// Apache Parquet format.
10088 Parquet,
10089 /// If set, the enum was initialized with an unknown value.
10090 ///
10091 /// Applications can examine the value using [FileFormat::value] or
10092 /// [FileFormat::name].
10093 UnknownValue(file_format::UnknownValue),
10094 }
10095
10096 #[doc(hidden)]
10097 pub mod file_format {
10098 #[allow(unused_imports)]
10099 use super::*;
10100 #[derive(Clone, Debug, PartialEq)]
10101 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10102 }
10103
10104 impl FileFormat {
10105 /// Gets the enum value.
10106 ///
10107 /// Returns `None` if the enum contains an unknown value deserialized from
10108 /// the string representation of enums.
10109 pub fn value(&self) -> std::option::Option<i32> {
10110 match self {
10111 Self::Unspecified => std::option::Option::Some(0),
10112 Self::Parquet => std::option::Option::Some(1),
10113 Self::UnknownValue(u) => u.0.value(),
10114 }
10115 }
10116
10117 /// Gets the enum value as a string.
10118 ///
10119 /// Returns `None` if the enum contains an unknown value deserialized from
10120 /// the integer representation of enums.
10121 pub fn name(&self) -> std::option::Option<&str> {
10122 match self {
10123 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
10124 Self::Parquet => std::option::Option::Some("PARQUET"),
10125 Self::UnknownValue(u) => u.0.name(),
10126 }
10127 }
10128 }
10129
10130 impl std::default::Default for FileFormat {
10131 fn default() -> Self {
10132 use std::convert::From;
10133 Self::from(0)
10134 }
10135 }
10136
10137 impl std::fmt::Display for FileFormat {
10138 fn fmt(
10139 &self,
10140 f: &mut std::fmt::Formatter<'_>,
10141 ) -> std::result::Result<(), std::fmt::Error> {
10142 wkt::internal::display_enum(f, self.name(), self.value())
10143 }
10144 }
10145
10146 impl std::convert::From<i32> for FileFormat {
10147 fn from(value: i32) -> Self {
10148 match value {
10149 0 => Self::Unspecified,
10150 1 => Self::Parquet,
10151 _ => Self::UnknownValue(file_format::UnknownValue(
10152 wkt::internal::UnknownEnumValue::Integer(value),
10153 )),
10154 }
10155 }
10156 }
10157
10158 impl std::convert::From<&str> for FileFormat {
10159 fn from(value: &str) -> Self {
10160 use std::string::ToString;
10161 match value {
10162 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
10163 "PARQUET" => Self::Parquet,
10164 _ => Self::UnknownValue(file_format::UnknownValue(
10165 wkt::internal::UnknownEnumValue::String(value.to_string()),
10166 )),
10167 }
10168 }
10169 }
10170
10171 impl serde::ser::Serialize for FileFormat {
10172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10173 where
10174 S: serde::Serializer,
10175 {
10176 match self {
10177 Self::Unspecified => serializer.serialize_i32(0),
10178 Self::Parquet => serializer.serialize_i32(1),
10179 Self::UnknownValue(u) => u.0.serialize(serializer),
10180 }
10181 }
10182 }
10183
10184 impl<'de> serde::de::Deserialize<'de> for FileFormat {
10185 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10186 where
10187 D: serde::Deserializer<'de>,
10188 {
10189 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
10190 ".google.cloud.dataform.v1.CompilationResultAction.Relation.FileFormat",
10191 ))
10192 }
10193 }
10194 }
10195
10196 /// Represents a list of arbitrary database operations.
10197 #[derive(Clone, Default, PartialEq)]
10198 #[non_exhaustive]
10199 pub struct Operations {
10200 /// A list of actions that this action depends on.
10201 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10202
10203 /// Whether this action is disabled (i.e. should not be run).
10204 pub disabled: bool,
10205
10206 /// Arbitrary, user-defined tags on this action.
10207 pub tags: std::vec::Vec<std::string::String>,
10208
10209 /// Descriptor for any output relation and its columns. Only set if
10210 /// `has_output` is true.
10211 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10212
10213 /// A list of arbitrary SQL statements that will be executed without
10214 /// alteration.
10215 pub queries: std::vec::Vec<std::string::String>,
10216
10217 /// Whether these operations produce an output relation.
10218 pub has_output: bool,
10219
10220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10221 }
10222
10223 impl Operations {
10224 /// Creates a new default instance.
10225 pub fn new() -> Self {
10226 std::default::Default::default()
10227 }
10228
10229 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Operations::dependency_targets].
10230 ///
10231 /// # Example
10232 /// ```ignore,no_run
10233 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10234 /// use google_cloud_dataform_v1::model::Target;
10235 /// let x = Operations::new()
10236 /// .set_dependency_targets([
10237 /// Target::default()/* use setters */,
10238 /// Target::default()/* use (different) setters */,
10239 /// ]);
10240 /// ```
10241 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10242 where
10243 T: std::iter::IntoIterator<Item = V>,
10244 V: std::convert::Into<crate::model::Target>,
10245 {
10246 use std::iter::Iterator;
10247 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10248 self
10249 }
10250
10251 /// Sets the value of [disabled][crate::model::compilation_result_action::Operations::disabled].
10252 ///
10253 /// # Example
10254 /// ```ignore,no_run
10255 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10256 /// let x = Operations::new().set_disabled(true);
10257 /// ```
10258 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10259 self.disabled = v.into();
10260 self
10261 }
10262
10263 /// Sets the value of [tags][crate::model::compilation_result_action::Operations::tags].
10264 ///
10265 /// # Example
10266 /// ```ignore,no_run
10267 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10268 /// let x = Operations::new().set_tags(["a", "b", "c"]);
10269 /// ```
10270 pub fn set_tags<T, V>(mut self, v: T) -> Self
10271 where
10272 T: std::iter::IntoIterator<Item = V>,
10273 V: std::convert::Into<std::string::String>,
10274 {
10275 use std::iter::Iterator;
10276 self.tags = v.into_iter().map(|i| i.into()).collect();
10277 self
10278 }
10279
10280 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
10281 ///
10282 /// # Example
10283 /// ```ignore,no_run
10284 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10285 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10286 /// let x = Operations::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10287 /// ```
10288 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10289 where
10290 T: std::convert::Into<crate::model::RelationDescriptor>,
10291 {
10292 self.relation_descriptor = std::option::Option::Some(v.into());
10293 self
10294 }
10295
10296 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
10297 ///
10298 /// # Example
10299 /// ```ignore,no_run
10300 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10301 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10302 /// let x = Operations::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10303 /// let x = Operations::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10304 /// ```
10305 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10306 where
10307 T: std::convert::Into<crate::model::RelationDescriptor>,
10308 {
10309 self.relation_descriptor = v.map(|x| x.into());
10310 self
10311 }
10312
10313 /// Sets the value of [queries][crate::model::compilation_result_action::Operations::queries].
10314 ///
10315 /// # Example
10316 /// ```ignore,no_run
10317 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10318 /// let x = Operations::new().set_queries(["a", "b", "c"]);
10319 /// ```
10320 pub fn set_queries<T, V>(mut self, v: T) -> Self
10321 where
10322 T: std::iter::IntoIterator<Item = V>,
10323 V: std::convert::Into<std::string::String>,
10324 {
10325 use std::iter::Iterator;
10326 self.queries = v.into_iter().map(|i| i.into()).collect();
10327 self
10328 }
10329
10330 /// Sets the value of [has_output][crate::model::compilation_result_action::Operations::has_output].
10331 ///
10332 /// # Example
10333 /// ```ignore,no_run
10334 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10335 /// let x = Operations::new().set_has_output(true);
10336 /// ```
10337 pub fn set_has_output<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10338 self.has_output = v.into();
10339 self
10340 }
10341 }
10342
10343 impl wkt::message::Message for Operations {
10344 fn typename() -> &'static str {
10345 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Operations"
10346 }
10347 }
10348
10349 /// Represents an assertion upon a SQL query which is required return zero
10350 /// rows.
10351 #[derive(Clone, Default, PartialEq)]
10352 #[non_exhaustive]
10353 pub struct Assertion {
10354 /// A list of actions that this action depends on.
10355 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10356
10357 /// The parent action of this assertion. Only set if this assertion was
10358 /// automatically generated.
10359 pub parent_action: std::option::Option<crate::model::Target>,
10360
10361 /// Whether this action is disabled (i.e. should not be run).
10362 pub disabled: bool,
10363
10364 /// Arbitrary, user-defined tags on this action.
10365 pub tags: std::vec::Vec<std::string::String>,
10366
10367 /// The SELECT query which must return zero rows in order for this assertion
10368 /// to succeed.
10369 pub select_query: std::string::String,
10370
10371 /// Descriptor for the assertion's automatically-generated view and its
10372 /// columns.
10373 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10374
10375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10376 }
10377
10378 impl Assertion {
10379 /// Creates a new default instance.
10380 pub fn new() -> Self {
10381 std::default::Default::default()
10382 }
10383
10384 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Assertion::dependency_targets].
10385 ///
10386 /// # Example
10387 /// ```ignore,no_run
10388 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10389 /// use google_cloud_dataform_v1::model::Target;
10390 /// let x = Assertion::new()
10391 /// .set_dependency_targets([
10392 /// Target::default()/* use setters */,
10393 /// Target::default()/* use (different) setters */,
10394 /// ]);
10395 /// ```
10396 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10397 where
10398 T: std::iter::IntoIterator<Item = V>,
10399 V: std::convert::Into<crate::model::Target>,
10400 {
10401 use std::iter::Iterator;
10402 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10403 self
10404 }
10405
10406 /// Sets the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
10407 ///
10408 /// # Example
10409 /// ```ignore,no_run
10410 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10411 /// use google_cloud_dataform_v1::model::Target;
10412 /// let x = Assertion::new().set_parent_action(Target::default()/* use setters */);
10413 /// ```
10414 pub fn set_parent_action<T>(mut self, v: T) -> Self
10415 where
10416 T: std::convert::Into<crate::model::Target>,
10417 {
10418 self.parent_action = std::option::Option::Some(v.into());
10419 self
10420 }
10421
10422 /// Sets or clears the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
10423 ///
10424 /// # Example
10425 /// ```ignore,no_run
10426 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10427 /// use google_cloud_dataform_v1::model::Target;
10428 /// let x = Assertion::new().set_or_clear_parent_action(Some(Target::default()/* use setters */));
10429 /// let x = Assertion::new().set_or_clear_parent_action(None::<Target>);
10430 /// ```
10431 pub fn set_or_clear_parent_action<T>(mut self, v: std::option::Option<T>) -> Self
10432 where
10433 T: std::convert::Into<crate::model::Target>,
10434 {
10435 self.parent_action = v.map(|x| x.into());
10436 self
10437 }
10438
10439 /// Sets the value of [disabled][crate::model::compilation_result_action::Assertion::disabled].
10440 ///
10441 /// # Example
10442 /// ```ignore,no_run
10443 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10444 /// let x = Assertion::new().set_disabled(true);
10445 /// ```
10446 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10447 self.disabled = v.into();
10448 self
10449 }
10450
10451 /// Sets the value of [tags][crate::model::compilation_result_action::Assertion::tags].
10452 ///
10453 /// # Example
10454 /// ```ignore,no_run
10455 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10456 /// let x = Assertion::new().set_tags(["a", "b", "c"]);
10457 /// ```
10458 pub fn set_tags<T, V>(mut self, v: T) -> Self
10459 where
10460 T: std::iter::IntoIterator<Item = V>,
10461 V: std::convert::Into<std::string::String>,
10462 {
10463 use std::iter::Iterator;
10464 self.tags = v.into_iter().map(|i| i.into()).collect();
10465 self
10466 }
10467
10468 /// Sets the value of [select_query][crate::model::compilation_result_action::Assertion::select_query].
10469 ///
10470 /// # Example
10471 /// ```ignore,no_run
10472 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10473 /// let x = Assertion::new().set_select_query("example");
10474 /// ```
10475 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
10476 mut self,
10477 v: T,
10478 ) -> Self {
10479 self.select_query = v.into();
10480 self
10481 }
10482
10483 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
10484 ///
10485 /// # Example
10486 /// ```ignore,no_run
10487 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10488 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10489 /// let x = Assertion::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10490 /// ```
10491 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10492 where
10493 T: std::convert::Into<crate::model::RelationDescriptor>,
10494 {
10495 self.relation_descriptor = std::option::Option::Some(v.into());
10496 self
10497 }
10498
10499 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
10500 ///
10501 /// # Example
10502 /// ```ignore,no_run
10503 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10504 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10505 /// let x = Assertion::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10506 /// let x = Assertion::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10507 /// ```
10508 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10509 where
10510 T: std::convert::Into<crate::model::RelationDescriptor>,
10511 {
10512 self.relation_descriptor = v.map(|x| x.into());
10513 self
10514 }
10515 }
10516
10517 impl wkt::message::Message for Assertion {
10518 fn typename() -> &'static str {
10519 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Assertion"
10520 }
10521 }
10522
10523 /// Represents a relation which is not managed by Dataform but which may be
10524 /// referenced by Dataform actions.
10525 #[derive(Clone, Default, PartialEq)]
10526 #[non_exhaustive]
10527 pub struct Declaration {
10528 /// Descriptor for the relation and its columns. Used as documentation only,
10529 /// i.e. values here will result in no changes to the relation's metadata.
10530 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10531
10532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10533 }
10534
10535 impl Declaration {
10536 /// Creates a new default instance.
10537 pub fn new() -> Self {
10538 std::default::Default::default()
10539 }
10540
10541 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
10542 ///
10543 /// # Example
10544 /// ```ignore,no_run
10545 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
10546 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10547 /// let x = Declaration::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10548 /// ```
10549 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10550 where
10551 T: std::convert::Into<crate::model::RelationDescriptor>,
10552 {
10553 self.relation_descriptor = std::option::Option::Some(v.into());
10554 self
10555 }
10556
10557 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
10558 ///
10559 /// # Example
10560 /// ```ignore,no_run
10561 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
10562 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10563 /// let x = Declaration::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10564 /// let x = Declaration::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10565 /// ```
10566 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10567 where
10568 T: std::convert::Into<crate::model::RelationDescriptor>,
10569 {
10570 self.relation_descriptor = v.map(|x| x.into());
10571 self
10572 }
10573 }
10574
10575 impl wkt::message::Message for Declaration {
10576 fn typename() -> &'static str {
10577 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Declaration"
10578 }
10579 }
10580
10581 /// Represents a notebook.
10582 #[derive(Clone, Default, PartialEq)]
10583 #[non_exhaustive]
10584 pub struct Notebook {
10585 /// A list of actions that this action depends on.
10586 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10587
10588 /// Whether this action is disabled (i.e. should not be run).
10589 pub disabled: bool,
10590
10591 /// The contents of the notebook.
10592 pub contents: std::string::String,
10593
10594 /// Arbitrary, user-defined tags on this action.
10595 pub tags: std::vec::Vec<std::string::String>,
10596
10597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10598 }
10599
10600 impl Notebook {
10601 /// Creates a new default instance.
10602 pub fn new() -> Self {
10603 std::default::Default::default()
10604 }
10605
10606 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Notebook::dependency_targets].
10607 ///
10608 /// # Example
10609 /// ```ignore,no_run
10610 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10611 /// use google_cloud_dataform_v1::model::Target;
10612 /// let x = Notebook::new()
10613 /// .set_dependency_targets([
10614 /// Target::default()/* use setters */,
10615 /// Target::default()/* use (different) setters */,
10616 /// ]);
10617 /// ```
10618 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10619 where
10620 T: std::iter::IntoIterator<Item = V>,
10621 V: std::convert::Into<crate::model::Target>,
10622 {
10623 use std::iter::Iterator;
10624 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10625 self
10626 }
10627
10628 /// Sets the value of [disabled][crate::model::compilation_result_action::Notebook::disabled].
10629 ///
10630 /// # Example
10631 /// ```ignore,no_run
10632 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10633 /// let x = Notebook::new().set_disabled(true);
10634 /// ```
10635 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10636 self.disabled = v.into();
10637 self
10638 }
10639
10640 /// Sets the value of [contents][crate::model::compilation_result_action::Notebook::contents].
10641 ///
10642 /// # Example
10643 /// ```ignore,no_run
10644 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10645 /// let x = Notebook::new().set_contents("example");
10646 /// ```
10647 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10648 self.contents = v.into();
10649 self
10650 }
10651
10652 /// Sets the value of [tags][crate::model::compilation_result_action::Notebook::tags].
10653 ///
10654 /// # Example
10655 /// ```ignore,no_run
10656 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10657 /// let x = Notebook::new().set_tags(["a", "b", "c"]);
10658 /// ```
10659 pub fn set_tags<T, V>(mut self, v: T) -> Self
10660 where
10661 T: std::iter::IntoIterator<Item = V>,
10662 V: std::convert::Into<std::string::String>,
10663 {
10664 use std::iter::Iterator;
10665 self.tags = v.into_iter().map(|i| i.into()).collect();
10666 self
10667 }
10668 }
10669
10670 impl wkt::message::Message for Notebook {
10671 fn typename() -> &'static str {
10672 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Notebook"
10673 }
10674 }
10675
10676 /// Defines a compiled Data Preparation entity
10677 #[derive(Clone, Default, PartialEq)]
10678 #[non_exhaustive]
10679 pub struct DataPreparation {
10680 /// A list of actions that this action depends on.
10681 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10682
10683 /// Whether this action is disabled (i.e. should not be run).
10684 pub disabled: bool,
10685
10686 /// Arbitrary, user-defined tags on this action.
10687 pub tags: std::vec::Vec<std::string::String>,
10688
10689 /// The definition for the data preparation.
10690 pub definition: std::option::Option<
10691 crate::model::compilation_result_action::data_preparation::Definition,
10692 >,
10693
10694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10695 }
10696
10697 impl DataPreparation {
10698 /// Creates a new default instance.
10699 pub fn new() -> Self {
10700 std::default::Default::default()
10701 }
10702
10703 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::DataPreparation::dependency_targets].
10704 ///
10705 /// # Example
10706 /// ```ignore,no_run
10707 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10708 /// use google_cloud_dataform_v1::model::Target;
10709 /// let x = DataPreparation::new()
10710 /// .set_dependency_targets([
10711 /// Target::default()/* use setters */,
10712 /// Target::default()/* use (different) setters */,
10713 /// ]);
10714 /// ```
10715 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10716 where
10717 T: std::iter::IntoIterator<Item = V>,
10718 V: std::convert::Into<crate::model::Target>,
10719 {
10720 use std::iter::Iterator;
10721 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10722 self
10723 }
10724
10725 /// Sets the value of [disabled][crate::model::compilation_result_action::DataPreparation::disabled].
10726 ///
10727 /// # Example
10728 /// ```ignore,no_run
10729 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10730 /// let x = DataPreparation::new().set_disabled(true);
10731 /// ```
10732 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10733 self.disabled = v.into();
10734 self
10735 }
10736
10737 /// Sets the value of [tags][crate::model::compilation_result_action::DataPreparation::tags].
10738 ///
10739 /// # Example
10740 /// ```ignore,no_run
10741 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10742 /// let x = DataPreparation::new().set_tags(["a", "b", "c"]);
10743 /// ```
10744 pub fn set_tags<T, V>(mut self, v: T) -> Self
10745 where
10746 T: std::iter::IntoIterator<Item = V>,
10747 V: std::convert::Into<std::string::String>,
10748 {
10749 use std::iter::Iterator;
10750 self.tags = v.into_iter().map(|i| i.into()).collect();
10751 self
10752 }
10753
10754 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition].
10755 ///
10756 /// Note that all the setters affecting `definition` are mutually
10757 /// exclusive.
10758 ///
10759 /// # Example
10760 /// ```ignore,no_run
10761 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10762 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::Definition;
10763 /// let x = DataPreparation::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
10764 /// ```
10765 pub fn set_definition<
10766 T: std::convert::Into<
10767 std::option::Option<
10768 crate::model::compilation_result_action::data_preparation::Definition,
10769 >,
10770 >,
10771 >(
10772 mut self,
10773 v: T,
10774 ) -> Self {
10775 self.definition = v.into();
10776 self
10777 }
10778
10779 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10780 /// if it holds a `ContentsYaml`, `None` if the field is not set or
10781 /// holds a different branch.
10782 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
10783 #[allow(unreachable_patterns)]
10784 self.definition.as_ref().and_then(|v| match v {
10785 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(v) => std::option::Option::Some(v),
10786 _ => std::option::Option::None,
10787 })
10788 }
10789
10790 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10791 /// to hold a `ContentsYaml`.
10792 ///
10793 /// Note that all the setters affecting `definition` are
10794 /// mutually exclusive.
10795 ///
10796 /// # Example
10797 /// ```ignore,no_run
10798 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10799 /// let x = DataPreparation::new().set_contents_yaml("example");
10800 /// assert!(x.contents_yaml().is_some());
10801 /// assert!(x.contents_sql().is_none());
10802 /// ```
10803 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
10804 mut self,
10805 v: T,
10806 ) -> Self {
10807 self.definition = std::option::Option::Some(
10808 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(
10809 v.into(),
10810 ),
10811 );
10812 self
10813 }
10814
10815 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10816 /// if it holds a `ContentsSql`, `None` if the field is not set or
10817 /// holds a different branch.
10818 pub fn contents_sql(
10819 &self,
10820 ) -> std::option::Option<
10821 &std::boxed::Box<
10822 crate::model::compilation_result_action::data_preparation::SqlDefinition,
10823 >,
10824 > {
10825 #[allow(unreachable_patterns)]
10826 self.definition.as_ref().and_then(|v| match v {
10827 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(v) => std::option::Option::Some(v),
10828 _ => std::option::Option::None,
10829 })
10830 }
10831
10832 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10833 /// to hold a `ContentsSql`.
10834 ///
10835 /// Note that all the setters affecting `definition` are
10836 /// mutually exclusive.
10837 ///
10838 /// # Example
10839 /// ```ignore,no_run
10840 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10841 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10842 /// let x = DataPreparation::new().set_contents_sql(SqlDefinition::default()/* use setters */);
10843 /// assert!(x.contents_sql().is_some());
10844 /// assert!(x.contents_yaml().is_none());
10845 /// ```
10846 pub fn set_contents_sql<
10847 T: std::convert::Into<
10848 std::boxed::Box<
10849 crate::model::compilation_result_action::data_preparation::SqlDefinition,
10850 >,
10851 >,
10852 >(
10853 mut self,
10854 v: T,
10855 ) -> Self {
10856 self.definition = std::option::Option::Some(
10857 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(
10858 v.into(),
10859 ),
10860 );
10861 self
10862 }
10863 }
10864
10865 impl wkt::message::Message for DataPreparation {
10866 fn typename() -> &'static str {
10867 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation"
10868 }
10869 }
10870
10871 /// Defines additional types related to [DataPreparation].
10872 pub mod data_preparation {
10873 #[allow(unused_imports)]
10874 use super::*;
10875
10876 /// Definition of a SQL Data Preparation
10877 #[derive(Clone, Default, PartialEq)]
10878 #[non_exhaustive]
10879 pub struct SqlDefinition {
10880 /// The SQL query representing the data preparation steps. Formatted as a
10881 /// Pipe SQL query statement.
10882 pub query: std::string::String,
10883
10884 /// Error table configuration,
10885 pub error_table: std::option::Option<
10886 crate::model::compilation_result_action::data_preparation::ErrorTable,
10887 >,
10888
10889 /// Load configuration.
10890 pub load: std::option::Option<crate::model::compilation_result_action::LoadConfig>,
10891
10892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10893 }
10894
10895 impl SqlDefinition {
10896 /// Creates a new default instance.
10897 pub fn new() -> Self {
10898 std::default::Default::default()
10899 }
10900
10901 /// Sets the value of [query][crate::model::compilation_result_action::data_preparation::SqlDefinition::query].
10902 ///
10903 /// # Example
10904 /// ```ignore,no_run
10905 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10906 /// let x = SqlDefinition::new().set_query("example");
10907 /// ```
10908 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10909 self.query = v.into();
10910 self
10911 }
10912
10913 /// Sets the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
10914 ///
10915 /// # Example
10916 /// ```ignore,no_run
10917 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10918 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10919 /// let x = SqlDefinition::new().set_error_table(ErrorTable::default()/* use setters */);
10920 /// ```
10921 pub fn set_error_table<T>(mut self, v: T) -> Self
10922 where
10923 T: std::convert::Into<
10924 crate::model::compilation_result_action::data_preparation::ErrorTable,
10925 >,
10926 {
10927 self.error_table = std::option::Option::Some(v.into());
10928 self
10929 }
10930
10931 /// Sets or clears the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
10932 ///
10933 /// # Example
10934 /// ```ignore,no_run
10935 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10936 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10937 /// let x = SqlDefinition::new().set_or_clear_error_table(Some(ErrorTable::default()/* use setters */));
10938 /// let x = SqlDefinition::new().set_or_clear_error_table(None::<ErrorTable>);
10939 /// ```
10940 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
10941 where
10942 T: std::convert::Into<
10943 crate::model::compilation_result_action::data_preparation::ErrorTable,
10944 >,
10945 {
10946 self.error_table = v.map(|x| x.into());
10947 self
10948 }
10949
10950 /// Sets the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
10951 ///
10952 /// # Example
10953 /// ```ignore,no_run
10954 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10955 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10956 /// let x = SqlDefinition::new().set_load(LoadConfig::default()/* use setters */);
10957 /// ```
10958 pub fn set_load<T>(mut self, v: T) -> Self
10959 where
10960 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
10961 {
10962 self.load = std::option::Option::Some(v.into());
10963 self
10964 }
10965
10966 /// Sets or clears the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
10967 ///
10968 /// # Example
10969 /// ```ignore,no_run
10970 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10971 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10972 /// let x = SqlDefinition::new().set_or_clear_load(Some(LoadConfig::default()/* use setters */));
10973 /// let x = SqlDefinition::new().set_or_clear_load(None::<LoadConfig>);
10974 /// ```
10975 pub fn set_or_clear_load<T>(mut self, v: std::option::Option<T>) -> Self
10976 where
10977 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
10978 {
10979 self.load = v.map(|x| x.into());
10980 self
10981 }
10982 }
10983
10984 impl wkt::message::Message for SqlDefinition {
10985 fn typename() -> &'static str {
10986 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.SqlDefinition"
10987 }
10988 }
10989
10990 /// Error table information, used to write error data into a BigQuery
10991 /// table.
10992 #[derive(Clone, Default, PartialEq)]
10993 #[non_exhaustive]
10994 pub struct ErrorTable {
10995 /// Error Table target.
10996 pub target: std::option::Option<crate::model::Target>,
10997
10998 /// Error table partition expiration in days. Only positive values are
10999 /// allowed.
11000 pub retention_days: i32,
11001
11002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11003 }
11004
11005 impl ErrorTable {
11006 /// Creates a new default instance.
11007 pub fn new() -> Self {
11008 std::default::Default::default()
11009 }
11010
11011 /// Sets the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
11012 ///
11013 /// # Example
11014 /// ```ignore,no_run
11015 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11016 /// use google_cloud_dataform_v1::model::Target;
11017 /// let x = ErrorTable::new().set_target(Target::default()/* use setters */);
11018 /// ```
11019 pub fn set_target<T>(mut self, v: T) -> Self
11020 where
11021 T: std::convert::Into<crate::model::Target>,
11022 {
11023 self.target = std::option::Option::Some(v.into());
11024 self
11025 }
11026
11027 /// Sets or clears the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
11028 ///
11029 /// # Example
11030 /// ```ignore,no_run
11031 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11032 /// use google_cloud_dataform_v1::model::Target;
11033 /// let x = ErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
11034 /// let x = ErrorTable::new().set_or_clear_target(None::<Target>);
11035 /// ```
11036 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
11037 where
11038 T: std::convert::Into<crate::model::Target>,
11039 {
11040 self.target = v.map(|x| x.into());
11041 self
11042 }
11043
11044 /// Sets the value of [retention_days][crate::model::compilation_result_action::data_preparation::ErrorTable::retention_days].
11045 ///
11046 /// # Example
11047 /// ```ignore,no_run
11048 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11049 /// let x = ErrorTable::new().set_retention_days(42);
11050 /// ```
11051 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11052 self.retention_days = v.into();
11053 self
11054 }
11055 }
11056
11057 impl wkt::message::Message for ErrorTable {
11058 fn typename() -> &'static str {
11059 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.ErrorTable"
11060 }
11061 }
11062
11063 /// The definition for the data preparation.
11064 #[derive(Clone, Debug, PartialEq)]
11065 #[non_exhaustive]
11066 pub enum Definition {
11067 /// The data preparation definition, stored as a YAML string.
11068 ContentsYaml(std::string::String),
11069 /// SQL definition for a Data Preparation. Contains a SQL query and
11070 /// additional context information.
11071 ContentsSql(
11072 std::boxed::Box<
11073 crate::model::compilation_result_action::data_preparation::SqlDefinition,
11074 >,
11075 ),
11076 }
11077 }
11078
11079 /// Simplified load configuration for actions
11080 #[derive(Clone, Default, PartialEq)]
11081 #[non_exhaustive]
11082 pub struct LoadConfig {
11083 /// Load mode
11084 pub mode: std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
11085
11086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11087 }
11088
11089 impl LoadConfig {
11090 /// Creates a new default instance.
11091 pub fn new() -> Self {
11092 std::default::Default::default()
11093 }
11094
11095 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode].
11096 ///
11097 /// Note that all the setters affecting `mode` are mutually
11098 /// exclusive.
11099 ///
11100 /// # Example
11101 /// ```ignore,no_run
11102 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11103 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11104 /// let x = LoadConfig::new().set_mode(Some(
11105 /// google_cloud_dataform_v1::model::compilation_result_action::load_config::Mode::Replace(SimpleLoadMode::default().into())));
11106 /// ```
11107 pub fn set_mode<
11108 T: std::convert::Into<
11109 std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
11110 >,
11111 >(
11112 mut self,
11113 v: T,
11114 ) -> Self {
11115 self.mode = v.into();
11116 self
11117 }
11118
11119 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11120 /// if it holds a `Replace`, `None` if the field is not set or
11121 /// holds a different branch.
11122 pub fn replace(
11123 &self,
11124 ) -> std::option::Option<
11125 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11126 > {
11127 #[allow(unreachable_patterns)]
11128 self.mode.as_ref().and_then(|v| match v {
11129 crate::model::compilation_result_action::load_config::Mode::Replace(v) => {
11130 std::option::Option::Some(v)
11131 }
11132 _ => std::option::Option::None,
11133 })
11134 }
11135
11136 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11137 /// to hold a `Replace`.
11138 ///
11139 /// Note that all the setters affecting `mode` are
11140 /// mutually exclusive.
11141 ///
11142 /// # Example
11143 /// ```ignore,no_run
11144 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11145 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11146 /// let x = LoadConfig::new().set_replace(SimpleLoadMode::default()/* use setters */);
11147 /// assert!(x.replace().is_some());
11148 /// assert!(x.append().is_none());
11149 /// assert!(x.maximum().is_none());
11150 /// assert!(x.unique().is_none());
11151 /// ```
11152 pub fn set_replace<
11153 T: std::convert::Into<
11154 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11155 >,
11156 >(
11157 mut self,
11158 v: T,
11159 ) -> Self {
11160 self.mode = std::option::Option::Some(
11161 crate::model::compilation_result_action::load_config::Mode::Replace(v.into()),
11162 );
11163 self
11164 }
11165
11166 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11167 /// if it holds a `Append`, `None` if the field is not set or
11168 /// holds a different branch.
11169 pub fn append(
11170 &self,
11171 ) -> std::option::Option<
11172 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11173 > {
11174 #[allow(unreachable_patterns)]
11175 self.mode.as_ref().and_then(|v| match v {
11176 crate::model::compilation_result_action::load_config::Mode::Append(v) => {
11177 std::option::Option::Some(v)
11178 }
11179 _ => std::option::Option::None,
11180 })
11181 }
11182
11183 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11184 /// to hold a `Append`.
11185 ///
11186 /// Note that all the setters affecting `mode` are
11187 /// mutually exclusive.
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11192 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11193 /// let x = LoadConfig::new().set_append(SimpleLoadMode::default()/* use setters */);
11194 /// assert!(x.append().is_some());
11195 /// assert!(x.replace().is_none());
11196 /// assert!(x.maximum().is_none());
11197 /// assert!(x.unique().is_none());
11198 /// ```
11199 pub fn set_append<
11200 T: std::convert::Into<
11201 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11202 >,
11203 >(
11204 mut self,
11205 v: T,
11206 ) -> Self {
11207 self.mode = std::option::Option::Some(
11208 crate::model::compilation_result_action::load_config::Mode::Append(v.into()),
11209 );
11210 self
11211 }
11212
11213 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11214 /// if it holds a `Maximum`, `None` if the field is not set or
11215 /// holds a different branch.
11216 pub fn maximum(
11217 &self,
11218 ) -> std::option::Option<
11219 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11220 > {
11221 #[allow(unreachable_patterns)]
11222 self.mode.as_ref().and_then(|v| match v {
11223 crate::model::compilation_result_action::load_config::Mode::Maximum(v) => {
11224 std::option::Option::Some(v)
11225 }
11226 _ => std::option::Option::None,
11227 })
11228 }
11229
11230 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11231 /// to hold a `Maximum`.
11232 ///
11233 /// Note that all the setters affecting `mode` are
11234 /// mutually exclusive.
11235 ///
11236 /// # Example
11237 /// ```ignore,no_run
11238 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11239 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11240 /// let x = LoadConfig::new().set_maximum(IncrementalLoadMode::default()/* use setters */);
11241 /// assert!(x.maximum().is_some());
11242 /// assert!(x.replace().is_none());
11243 /// assert!(x.append().is_none());
11244 /// assert!(x.unique().is_none());
11245 /// ```
11246 pub fn set_maximum<
11247 T: std::convert::Into<
11248 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11249 >,
11250 >(
11251 mut self,
11252 v: T,
11253 ) -> Self {
11254 self.mode = std::option::Option::Some(
11255 crate::model::compilation_result_action::load_config::Mode::Maximum(v.into()),
11256 );
11257 self
11258 }
11259
11260 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11261 /// if it holds a `Unique`, `None` if the field is not set or
11262 /// holds a different branch.
11263 pub fn unique(
11264 &self,
11265 ) -> std::option::Option<
11266 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11267 > {
11268 #[allow(unreachable_patterns)]
11269 self.mode.as_ref().and_then(|v| match v {
11270 crate::model::compilation_result_action::load_config::Mode::Unique(v) => {
11271 std::option::Option::Some(v)
11272 }
11273 _ => std::option::Option::None,
11274 })
11275 }
11276
11277 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11278 /// to hold a `Unique`.
11279 ///
11280 /// Note that all the setters affecting `mode` are
11281 /// mutually exclusive.
11282 ///
11283 /// # Example
11284 /// ```ignore,no_run
11285 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11286 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11287 /// let x = LoadConfig::new().set_unique(IncrementalLoadMode::default()/* use setters */);
11288 /// assert!(x.unique().is_some());
11289 /// assert!(x.replace().is_none());
11290 /// assert!(x.append().is_none());
11291 /// assert!(x.maximum().is_none());
11292 /// ```
11293 pub fn set_unique<
11294 T: std::convert::Into<
11295 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11296 >,
11297 >(
11298 mut self,
11299 v: T,
11300 ) -> Self {
11301 self.mode = std::option::Option::Some(
11302 crate::model::compilation_result_action::load_config::Mode::Unique(v.into()),
11303 );
11304 self
11305 }
11306 }
11307
11308 impl wkt::message::Message for LoadConfig {
11309 fn typename() -> &'static str {
11310 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.LoadConfig"
11311 }
11312 }
11313
11314 /// Defines additional types related to [LoadConfig].
11315 pub mod load_config {
11316 #[allow(unused_imports)]
11317 use super::*;
11318
11319 /// Load mode
11320 #[derive(Clone, Debug, PartialEq)]
11321 #[non_exhaustive]
11322 pub enum Mode {
11323 /// Replace destination table
11324 Replace(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
11325 /// Append into destination table
11326 Append(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
11327 /// Insert records where the value exceeds the previous maximum value for a
11328 /// column in the destination table
11329 Maximum(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
11330 /// Insert records where the value of a column is not already present in
11331 /// the destination table
11332 Unique(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
11333 }
11334 }
11335
11336 /// Simple load definition
11337 #[derive(Clone, Default, PartialEq)]
11338 #[non_exhaustive]
11339 pub struct SimpleLoadMode {
11340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11341 }
11342
11343 impl SimpleLoadMode {
11344 /// Creates a new default instance.
11345 pub fn new() -> Self {
11346 std::default::Default::default()
11347 }
11348 }
11349
11350 impl wkt::message::Message for SimpleLoadMode {
11351 fn typename() -> &'static str {
11352 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.SimpleLoadMode"
11353 }
11354 }
11355
11356 /// Load definition for incremental load modes
11357 #[derive(Clone, Default, PartialEq)]
11358 #[non_exhaustive]
11359 pub struct IncrementalLoadMode {
11360 /// Column name for incremental load modes
11361 pub column: std::string::String,
11362
11363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11364 }
11365
11366 impl IncrementalLoadMode {
11367 /// Creates a new default instance.
11368 pub fn new() -> Self {
11369 std::default::Default::default()
11370 }
11371
11372 /// Sets the value of [column][crate::model::compilation_result_action::IncrementalLoadMode::column].
11373 ///
11374 /// # Example
11375 /// ```ignore,no_run
11376 /// # use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11377 /// let x = IncrementalLoadMode::new().set_column("example");
11378 /// ```
11379 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11380 self.column = v.into();
11381 self
11382 }
11383 }
11384
11385 impl wkt::message::Message for IncrementalLoadMode {
11386 fn typename() -> &'static str {
11387 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.IncrementalLoadMode"
11388 }
11389 }
11390
11391 /// The compiled object.
11392 #[derive(Clone, Debug, PartialEq)]
11393 #[non_exhaustive]
11394 pub enum CompiledObject {
11395 /// The database relation created/updated by this action.
11396 Relation(std::boxed::Box<crate::model::compilation_result_action::Relation>),
11397 /// The database operations executed by this action.
11398 Operations(std::boxed::Box<crate::model::compilation_result_action::Operations>),
11399 /// The assertion executed by this action.
11400 Assertion(std::boxed::Box<crate::model::compilation_result_action::Assertion>),
11401 /// The declaration declared by this action.
11402 Declaration(std::boxed::Box<crate::model::compilation_result_action::Declaration>),
11403 /// The notebook executed by this action.
11404 Notebook(std::boxed::Box<crate::model::compilation_result_action::Notebook>),
11405 /// The data preparation executed by this action.
11406 DataPreparation(std::boxed::Box<crate::model::compilation_result_action::DataPreparation>),
11407 }
11408}
11409
11410/// `QueryCompilationResultActions` request message.
11411#[derive(Clone, Default, PartialEq)]
11412#[non_exhaustive]
11413pub struct QueryCompilationResultActionsRequest {
11414 /// Required. The compilation result's name.
11415 pub name: std::string::String,
11416
11417 /// Optional. Maximum number of compilation results to return. The server may
11418 /// return fewer items than requested. If unspecified, the server will pick an
11419 /// appropriate default.
11420 pub page_size: i32,
11421
11422 /// Optional. Page token received from a previous
11423 /// `QueryCompilationResultActions` call. Provide this to retrieve the
11424 /// subsequent page.
11425 ///
11426 /// When paginating, all other parameters provided to
11427 /// `QueryCompilationResultActions`, with the exception of `page_size`, must
11428 /// match the call that provided the page token.
11429 pub page_token: std::string::String,
11430
11431 /// Optional. Optional filter for the returned list. Filtering is only
11432 /// currently supported on the `file_path` field.
11433 pub filter: std::string::String,
11434
11435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11436}
11437
11438impl QueryCompilationResultActionsRequest {
11439 /// Creates a new default instance.
11440 pub fn new() -> Self {
11441 std::default::Default::default()
11442 }
11443
11444 /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
11445 ///
11446 /// # Example
11447 /// ```ignore,no_run
11448 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11449 /// # let project_id = "project_id";
11450 /// # let location_id = "location_id";
11451 /// # let repository_id = "repository_id";
11452 /// # let compilation_result_id = "compilation_result_id";
11453 /// let x = QueryCompilationResultActionsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
11454 /// ```
11455 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11456 self.name = v.into();
11457 self
11458 }
11459
11460 /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
11461 ///
11462 /// # Example
11463 /// ```ignore,no_run
11464 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11465 /// let x = QueryCompilationResultActionsRequest::new().set_page_size(42);
11466 /// ```
11467 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11468 self.page_size = v.into();
11469 self
11470 }
11471
11472 /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
11473 ///
11474 /// # Example
11475 /// ```ignore,no_run
11476 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11477 /// let x = QueryCompilationResultActionsRequest::new().set_page_token("example");
11478 /// ```
11479 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11480 self.page_token = v.into();
11481 self
11482 }
11483
11484 /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
11485 ///
11486 /// # Example
11487 /// ```ignore,no_run
11488 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11489 /// let x = QueryCompilationResultActionsRequest::new().set_filter("example");
11490 /// ```
11491 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11492 self.filter = v.into();
11493 self
11494 }
11495}
11496
11497impl wkt::message::Message for QueryCompilationResultActionsRequest {
11498 fn typename() -> &'static str {
11499 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsRequest"
11500 }
11501}
11502
11503/// `QueryCompilationResultActions` response message.
11504#[derive(Clone, Default, PartialEq)]
11505#[non_exhaustive]
11506pub struct QueryCompilationResultActionsResponse {
11507 /// List of compilation result actions.
11508 pub compilation_result_actions: std::vec::Vec<crate::model::CompilationResultAction>,
11509
11510 /// A token, which can be sent as `page_token` to retrieve the next page.
11511 /// If this field is omitted, there are no subsequent pages.
11512 pub next_page_token: std::string::String,
11513
11514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11515}
11516
11517impl QueryCompilationResultActionsResponse {
11518 /// Creates a new default instance.
11519 pub fn new() -> Self {
11520 std::default::Default::default()
11521 }
11522
11523 /// Sets the value of [compilation_result_actions][crate::model::QueryCompilationResultActionsResponse::compilation_result_actions].
11524 ///
11525 /// # Example
11526 /// ```ignore,no_run
11527 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
11528 /// use google_cloud_dataform_v1::model::CompilationResultAction;
11529 /// let x = QueryCompilationResultActionsResponse::new()
11530 /// .set_compilation_result_actions([
11531 /// CompilationResultAction::default()/* use setters */,
11532 /// CompilationResultAction::default()/* use (different) setters */,
11533 /// ]);
11534 /// ```
11535 pub fn set_compilation_result_actions<T, V>(mut self, v: T) -> Self
11536 where
11537 T: std::iter::IntoIterator<Item = V>,
11538 V: std::convert::Into<crate::model::CompilationResultAction>,
11539 {
11540 use std::iter::Iterator;
11541 self.compilation_result_actions = v.into_iter().map(|i| i.into()).collect();
11542 self
11543 }
11544
11545 /// Sets the value of [next_page_token][crate::model::QueryCompilationResultActionsResponse::next_page_token].
11546 ///
11547 /// # Example
11548 /// ```ignore,no_run
11549 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
11550 /// let x = QueryCompilationResultActionsResponse::new().set_next_page_token("example");
11551 /// ```
11552 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11553 self.next_page_token = v.into();
11554 self
11555 }
11556}
11557
11558impl wkt::message::Message for QueryCompilationResultActionsResponse {
11559 fn typename() -> &'static str {
11560 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsResponse"
11561 }
11562}
11563
11564#[doc(hidden)]
11565impl google_cloud_gax::paginator::internal::PageableResponse
11566 for QueryCompilationResultActionsResponse
11567{
11568 type PageItem = crate::model::CompilationResultAction;
11569
11570 fn items(self) -> std::vec::Vec<Self::PageItem> {
11571 self.compilation_result_actions
11572 }
11573
11574 fn next_page_token(&self) -> std::string::String {
11575 use std::clone::Clone;
11576 self.next_page_token.clone()
11577 }
11578}
11579
11580/// Represents a Dataform workflow configuration.
11581#[derive(Clone, Default, PartialEq)]
11582#[non_exhaustive]
11583pub struct WorkflowConfig {
11584 /// Identifier. The workflow config's name.
11585 pub name: std::string::String,
11586
11587 /// Required. The name of the release config whose release_compilation_result
11588 /// should be executed. Must be in the format
11589 /// `projects/*/locations/*/repositories/*/releaseConfigs/*`.
11590 pub release_config: std::string::String,
11591
11592 /// Optional. If left unset, a default InvocationConfig will be used.
11593 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
11594
11595 /// Optional. Optional schedule (in cron format) for automatic execution of
11596 /// this workflow config.
11597 pub cron_schedule: std::string::String,
11598
11599 /// Optional. Specifies the time zone to be used when interpreting
11600 /// cron_schedule. Must be a time zone name from the [time zone
11601 /// database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If
11602 /// left unspecified, the default is `UTC`.
11603 pub time_zone: std::string::String,
11604
11605 /// Output only. Records of the 10 most recent scheduled execution attempts,
11606 /// ordered in descending order of `execution_time`. Updated whenever automatic
11607 /// creation of a workflow invocation is triggered by cron_schedule.
11608 pub recent_scheduled_execution_records:
11609 std::vec::Vec<crate::model::workflow_config::ScheduledExecutionRecord>,
11610
11611 /// Optional. Disables automatic creation of workflow invocations.
11612 pub disabled: bool,
11613
11614 /// Output only. The timestamp of when the WorkflowConfig was created.
11615 pub create_time: std::option::Option<wkt::Timestamp>,
11616
11617 /// Output only. The timestamp of when the WorkflowConfig was last updated.
11618 pub update_time: std::option::Option<wkt::Timestamp>,
11619
11620 /// Output only. All the metadata information that is used internally to serve
11621 /// the resource. For example: timestamps, flags, status fields, etc. The
11622 /// format of this field is a JSON string.
11623 pub internal_metadata: std::option::Option<std::string::String>,
11624
11625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11626}
11627
11628impl WorkflowConfig {
11629 /// Creates a new default instance.
11630 pub fn new() -> Self {
11631 std::default::Default::default()
11632 }
11633
11634 /// Sets the value of [name][crate::model::WorkflowConfig::name].
11635 ///
11636 /// # Example
11637 /// ```ignore,no_run
11638 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11639 /// # let project_id = "project_id";
11640 /// # let location_id = "location_id";
11641 /// # let repository_id = "repository_id";
11642 /// # let workflow_config_id = "workflow_config_id";
11643 /// let x = WorkflowConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
11644 /// ```
11645 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11646 self.name = v.into();
11647 self
11648 }
11649
11650 /// Sets the value of [release_config][crate::model::WorkflowConfig::release_config].
11651 ///
11652 /// # Example
11653 /// ```ignore,no_run
11654 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11655 /// # let project_id = "project_id";
11656 /// # let location_id = "location_id";
11657 /// # let repository_id = "repository_id";
11658 /// # let release_config_id = "release_config_id";
11659 /// let x = WorkflowConfig::new().set_release_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
11660 /// ```
11661 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11662 self.release_config = v.into();
11663 self
11664 }
11665
11666 /// Sets the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
11667 ///
11668 /// # Example
11669 /// ```ignore,no_run
11670 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11671 /// use google_cloud_dataform_v1::model::InvocationConfig;
11672 /// let x = WorkflowConfig::new().set_invocation_config(InvocationConfig::default()/* use setters */);
11673 /// ```
11674 pub fn set_invocation_config<T>(mut self, v: T) -> Self
11675 where
11676 T: std::convert::Into<crate::model::InvocationConfig>,
11677 {
11678 self.invocation_config = std::option::Option::Some(v.into());
11679 self
11680 }
11681
11682 /// Sets or clears the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
11683 ///
11684 /// # Example
11685 /// ```ignore,no_run
11686 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11687 /// use google_cloud_dataform_v1::model::InvocationConfig;
11688 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
11689 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(None::<InvocationConfig>);
11690 /// ```
11691 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
11692 where
11693 T: std::convert::Into<crate::model::InvocationConfig>,
11694 {
11695 self.invocation_config = v.map(|x| x.into());
11696 self
11697 }
11698
11699 /// Sets the value of [cron_schedule][crate::model::WorkflowConfig::cron_schedule].
11700 ///
11701 /// # Example
11702 /// ```ignore,no_run
11703 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11704 /// let x = WorkflowConfig::new().set_cron_schedule("example");
11705 /// ```
11706 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11707 self.cron_schedule = v.into();
11708 self
11709 }
11710
11711 /// Sets the value of [time_zone][crate::model::WorkflowConfig::time_zone].
11712 ///
11713 /// # Example
11714 /// ```ignore,no_run
11715 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11716 /// let x = WorkflowConfig::new().set_time_zone("example");
11717 /// ```
11718 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11719 self.time_zone = v.into();
11720 self
11721 }
11722
11723 /// Sets the value of [recent_scheduled_execution_records][crate::model::WorkflowConfig::recent_scheduled_execution_records].
11724 ///
11725 /// # Example
11726 /// ```ignore,no_run
11727 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11728 /// use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11729 /// let x = WorkflowConfig::new()
11730 /// .set_recent_scheduled_execution_records([
11731 /// ScheduledExecutionRecord::default()/* use setters */,
11732 /// ScheduledExecutionRecord::default()/* use (different) setters */,
11733 /// ]);
11734 /// ```
11735 pub fn set_recent_scheduled_execution_records<T, V>(mut self, v: T) -> Self
11736 where
11737 T: std::iter::IntoIterator<Item = V>,
11738 V: std::convert::Into<crate::model::workflow_config::ScheduledExecutionRecord>,
11739 {
11740 use std::iter::Iterator;
11741 self.recent_scheduled_execution_records = v.into_iter().map(|i| i.into()).collect();
11742 self
11743 }
11744
11745 /// Sets the value of [disabled][crate::model::WorkflowConfig::disabled].
11746 ///
11747 /// # Example
11748 /// ```ignore,no_run
11749 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11750 /// let x = WorkflowConfig::new().set_disabled(true);
11751 /// ```
11752 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11753 self.disabled = v.into();
11754 self
11755 }
11756
11757 /// Sets the value of [create_time][crate::model::WorkflowConfig::create_time].
11758 ///
11759 /// # Example
11760 /// ```ignore,no_run
11761 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11762 /// use wkt::Timestamp;
11763 /// let x = WorkflowConfig::new().set_create_time(Timestamp::default()/* use setters */);
11764 /// ```
11765 pub fn set_create_time<T>(mut self, v: T) -> Self
11766 where
11767 T: std::convert::Into<wkt::Timestamp>,
11768 {
11769 self.create_time = std::option::Option::Some(v.into());
11770 self
11771 }
11772
11773 /// Sets or clears the value of [create_time][crate::model::WorkflowConfig::create_time].
11774 ///
11775 /// # Example
11776 /// ```ignore,no_run
11777 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11778 /// use wkt::Timestamp;
11779 /// let x = WorkflowConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11780 /// let x = WorkflowConfig::new().set_or_clear_create_time(None::<Timestamp>);
11781 /// ```
11782 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11783 where
11784 T: std::convert::Into<wkt::Timestamp>,
11785 {
11786 self.create_time = v.map(|x| x.into());
11787 self
11788 }
11789
11790 /// Sets the value of [update_time][crate::model::WorkflowConfig::update_time].
11791 ///
11792 /// # Example
11793 /// ```ignore,no_run
11794 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11795 /// use wkt::Timestamp;
11796 /// let x = WorkflowConfig::new().set_update_time(Timestamp::default()/* use setters */);
11797 /// ```
11798 pub fn set_update_time<T>(mut self, v: T) -> Self
11799 where
11800 T: std::convert::Into<wkt::Timestamp>,
11801 {
11802 self.update_time = std::option::Option::Some(v.into());
11803 self
11804 }
11805
11806 /// Sets or clears the value of [update_time][crate::model::WorkflowConfig::update_time].
11807 ///
11808 /// # Example
11809 /// ```ignore,no_run
11810 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11811 /// use wkt::Timestamp;
11812 /// let x = WorkflowConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11813 /// let x = WorkflowConfig::new().set_or_clear_update_time(None::<Timestamp>);
11814 /// ```
11815 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11816 where
11817 T: std::convert::Into<wkt::Timestamp>,
11818 {
11819 self.update_time = v.map(|x| x.into());
11820 self
11821 }
11822
11823 /// Sets the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
11824 ///
11825 /// # Example
11826 /// ```ignore,no_run
11827 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11828 /// let x = WorkflowConfig::new().set_internal_metadata("example");
11829 /// ```
11830 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
11831 where
11832 T: std::convert::Into<std::string::String>,
11833 {
11834 self.internal_metadata = std::option::Option::Some(v.into());
11835 self
11836 }
11837
11838 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
11839 ///
11840 /// # Example
11841 /// ```ignore,no_run
11842 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11843 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(Some("example"));
11844 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(None::<String>);
11845 /// ```
11846 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11847 where
11848 T: std::convert::Into<std::string::String>,
11849 {
11850 self.internal_metadata = v.map(|x| x.into());
11851 self
11852 }
11853}
11854
11855impl wkt::message::Message for WorkflowConfig {
11856 fn typename() -> &'static str {
11857 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig"
11858 }
11859}
11860
11861/// Defines additional types related to [WorkflowConfig].
11862pub mod workflow_config {
11863 #[allow(unused_imports)]
11864 use super::*;
11865
11866 /// A record of an attempt to create a workflow invocation for this workflow
11867 /// config.
11868 #[derive(Clone, Default, PartialEq)]
11869 #[non_exhaustive]
11870 pub struct ScheduledExecutionRecord {
11871 /// Output only. The timestamp of this execution attempt.
11872 pub execution_time: std::option::Option<wkt::Timestamp>,
11873
11874 /// The result of this execution attempt.
11875 pub result:
11876 std::option::Option<crate::model::workflow_config::scheduled_execution_record::Result>,
11877
11878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11879 }
11880
11881 impl ScheduledExecutionRecord {
11882 /// Creates a new default instance.
11883 pub fn new() -> Self {
11884 std::default::Default::default()
11885 }
11886
11887 /// Sets the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
11888 ///
11889 /// # Example
11890 /// ```ignore,no_run
11891 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11892 /// use wkt::Timestamp;
11893 /// let x = ScheduledExecutionRecord::new().set_execution_time(Timestamp::default()/* use setters */);
11894 /// ```
11895 pub fn set_execution_time<T>(mut self, v: T) -> Self
11896 where
11897 T: std::convert::Into<wkt::Timestamp>,
11898 {
11899 self.execution_time = std::option::Option::Some(v.into());
11900 self
11901 }
11902
11903 /// Sets or clears the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
11904 ///
11905 /// # Example
11906 /// ```ignore,no_run
11907 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11908 /// use wkt::Timestamp;
11909 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(Some(Timestamp::default()/* use setters */));
11910 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(None::<Timestamp>);
11911 /// ```
11912 pub fn set_or_clear_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
11913 where
11914 T: std::convert::Into<wkt::Timestamp>,
11915 {
11916 self.execution_time = v.map(|x| x.into());
11917 self
11918 }
11919
11920 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result].
11921 ///
11922 /// Note that all the setters affecting `result` are mutually
11923 /// exclusive.
11924 ///
11925 /// # Example
11926 /// ```ignore,no_run
11927 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11928 /// use google_cloud_dataform_v1::model::workflow_config::scheduled_execution_record::Result;
11929 /// let x = ScheduledExecutionRecord::new().set_result(Some(Result::WorkflowInvocation("example".to_string())));
11930 /// ```
11931 pub fn set_result<
11932 T: std::convert::Into<
11933 std::option::Option<
11934 crate::model::workflow_config::scheduled_execution_record::Result,
11935 >,
11936 >,
11937 >(
11938 mut self,
11939 v: T,
11940 ) -> Self {
11941 self.result = v.into();
11942 self
11943 }
11944
11945 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11946 /// if it holds a `WorkflowInvocation`, `None` if the field is not set or
11947 /// holds a different branch.
11948 pub fn workflow_invocation(&self) -> std::option::Option<&std::string::String> {
11949 #[allow(unreachable_patterns)]
11950 self.result.as_ref().and_then(|v| match v {
11951 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(v) => std::option::Option::Some(v),
11952 _ => std::option::Option::None,
11953 })
11954 }
11955
11956 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11957 /// to hold a `WorkflowInvocation`.
11958 ///
11959 /// Note that all the setters affecting `result` are
11960 /// mutually exclusive.
11961 ///
11962 /// # Example
11963 /// ```ignore,no_run
11964 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11965 /// # let project_id = "project_id";
11966 /// # let location_id = "location_id";
11967 /// # let repository_id = "repository_id";
11968 /// # let workflow_invocation_id = "workflow_invocation_id";
11969 /// let x = ScheduledExecutionRecord::new().set_workflow_invocation(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
11970 /// assert!(x.workflow_invocation().is_some());
11971 /// assert!(x.error_status().is_none());
11972 /// ```
11973 pub fn set_workflow_invocation<T: std::convert::Into<std::string::String>>(
11974 mut self,
11975 v: T,
11976 ) -> Self {
11977 self.result = std::option::Option::Some(
11978 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(
11979 v.into()
11980 )
11981 );
11982 self
11983 }
11984
11985 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11986 /// if it holds a `ErrorStatus`, `None` if the field is not set or
11987 /// holds a different branch.
11988 pub fn error_status(
11989 &self,
11990 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
11991 #[allow(unreachable_patterns)]
11992 self.result.as_ref().and_then(|v| match v {
11993 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
11994 v,
11995 ) => std::option::Option::Some(v),
11996 _ => std::option::Option::None,
11997 })
11998 }
11999
12000 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
12001 /// to hold a `ErrorStatus`.
12002 ///
12003 /// Note that all the setters affecting `result` are
12004 /// mutually exclusive.
12005 ///
12006 /// # Example
12007 /// ```ignore,no_run
12008 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12009 /// use google_cloud_rpc::model::Status;
12010 /// let x = ScheduledExecutionRecord::new().set_error_status(Status::default()/* use setters */);
12011 /// assert!(x.error_status().is_some());
12012 /// assert!(x.workflow_invocation().is_none());
12013 /// ```
12014 pub fn set_error_status<
12015 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
12016 >(
12017 mut self,
12018 v: T,
12019 ) -> Self {
12020 self.result = std::option::Option::Some(
12021 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
12022 v.into(),
12023 ),
12024 );
12025 self
12026 }
12027 }
12028
12029 impl wkt::message::Message for ScheduledExecutionRecord {
12030 fn typename() -> &'static str {
12031 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig.ScheduledExecutionRecord"
12032 }
12033 }
12034
12035 /// Defines additional types related to [ScheduledExecutionRecord].
12036 pub mod scheduled_execution_record {
12037 #[allow(unused_imports)]
12038 use super::*;
12039
12040 /// The result of this execution attempt.
12041 #[derive(Clone, Debug, PartialEq)]
12042 #[non_exhaustive]
12043 pub enum Result {
12044 /// The name of the created workflow invocation, if one was successfully
12045 /// created. Must be in the format
12046 /// `projects/*/locations/*/repositories/*/workflowInvocations/*`.
12047 WorkflowInvocation(std::string::String),
12048 /// The error status encountered upon this attempt to create the
12049 /// workflow invocation, if the attempt was unsuccessful.
12050 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
12051 }
12052 }
12053}
12054
12055/// Includes various configuration options for a workflow invocation.
12056/// If both `included_targets` and `included_tags` are unset, all actions
12057/// will be included.
12058#[derive(Clone, Default, PartialEq)]
12059#[non_exhaustive]
12060pub struct InvocationConfig {
12061 /// Optional. The set of action identifiers to include.
12062 pub included_targets: std::vec::Vec<crate::model::Target>,
12063
12064 /// Optional. The set of tags to include.
12065 pub included_tags: std::vec::Vec<std::string::String>,
12066
12067 /// Optional. When set to true, transitive dependencies of included actions
12068 /// will be executed.
12069 pub transitive_dependencies_included: bool,
12070
12071 /// Optional. When set to true, transitive dependents of included actions will
12072 /// be executed.
12073 pub transitive_dependents_included: bool,
12074
12075 /// Optional. When set to true, any incremental tables will be fully refreshed.
12076 pub fully_refresh_incremental_tables_enabled: bool,
12077
12078 /// Optional. The service account to run workflow invocations under.
12079 pub service_account: std::string::String,
12080
12081 /// Optional. Specifies the priority for query execution in BigQuery.
12082 /// More information can be found at
12083 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
12084 pub query_priority: std::option::Option<crate::model::invocation_config::QueryPriority>,
12085
12086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12087}
12088
12089impl InvocationConfig {
12090 /// Creates a new default instance.
12091 pub fn new() -> Self {
12092 std::default::Default::default()
12093 }
12094
12095 /// Sets the value of [included_targets][crate::model::InvocationConfig::included_targets].
12096 ///
12097 /// # Example
12098 /// ```ignore,no_run
12099 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12100 /// use google_cloud_dataform_v1::model::Target;
12101 /// let x = InvocationConfig::new()
12102 /// .set_included_targets([
12103 /// Target::default()/* use setters */,
12104 /// Target::default()/* use (different) setters */,
12105 /// ]);
12106 /// ```
12107 pub fn set_included_targets<T, V>(mut self, v: T) -> Self
12108 where
12109 T: std::iter::IntoIterator<Item = V>,
12110 V: std::convert::Into<crate::model::Target>,
12111 {
12112 use std::iter::Iterator;
12113 self.included_targets = v.into_iter().map(|i| i.into()).collect();
12114 self
12115 }
12116
12117 /// Sets the value of [included_tags][crate::model::InvocationConfig::included_tags].
12118 ///
12119 /// # Example
12120 /// ```ignore,no_run
12121 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12122 /// let x = InvocationConfig::new().set_included_tags(["a", "b", "c"]);
12123 /// ```
12124 pub fn set_included_tags<T, V>(mut self, v: T) -> Self
12125 where
12126 T: std::iter::IntoIterator<Item = V>,
12127 V: std::convert::Into<std::string::String>,
12128 {
12129 use std::iter::Iterator;
12130 self.included_tags = v.into_iter().map(|i| i.into()).collect();
12131 self
12132 }
12133
12134 /// Sets the value of [transitive_dependencies_included][crate::model::InvocationConfig::transitive_dependencies_included].
12135 ///
12136 /// # Example
12137 /// ```ignore,no_run
12138 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12139 /// let x = InvocationConfig::new().set_transitive_dependencies_included(true);
12140 /// ```
12141 pub fn set_transitive_dependencies_included<T: std::convert::Into<bool>>(
12142 mut self,
12143 v: T,
12144 ) -> Self {
12145 self.transitive_dependencies_included = v.into();
12146 self
12147 }
12148
12149 /// Sets the value of [transitive_dependents_included][crate::model::InvocationConfig::transitive_dependents_included].
12150 ///
12151 /// # Example
12152 /// ```ignore,no_run
12153 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12154 /// let x = InvocationConfig::new().set_transitive_dependents_included(true);
12155 /// ```
12156 pub fn set_transitive_dependents_included<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12157 self.transitive_dependents_included = v.into();
12158 self
12159 }
12160
12161 /// Sets the value of [fully_refresh_incremental_tables_enabled][crate::model::InvocationConfig::fully_refresh_incremental_tables_enabled].
12162 ///
12163 /// # Example
12164 /// ```ignore,no_run
12165 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12166 /// let x = InvocationConfig::new().set_fully_refresh_incremental_tables_enabled(true);
12167 /// ```
12168 pub fn set_fully_refresh_incremental_tables_enabled<T: std::convert::Into<bool>>(
12169 mut self,
12170 v: T,
12171 ) -> Self {
12172 self.fully_refresh_incremental_tables_enabled = v.into();
12173 self
12174 }
12175
12176 /// Sets the value of [service_account][crate::model::InvocationConfig::service_account].
12177 ///
12178 /// # Example
12179 /// ```ignore,no_run
12180 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12181 /// let x = InvocationConfig::new().set_service_account("example");
12182 /// ```
12183 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12184 self.service_account = v.into();
12185 self
12186 }
12187
12188 /// Sets the value of [query_priority][crate::model::InvocationConfig::query_priority].
12189 ///
12190 /// # Example
12191 /// ```ignore,no_run
12192 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12193 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
12194 /// let x0 = InvocationConfig::new().set_query_priority(QueryPriority::Interactive);
12195 /// let x1 = InvocationConfig::new().set_query_priority(QueryPriority::Batch);
12196 /// ```
12197 pub fn set_query_priority<T>(mut self, v: T) -> Self
12198 where
12199 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
12200 {
12201 self.query_priority = std::option::Option::Some(v.into());
12202 self
12203 }
12204
12205 /// Sets or clears the value of [query_priority][crate::model::InvocationConfig::query_priority].
12206 ///
12207 /// # Example
12208 /// ```ignore,no_run
12209 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12210 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
12211 /// let x0 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Interactive));
12212 /// let x1 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Batch));
12213 /// let x_none = InvocationConfig::new().set_or_clear_query_priority(None::<QueryPriority>);
12214 /// ```
12215 pub fn set_or_clear_query_priority<T>(mut self, v: std::option::Option<T>) -> Self
12216 where
12217 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
12218 {
12219 self.query_priority = v.map(|x| x.into());
12220 self
12221 }
12222}
12223
12224impl wkt::message::Message for InvocationConfig {
12225 fn typename() -> &'static str {
12226 "type.googleapis.com/google.cloud.dataform.v1.InvocationConfig"
12227 }
12228}
12229
12230/// Defines additional types related to [InvocationConfig].
12231pub mod invocation_config {
12232 #[allow(unused_imports)]
12233 use super::*;
12234
12235 /// Types of priority for query execution in BigQuery.
12236 ///
12237 /// # Working with unknown values
12238 ///
12239 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12240 /// additional enum variants at any time. Adding new variants is not considered
12241 /// a breaking change. Applications should write their code in anticipation of:
12242 ///
12243 /// - New values appearing in future releases of the client library, **and**
12244 /// - New values received dynamically, without application changes.
12245 ///
12246 /// Please consult the [Working with enums] section in the user guide for some
12247 /// guidelines.
12248 ///
12249 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12250 #[derive(Clone, Debug, PartialEq)]
12251 #[non_exhaustive]
12252 pub enum QueryPriority {
12253 /// Default value. This value is unused.
12254 Unspecified,
12255 /// Query will be executed in BigQuery with interactive priority.
12256 /// More information can be found at
12257 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
12258 Interactive,
12259 /// Query will be executed in BigQuery with batch priority.
12260 /// More information can be found at
12261 /// <https://cloud.google.com/bigquery/docs/running-queries#batchqueries>.
12262 Batch,
12263 /// If set, the enum was initialized with an unknown value.
12264 ///
12265 /// Applications can examine the value using [QueryPriority::value] or
12266 /// [QueryPriority::name].
12267 UnknownValue(query_priority::UnknownValue),
12268 }
12269
12270 #[doc(hidden)]
12271 pub mod query_priority {
12272 #[allow(unused_imports)]
12273 use super::*;
12274 #[derive(Clone, Debug, PartialEq)]
12275 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12276 }
12277
12278 impl QueryPriority {
12279 /// Gets the enum value.
12280 ///
12281 /// Returns `None` if the enum contains an unknown value deserialized from
12282 /// the string representation of enums.
12283 pub fn value(&self) -> std::option::Option<i32> {
12284 match self {
12285 Self::Unspecified => std::option::Option::Some(0),
12286 Self::Interactive => std::option::Option::Some(1),
12287 Self::Batch => std::option::Option::Some(2),
12288 Self::UnknownValue(u) => u.0.value(),
12289 }
12290 }
12291
12292 /// Gets the enum value as a string.
12293 ///
12294 /// Returns `None` if the enum contains an unknown value deserialized from
12295 /// the integer representation of enums.
12296 pub fn name(&self) -> std::option::Option<&str> {
12297 match self {
12298 Self::Unspecified => std::option::Option::Some("QUERY_PRIORITY_UNSPECIFIED"),
12299 Self::Interactive => std::option::Option::Some("INTERACTIVE"),
12300 Self::Batch => std::option::Option::Some("BATCH"),
12301 Self::UnknownValue(u) => u.0.name(),
12302 }
12303 }
12304 }
12305
12306 impl std::default::Default for QueryPriority {
12307 fn default() -> Self {
12308 use std::convert::From;
12309 Self::from(0)
12310 }
12311 }
12312
12313 impl std::fmt::Display for QueryPriority {
12314 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12315 wkt::internal::display_enum(f, self.name(), self.value())
12316 }
12317 }
12318
12319 impl std::convert::From<i32> for QueryPriority {
12320 fn from(value: i32) -> Self {
12321 match value {
12322 0 => Self::Unspecified,
12323 1 => Self::Interactive,
12324 2 => Self::Batch,
12325 _ => Self::UnknownValue(query_priority::UnknownValue(
12326 wkt::internal::UnknownEnumValue::Integer(value),
12327 )),
12328 }
12329 }
12330 }
12331
12332 impl std::convert::From<&str> for QueryPriority {
12333 fn from(value: &str) -> Self {
12334 use std::string::ToString;
12335 match value {
12336 "QUERY_PRIORITY_UNSPECIFIED" => Self::Unspecified,
12337 "INTERACTIVE" => Self::Interactive,
12338 "BATCH" => Self::Batch,
12339 _ => Self::UnknownValue(query_priority::UnknownValue(
12340 wkt::internal::UnknownEnumValue::String(value.to_string()),
12341 )),
12342 }
12343 }
12344 }
12345
12346 impl serde::ser::Serialize for QueryPriority {
12347 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12348 where
12349 S: serde::Serializer,
12350 {
12351 match self {
12352 Self::Unspecified => serializer.serialize_i32(0),
12353 Self::Interactive => serializer.serialize_i32(1),
12354 Self::Batch => serializer.serialize_i32(2),
12355 Self::UnknownValue(u) => u.0.serialize(serializer),
12356 }
12357 }
12358 }
12359
12360 impl<'de> serde::de::Deserialize<'de> for QueryPriority {
12361 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12362 where
12363 D: serde::Deserializer<'de>,
12364 {
12365 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryPriority>::new(
12366 ".google.cloud.dataform.v1.InvocationConfig.QueryPriority",
12367 ))
12368 }
12369 }
12370}
12371
12372/// `ListWorkflowConfigs` request message.
12373#[derive(Clone, Default, PartialEq)]
12374#[non_exhaustive]
12375pub struct ListWorkflowConfigsRequest {
12376 /// Required. The repository in which to list workflow configs. Must be in the
12377 /// format `projects/*/locations/*/repositories/*`.
12378 pub parent: std::string::String,
12379
12380 /// Optional. Maximum number of workflow configs to return. The server may
12381 /// return fewer items than requested. If unspecified, the server will pick an
12382 /// appropriate default.
12383 pub page_size: i32,
12384
12385 /// Optional. Page token received from a previous `ListWorkflowConfigs` call.
12386 /// Provide this to retrieve the subsequent page.
12387 ///
12388 /// When paginating, all other parameters provided to `ListWorkflowConfigs`,
12389 /// with the exception of `page_size`, must match the call that provided the
12390 /// page token.
12391 pub page_token: std::string::String,
12392
12393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12394}
12395
12396impl ListWorkflowConfigsRequest {
12397 /// Creates a new default instance.
12398 pub fn new() -> Self {
12399 std::default::Default::default()
12400 }
12401
12402 /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
12403 ///
12404 /// # Example
12405 /// ```ignore,no_run
12406 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12407 /// # let project_id = "project_id";
12408 /// # let location_id = "location_id";
12409 /// # let repository_id = "repository_id";
12410 /// let x = ListWorkflowConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
12411 /// ```
12412 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12413 self.parent = v.into();
12414 self
12415 }
12416
12417 /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
12418 ///
12419 /// # Example
12420 /// ```ignore,no_run
12421 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12422 /// let x = ListWorkflowConfigsRequest::new().set_page_size(42);
12423 /// ```
12424 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12425 self.page_size = v.into();
12426 self
12427 }
12428
12429 /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
12430 ///
12431 /// # Example
12432 /// ```ignore,no_run
12433 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12434 /// let x = ListWorkflowConfigsRequest::new().set_page_token("example");
12435 /// ```
12436 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12437 self.page_token = v.into();
12438 self
12439 }
12440}
12441
12442impl wkt::message::Message for ListWorkflowConfigsRequest {
12443 fn typename() -> &'static str {
12444 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsRequest"
12445 }
12446}
12447
12448/// `ListWorkflowConfigs` response message.
12449#[derive(Clone, Default, PartialEq)]
12450#[non_exhaustive]
12451pub struct ListWorkflowConfigsResponse {
12452 /// List of workflow configs.
12453 pub workflow_configs: std::vec::Vec<crate::model::WorkflowConfig>,
12454
12455 /// A token, which can be sent as `page_token` to retrieve the next page.
12456 /// If this field is omitted, there are no subsequent pages.
12457 pub next_page_token: std::string::String,
12458
12459 /// Locations which could not be reached.
12460 pub unreachable: std::vec::Vec<std::string::String>,
12461
12462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12463}
12464
12465impl ListWorkflowConfigsResponse {
12466 /// Creates a new default instance.
12467 pub fn new() -> Self {
12468 std::default::Default::default()
12469 }
12470
12471 /// Sets the value of [workflow_configs][crate::model::ListWorkflowConfigsResponse::workflow_configs].
12472 ///
12473 /// # Example
12474 /// ```ignore,no_run
12475 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12476 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12477 /// let x = ListWorkflowConfigsResponse::new()
12478 /// .set_workflow_configs([
12479 /// WorkflowConfig::default()/* use setters */,
12480 /// WorkflowConfig::default()/* use (different) setters */,
12481 /// ]);
12482 /// ```
12483 pub fn set_workflow_configs<T, V>(mut self, v: T) -> Self
12484 where
12485 T: std::iter::IntoIterator<Item = V>,
12486 V: std::convert::Into<crate::model::WorkflowConfig>,
12487 {
12488 use std::iter::Iterator;
12489 self.workflow_configs = v.into_iter().map(|i| i.into()).collect();
12490 self
12491 }
12492
12493 /// Sets the value of [next_page_token][crate::model::ListWorkflowConfigsResponse::next_page_token].
12494 ///
12495 /// # Example
12496 /// ```ignore,no_run
12497 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12498 /// let x = ListWorkflowConfigsResponse::new().set_next_page_token("example");
12499 /// ```
12500 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12501 self.next_page_token = v.into();
12502 self
12503 }
12504
12505 /// Sets the value of [unreachable][crate::model::ListWorkflowConfigsResponse::unreachable].
12506 ///
12507 /// # Example
12508 /// ```ignore,no_run
12509 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12510 /// let x = ListWorkflowConfigsResponse::new().set_unreachable(["a", "b", "c"]);
12511 /// ```
12512 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12513 where
12514 T: std::iter::IntoIterator<Item = V>,
12515 V: std::convert::Into<std::string::String>,
12516 {
12517 use std::iter::Iterator;
12518 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12519 self
12520 }
12521}
12522
12523impl wkt::message::Message for ListWorkflowConfigsResponse {
12524 fn typename() -> &'static str {
12525 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsResponse"
12526 }
12527}
12528
12529#[doc(hidden)]
12530impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowConfigsResponse {
12531 type PageItem = crate::model::WorkflowConfig;
12532
12533 fn items(self) -> std::vec::Vec<Self::PageItem> {
12534 self.workflow_configs
12535 }
12536
12537 fn next_page_token(&self) -> std::string::String {
12538 use std::clone::Clone;
12539 self.next_page_token.clone()
12540 }
12541}
12542
12543/// `GetWorkflowConfig` request message.
12544#[derive(Clone, Default, PartialEq)]
12545#[non_exhaustive]
12546pub struct GetWorkflowConfigRequest {
12547 /// Required. The workflow config's name.
12548 pub name: std::string::String,
12549
12550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12551}
12552
12553impl GetWorkflowConfigRequest {
12554 /// Creates a new default instance.
12555 pub fn new() -> Self {
12556 std::default::Default::default()
12557 }
12558
12559 /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
12560 ///
12561 /// # Example
12562 /// ```ignore,no_run
12563 /// # use google_cloud_dataform_v1::model::GetWorkflowConfigRequest;
12564 /// # let project_id = "project_id";
12565 /// # let location_id = "location_id";
12566 /// # let repository_id = "repository_id";
12567 /// # let workflow_config_id = "workflow_config_id";
12568 /// let x = GetWorkflowConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
12569 /// ```
12570 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12571 self.name = v.into();
12572 self
12573 }
12574}
12575
12576impl wkt::message::Message for GetWorkflowConfigRequest {
12577 fn typename() -> &'static str {
12578 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowConfigRequest"
12579 }
12580}
12581
12582/// `CreateWorkflowConfig` request message.
12583#[derive(Clone, Default, PartialEq)]
12584#[non_exhaustive]
12585pub struct CreateWorkflowConfigRequest {
12586 /// Required. The repository in which to create the workflow config. Must be in
12587 /// the format `projects/*/locations/*/repositories/*`.
12588 pub parent: std::string::String,
12589
12590 /// Required. The workflow config to create.
12591 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
12592
12593 /// Required. The ID to use for the workflow config, which will become the
12594 /// final component of the workflow config's resource name.
12595 pub workflow_config_id: std::string::String,
12596
12597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12598}
12599
12600impl CreateWorkflowConfigRequest {
12601 /// Creates a new default instance.
12602 pub fn new() -> Self {
12603 std::default::Default::default()
12604 }
12605
12606 /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
12607 ///
12608 /// # Example
12609 /// ```ignore,no_run
12610 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12611 /// # let project_id = "project_id";
12612 /// # let location_id = "location_id";
12613 /// # let repository_id = "repository_id";
12614 /// let x = CreateWorkflowConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
12615 /// ```
12616 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12617 self.parent = v.into();
12618 self
12619 }
12620
12621 /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
12622 ///
12623 /// # Example
12624 /// ```ignore,no_run
12625 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12626 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12627 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
12628 /// ```
12629 pub fn set_workflow_config<T>(mut self, v: T) -> Self
12630 where
12631 T: std::convert::Into<crate::model::WorkflowConfig>,
12632 {
12633 self.workflow_config = std::option::Option::Some(v.into());
12634 self
12635 }
12636
12637 /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
12638 ///
12639 /// # Example
12640 /// ```ignore,no_run
12641 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12642 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12643 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
12644 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
12645 /// ```
12646 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
12647 where
12648 T: std::convert::Into<crate::model::WorkflowConfig>,
12649 {
12650 self.workflow_config = v.map(|x| x.into());
12651 self
12652 }
12653
12654 /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
12655 ///
12656 /// # Example
12657 /// ```ignore,no_run
12658 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12659 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config_id("example");
12660 /// ```
12661 pub fn set_workflow_config_id<T: std::convert::Into<std::string::String>>(
12662 mut self,
12663 v: T,
12664 ) -> Self {
12665 self.workflow_config_id = v.into();
12666 self
12667 }
12668}
12669
12670impl wkt::message::Message for CreateWorkflowConfigRequest {
12671 fn typename() -> &'static str {
12672 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowConfigRequest"
12673 }
12674}
12675
12676/// `UpdateWorkflowConfig` request message.
12677#[derive(Clone, Default, PartialEq)]
12678#[non_exhaustive]
12679pub struct UpdateWorkflowConfigRequest {
12680 /// Optional. Specifies the fields to be updated in the workflow config. If
12681 /// left unset, all fields will be updated.
12682 pub update_mask: std::option::Option<wkt::FieldMask>,
12683
12684 /// Required. The workflow config to update.
12685 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
12686
12687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12688}
12689
12690impl UpdateWorkflowConfigRequest {
12691 /// Creates a new default instance.
12692 pub fn new() -> Self {
12693 std::default::Default::default()
12694 }
12695
12696 /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
12697 ///
12698 /// # Example
12699 /// ```ignore,no_run
12700 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12701 /// use wkt::FieldMask;
12702 /// let x = UpdateWorkflowConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12703 /// ```
12704 pub fn set_update_mask<T>(mut self, v: T) -> Self
12705 where
12706 T: std::convert::Into<wkt::FieldMask>,
12707 {
12708 self.update_mask = std::option::Option::Some(v.into());
12709 self
12710 }
12711
12712 /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
12713 ///
12714 /// # Example
12715 /// ```ignore,no_run
12716 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12717 /// use wkt::FieldMask;
12718 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12719 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12720 /// ```
12721 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12722 where
12723 T: std::convert::Into<wkt::FieldMask>,
12724 {
12725 self.update_mask = v.map(|x| x.into());
12726 self
12727 }
12728
12729 /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
12730 ///
12731 /// # Example
12732 /// ```ignore,no_run
12733 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12734 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12735 /// let x = UpdateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
12736 /// ```
12737 pub fn set_workflow_config<T>(mut self, v: T) -> Self
12738 where
12739 T: std::convert::Into<crate::model::WorkflowConfig>,
12740 {
12741 self.workflow_config = std::option::Option::Some(v.into());
12742 self
12743 }
12744
12745 /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
12746 ///
12747 /// # Example
12748 /// ```ignore,no_run
12749 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12750 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12751 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
12752 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
12753 /// ```
12754 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
12755 where
12756 T: std::convert::Into<crate::model::WorkflowConfig>,
12757 {
12758 self.workflow_config = v.map(|x| x.into());
12759 self
12760 }
12761}
12762
12763impl wkt::message::Message for UpdateWorkflowConfigRequest {
12764 fn typename() -> &'static str {
12765 "type.googleapis.com/google.cloud.dataform.v1.UpdateWorkflowConfigRequest"
12766 }
12767}
12768
12769/// `DeleteWorkflowConfig` request message.
12770#[derive(Clone, Default, PartialEq)]
12771#[non_exhaustive]
12772pub struct DeleteWorkflowConfigRequest {
12773 /// Required. The workflow config's name.
12774 pub name: std::string::String,
12775
12776 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12777}
12778
12779impl DeleteWorkflowConfigRequest {
12780 /// Creates a new default instance.
12781 pub fn new() -> Self {
12782 std::default::Default::default()
12783 }
12784
12785 /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
12786 ///
12787 /// # Example
12788 /// ```ignore,no_run
12789 /// # use google_cloud_dataform_v1::model::DeleteWorkflowConfigRequest;
12790 /// # let project_id = "project_id";
12791 /// # let location_id = "location_id";
12792 /// # let repository_id = "repository_id";
12793 /// # let workflow_config_id = "workflow_config_id";
12794 /// let x = DeleteWorkflowConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
12795 /// ```
12796 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12797 self.name = v.into();
12798 self
12799 }
12800}
12801
12802impl wkt::message::Message for DeleteWorkflowConfigRequest {
12803 fn typename() -> &'static str {
12804 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowConfigRequest"
12805 }
12806}
12807
12808/// Represents a single invocation of a compilation result.
12809#[derive(Clone, Default, PartialEq)]
12810#[non_exhaustive]
12811pub struct WorkflowInvocation {
12812 /// Output only. The workflow invocation's name.
12813 pub name: std::string::String,
12814
12815 /// Immutable. If left unset, a default InvocationConfig will be used.
12816 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
12817
12818 /// Output only. This workflow invocation's current state.
12819 pub state: crate::model::workflow_invocation::State,
12820
12821 /// Output only. This workflow invocation's timing details.
12822 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
12823
12824 /// Output only. The resolved compilation result that was used to create this
12825 /// invocation. Will be in the format
12826 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
12827 pub resolved_compilation_result: std::string::String,
12828
12829 /// Output only. Only set if the repository has a KMS Key.
12830 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
12831
12832 /// Output only. All the metadata information that is used internally to serve
12833 /// the resource. For example: timestamps, flags, status fields, etc. The
12834 /// format of this field is a JSON string.
12835 pub internal_metadata: std::option::Option<std::string::String>,
12836
12837 /// Output only. Metadata indicating whether this resource is user-scoped.
12838 /// `WorkflowInvocation` resource is `user_scoped` only if it is sourced
12839 /// from a compilation result and the compilation result is user-scoped.
12840 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
12841
12842 /// Output only. The pipeline options which defines the pipeline type and path
12843 /// within the Git repository.
12844 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
12845
12846 /// The source of the compilation result to use for this invocation.
12847 pub compilation_source:
12848 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
12849
12850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12851}
12852
12853impl WorkflowInvocation {
12854 /// Creates a new default instance.
12855 pub fn new() -> Self {
12856 std::default::Default::default()
12857 }
12858
12859 /// Sets the value of [name][crate::model::WorkflowInvocation::name].
12860 ///
12861 /// # Example
12862 /// ```ignore,no_run
12863 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12864 /// # let project_id = "project_id";
12865 /// # let location_id = "location_id";
12866 /// # let repository_id = "repository_id";
12867 /// # let workflow_invocation_id = "workflow_invocation_id";
12868 /// let x = WorkflowInvocation::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
12869 /// ```
12870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12871 self.name = v.into();
12872 self
12873 }
12874
12875 /// Sets the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
12876 ///
12877 /// # Example
12878 /// ```ignore,no_run
12879 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12880 /// use google_cloud_dataform_v1::model::InvocationConfig;
12881 /// let x = WorkflowInvocation::new().set_invocation_config(InvocationConfig::default()/* use setters */);
12882 /// ```
12883 pub fn set_invocation_config<T>(mut self, v: T) -> Self
12884 where
12885 T: std::convert::Into<crate::model::InvocationConfig>,
12886 {
12887 self.invocation_config = std::option::Option::Some(v.into());
12888 self
12889 }
12890
12891 /// Sets or clears the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
12892 ///
12893 /// # Example
12894 /// ```ignore,no_run
12895 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12896 /// use google_cloud_dataform_v1::model::InvocationConfig;
12897 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
12898 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(None::<InvocationConfig>);
12899 /// ```
12900 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
12901 where
12902 T: std::convert::Into<crate::model::InvocationConfig>,
12903 {
12904 self.invocation_config = v.map(|x| x.into());
12905 self
12906 }
12907
12908 /// Sets the value of [state][crate::model::WorkflowInvocation::state].
12909 ///
12910 /// # Example
12911 /// ```ignore,no_run
12912 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12913 /// use google_cloud_dataform_v1::model::workflow_invocation::State;
12914 /// let x0 = WorkflowInvocation::new().set_state(State::Running);
12915 /// let x1 = WorkflowInvocation::new().set_state(State::Succeeded);
12916 /// let x2 = WorkflowInvocation::new().set_state(State::Cancelled);
12917 /// ```
12918 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation::State>>(
12919 mut self,
12920 v: T,
12921 ) -> Self {
12922 self.state = v.into();
12923 self
12924 }
12925
12926 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
12927 ///
12928 /// # Example
12929 /// ```ignore,no_run
12930 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12931 /// use google_cloud_type::model::Interval;
12932 /// let x = WorkflowInvocation::new().set_invocation_timing(Interval::default()/* use setters */);
12933 /// ```
12934 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
12935 where
12936 T: std::convert::Into<google_cloud_type::model::Interval>,
12937 {
12938 self.invocation_timing = std::option::Option::Some(v.into());
12939 self
12940 }
12941
12942 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
12943 ///
12944 /// # Example
12945 /// ```ignore,no_run
12946 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12947 /// use google_cloud_type::model::Interval;
12948 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
12949 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(None::<Interval>);
12950 /// ```
12951 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
12952 where
12953 T: std::convert::Into<google_cloud_type::model::Interval>,
12954 {
12955 self.invocation_timing = v.map(|x| x.into());
12956 self
12957 }
12958
12959 /// Sets the value of [resolved_compilation_result][crate::model::WorkflowInvocation::resolved_compilation_result].
12960 ///
12961 /// # Example
12962 /// ```ignore,no_run
12963 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12964 /// # let project_id = "project_id";
12965 /// # let location_id = "location_id";
12966 /// # let repository_id = "repository_id";
12967 /// # let compilation_result_id = "compilation_result_id";
12968 /// let x = WorkflowInvocation::new().set_resolved_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
12969 /// ```
12970 pub fn set_resolved_compilation_result<T: std::convert::Into<std::string::String>>(
12971 mut self,
12972 v: T,
12973 ) -> Self {
12974 self.resolved_compilation_result = v.into();
12975 self
12976 }
12977
12978 /// Sets the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
12979 ///
12980 /// # Example
12981 /// ```ignore,no_run
12982 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12983 /// use google_cloud_dataform_v1::model::DataEncryptionState;
12984 /// let x = WorkflowInvocation::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
12985 /// ```
12986 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
12987 where
12988 T: std::convert::Into<crate::model::DataEncryptionState>,
12989 {
12990 self.data_encryption_state = std::option::Option::Some(v.into());
12991 self
12992 }
12993
12994 /// Sets or clears the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
12995 ///
12996 /// # Example
12997 /// ```ignore,no_run
12998 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12999 /// use google_cloud_dataform_v1::model::DataEncryptionState;
13000 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
13001 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
13002 /// ```
13003 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
13004 where
13005 T: std::convert::Into<crate::model::DataEncryptionState>,
13006 {
13007 self.data_encryption_state = v.map(|x| x.into());
13008 self
13009 }
13010
13011 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13016 /// let x = WorkflowInvocation::new().set_internal_metadata("example");
13017 /// ```
13018 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
13019 where
13020 T: std::convert::Into<std::string::String>,
13021 {
13022 self.internal_metadata = std::option::Option::Some(v.into());
13023 self
13024 }
13025
13026 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
13027 ///
13028 /// # Example
13029 /// ```ignore,no_run
13030 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13031 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(Some("example"));
13032 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(None::<String>);
13033 /// ```
13034 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13035 where
13036 T: std::convert::Into<std::string::String>,
13037 {
13038 self.internal_metadata = v.map(|x| x.into());
13039 self
13040 }
13041
13042 /// Sets the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
13043 ///
13044 /// # Example
13045 /// ```ignore,no_run
13046 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13047 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
13048 /// let x = WorkflowInvocation::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
13049 /// ```
13050 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
13051 where
13052 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
13053 {
13054 self.private_resource_metadata = std::option::Option::Some(v.into());
13055 self
13056 }
13057
13058 /// Sets or clears the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
13059 ///
13060 /// # Example
13061 /// ```ignore,no_run
13062 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13063 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
13064 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
13065 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
13066 /// ```
13067 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13068 where
13069 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
13070 {
13071 self.private_resource_metadata = v.map(|x| x.into());
13072 self
13073 }
13074
13075 /// Sets the value of [pipeline_config][crate::model::WorkflowInvocation::pipeline_config].
13076 ///
13077 /// # Example
13078 /// ```ignore,no_run
13079 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13080 /// use google_cloud_dataform_v1::model::PipelineConfig;
13081 /// let x = WorkflowInvocation::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
13082 /// ```
13083 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
13084 where
13085 T: std::convert::Into<crate::model::PipelineConfig>,
13086 {
13087 self.pipeline_config = std::option::Option::Some(v.into());
13088 self
13089 }
13090
13091 /// Sets or clears the value of [pipeline_config][crate::model::WorkflowInvocation::pipeline_config].
13092 ///
13093 /// # Example
13094 /// ```ignore,no_run
13095 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13096 /// use google_cloud_dataform_v1::model::PipelineConfig;
13097 /// let x = WorkflowInvocation::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
13098 /// let x = WorkflowInvocation::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
13099 /// ```
13100 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
13101 where
13102 T: std::convert::Into<crate::model::PipelineConfig>,
13103 {
13104 self.pipeline_config = v.map(|x| x.into());
13105 self
13106 }
13107
13108 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source].
13109 ///
13110 /// Note that all the setters affecting `compilation_source` are mutually
13111 /// exclusive.
13112 ///
13113 /// # Example
13114 /// ```ignore,no_run
13115 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13116 /// use google_cloud_dataform_v1::model::workflow_invocation::CompilationSource;
13117 /// let x = WorkflowInvocation::new().set_compilation_source(Some(CompilationSource::CompilationResult("example".to_string())));
13118 /// ```
13119 pub fn set_compilation_source<
13120 T: std::convert::Into<
13121 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
13122 >,
13123 >(
13124 mut self,
13125 v: T,
13126 ) -> Self {
13127 self.compilation_source = v.into();
13128 self
13129 }
13130
13131 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13132 /// if it holds a `CompilationResult`, `None` if the field is not set or
13133 /// holds a different branch.
13134 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
13135 #[allow(unreachable_patterns)]
13136 self.compilation_source.as_ref().and_then(|v| match v {
13137 crate::model::workflow_invocation::CompilationSource::CompilationResult(v) => {
13138 std::option::Option::Some(v)
13139 }
13140 _ => std::option::Option::None,
13141 })
13142 }
13143
13144 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13145 /// to hold a `CompilationResult`.
13146 ///
13147 /// Note that all the setters affecting `compilation_source` are
13148 /// mutually exclusive.
13149 ///
13150 /// # Example
13151 /// ```ignore,no_run
13152 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13153 /// # let project_id = "project_id";
13154 /// # let location_id = "location_id";
13155 /// # let repository_id = "repository_id";
13156 /// # let compilation_result_id = "compilation_result_id";
13157 /// let x = WorkflowInvocation::new().set_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
13158 /// assert!(x.compilation_result().is_some());
13159 /// assert!(x.workflow_config().is_none());
13160 /// ```
13161 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
13162 mut self,
13163 v: T,
13164 ) -> Self {
13165 self.compilation_source = std::option::Option::Some(
13166 crate::model::workflow_invocation::CompilationSource::CompilationResult(v.into()),
13167 );
13168 self
13169 }
13170
13171 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13172 /// if it holds a `WorkflowConfig`, `None` if the field is not set or
13173 /// holds a different branch.
13174 pub fn workflow_config(&self) -> std::option::Option<&std::string::String> {
13175 #[allow(unreachable_patterns)]
13176 self.compilation_source.as_ref().and_then(|v| match v {
13177 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v) => {
13178 std::option::Option::Some(v)
13179 }
13180 _ => std::option::Option::None,
13181 })
13182 }
13183
13184 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13185 /// to hold a `WorkflowConfig`.
13186 ///
13187 /// Note that all the setters affecting `compilation_source` are
13188 /// mutually exclusive.
13189 ///
13190 /// # Example
13191 /// ```ignore,no_run
13192 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13193 /// # let project_id = "project_id";
13194 /// # let location_id = "location_id";
13195 /// # let repository_id = "repository_id";
13196 /// # let workflow_config_id = "workflow_config_id";
13197 /// let x = WorkflowInvocation::new().set_workflow_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
13198 /// assert!(x.workflow_config().is_some());
13199 /// assert!(x.compilation_result().is_none());
13200 /// ```
13201 pub fn set_workflow_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13202 self.compilation_source = std::option::Option::Some(
13203 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v.into()),
13204 );
13205 self
13206 }
13207}
13208
13209impl wkt::message::Message for WorkflowInvocation {
13210 fn typename() -> &'static str {
13211 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocation"
13212 }
13213}
13214
13215/// Defines additional types related to [WorkflowInvocation].
13216pub mod workflow_invocation {
13217 #[allow(unused_imports)]
13218 use super::*;
13219
13220 /// Represents the current state of a workflow invocation.
13221 ///
13222 /// # Working with unknown values
13223 ///
13224 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13225 /// additional enum variants at any time. Adding new variants is not considered
13226 /// a breaking change. Applications should write their code in anticipation of:
13227 ///
13228 /// - New values appearing in future releases of the client library, **and**
13229 /// - New values received dynamically, without application changes.
13230 ///
13231 /// Please consult the [Working with enums] section in the user guide for some
13232 /// guidelines.
13233 ///
13234 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13235 #[derive(Clone, Debug, PartialEq)]
13236 #[non_exhaustive]
13237 pub enum State {
13238 /// Default value. This value is unused.
13239 Unspecified,
13240 /// The workflow invocation is currently running.
13241 Running,
13242 /// The workflow invocation succeeded. A terminal state.
13243 Succeeded,
13244 /// The workflow invocation was cancelled. A terminal state.
13245 Cancelled,
13246 /// The workflow invocation failed. A terminal state.
13247 Failed,
13248 /// The workflow invocation is being cancelled, but some actions are still
13249 /// running.
13250 Canceling,
13251 /// If set, the enum was initialized with an unknown value.
13252 ///
13253 /// Applications can examine the value using [State::value] or
13254 /// [State::name].
13255 UnknownValue(state::UnknownValue),
13256 }
13257
13258 #[doc(hidden)]
13259 pub mod state {
13260 #[allow(unused_imports)]
13261 use super::*;
13262 #[derive(Clone, Debug, PartialEq)]
13263 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13264 }
13265
13266 impl State {
13267 /// Gets the enum value.
13268 ///
13269 /// Returns `None` if the enum contains an unknown value deserialized from
13270 /// the string representation of enums.
13271 pub fn value(&self) -> std::option::Option<i32> {
13272 match self {
13273 Self::Unspecified => std::option::Option::Some(0),
13274 Self::Running => std::option::Option::Some(1),
13275 Self::Succeeded => std::option::Option::Some(2),
13276 Self::Cancelled => std::option::Option::Some(3),
13277 Self::Failed => std::option::Option::Some(4),
13278 Self::Canceling => std::option::Option::Some(5),
13279 Self::UnknownValue(u) => u.0.value(),
13280 }
13281 }
13282
13283 /// Gets the enum value as a string.
13284 ///
13285 /// Returns `None` if the enum contains an unknown value deserialized from
13286 /// the integer representation of enums.
13287 pub fn name(&self) -> std::option::Option<&str> {
13288 match self {
13289 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13290 Self::Running => std::option::Option::Some("RUNNING"),
13291 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13292 Self::Cancelled => std::option::Option::Some("CANCELLED"),
13293 Self::Failed => std::option::Option::Some("FAILED"),
13294 Self::Canceling => std::option::Option::Some("CANCELING"),
13295 Self::UnknownValue(u) => u.0.name(),
13296 }
13297 }
13298 }
13299
13300 impl std::default::Default for State {
13301 fn default() -> Self {
13302 use std::convert::From;
13303 Self::from(0)
13304 }
13305 }
13306
13307 impl std::fmt::Display for State {
13308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13309 wkt::internal::display_enum(f, self.name(), self.value())
13310 }
13311 }
13312
13313 impl std::convert::From<i32> for State {
13314 fn from(value: i32) -> Self {
13315 match value {
13316 0 => Self::Unspecified,
13317 1 => Self::Running,
13318 2 => Self::Succeeded,
13319 3 => Self::Cancelled,
13320 4 => Self::Failed,
13321 5 => Self::Canceling,
13322 _ => Self::UnknownValue(state::UnknownValue(
13323 wkt::internal::UnknownEnumValue::Integer(value),
13324 )),
13325 }
13326 }
13327 }
13328
13329 impl std::convert::From<&str> for State {
13330 fn from(value: &str) -> Self {
13331 use std::string::ToString;
13332 match value {
13333 "STATE_UNSPECIFIED" => Self::Unspecified,
13334 "RUNNING" => Self::Running,
13335 "SUCCEEDED" => Self::Succeeded,
13336 "CANCELLED" => Self::Cancelled,
13337 "FAILED" => Self::Failed,
13338 "CANCELING" => Self::Canceling,
13339 _ => Self::UnknownValue(state::UnknownValue(
13340 wkt::internal::UnknownEnumValue::String(value.to_string()),
13341 )),
13342 }
13343 }
13344 }
13345
13346 impl serde::ser::Serialize for State {
13347 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13348 where
13349 S: serde::Serializer,
13350 {
13351 match self {
13352 Self::Unspecified => serializer.serialize_i32(0),
13353 Self::Running => serializer.serialize_i32(1),
13354 Self::Succeeded => serializer.serialize_i32(2),
13355 Self::Cancelled => serializer.serialize_i32(3),
13356 Self::Failed => serializer.serialize_i32(4),
13357 Self::Canceling => serializer.serialize_i32(5),
13358 Self::UnknownValue(u) => u.0.serialize(serializer),
13359 }
13360 }
13361 }
13362
13363 impl<'de> serde::de::Deserialize<'de> for State {
13364 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13365 where
13366 D: serde::Deserializer<'de>,
13367 {
13368 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13369 ".google.cloud.dataform.v1.WorkflowInvocation.State",
13370 ))
13371 }
13372 }
13373
13374 /// The source of the compilation result to use for this invocation.
13375 #[derive(Clone, Debug, PartialEq)]
13376 #[non_exhaustive]
13377 pub enum CompilationSource {
13378 /// Immutable. The name of the compilation result to use for this invocation.
13379 /// Must be in the format
13380 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
13381 CompilationResult(std::string::String),
13382 /// Immutable. The name of the workflow config to invoke. Must be in the
13383 /// format `projects/*/locations/*/repositories/*/workflowConfigs/*`.
13384 WorkflowConfig(std::string::String),
13385 }
13386}
13387
13388/// `ListWorkflowInvocations` request message.
13389#[derive(Clone, Default, PartialEq)]
13390#[non_exhaustive]
13391pub struct ListWorkflowInvocationsRequest {
13392 /// Required. The parent resource of the WorkflowInvocation type. Must be in
13393 /// the format `projects/*/locations/*/repositories/*`.
13394 pub parent: std::string::String,
13395
13396 /// Optional. Maximum number of workflow invocations to return. The server may
13397 /// return fewer items than requested. If unspecified, the server will pick an
13398 /// appropriate default.
13399 pub page_size: i32,
13400
13401 /// Optional. Page token received from a previous `ListWorkflowInvocations`
13402 /// call. Provide this to retrieve the subsequent page.
13403 ///
13404 /// When paginating, all other parameters provided to
13405 /// `ListWorkflowInvocations`, with the exception of `page_size`, must match
13406 /// the call that provided the page token.
13407 pub page_token: std::string::String,
13408
13409 /// Optional. This field only supports ordering by `name`. If unspecified, the
13410 /// server will choose the ordering. If specified, the default order is
13411 /// ascending for the `name` field.
13412 pub order_by: std::string::String,
13413
13414 /// Optional. Filter for the returned list.
13415 pub filter: std::string::String,
13416
13417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13418}
13419
13420impl ListWorkflowInvocationsRequest {
13421 /// Creates a new default instance.
13422 pub fn new() -> Self {
13423 std::default::Default::default()
13424 }
13425
13426 /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
13427 ///
13428 /// # Example
13429 /// ```ignore,no_run
13430 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13431 /// # let project_id = "project_id";
13432 /// # let location_id = "location_id";
13433 /// # let repository_id = "repository_id";
13434 /// let x = ListWorkflowInvocationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
13435 /// ```
13436 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13437 self.parent = v.into();
13438 self
13439 }
13440
13441 /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
13442 ///
13443 /// # Example
13444 /// ```ignore,no_run
13445 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13446 /// let x = ListWorkflowInvocationsRequest::new().set_page_size(42);
13447 /// ```
13448 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13449 self.page_size = v.into();
13450 self
13451 }
13452
13453 /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
13454 ///
13455 /// # Example
13456 /// ```ignore,no_run
13457 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13458 /// let x = ListWorkflowInvocationsRequest::new().set_page_token("example");
13459 /// ```
13460 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13461 self.page_token = v.into();
13462 self
13463 }
13464
13465 /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
13466 ///
13467 /// # Example
13468 /// ```ignore,no_run
13469 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13470 /// let x = ListWorkflowInvocationsRequest::new().set_order_by("example");
13471 /// ```
13472 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13473 self.order_by = v.into();
13474 self
13475 }
13476
13477 /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
13478 ///
13479 /// # Example
13480 /// ```ignore,no_run
13481 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13482 /// let x = ListWorkflowInvocationsRequest::new().set_filter("example");
13483 /// ```
13484 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13485 self.filter = v.into();
13486 self
13487 }
13488}
13489
13490impl wkt::message::Message for ListWorkflowInvocationsRequest {
13491 fn typename() -> &'static str {
13492 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsRequest"
13493 }
13494}
13495
13496/// `ListWorkflowInvocations` response message.
13497#[derive(Clone, Default, PartialEq)]
13498#[non_exhaustive]
13499pub struct ListWorkflowInvocationsResponse {
13500 /// List of workflow invocations.
13501 pub workflow_invocations: std::vec::Vec<crate::model::WorkflowInvocation>,
13502
13503 /// A token, which can be sent as `page_token` to retrieve the next page.
13504 /// If this field is omitted, there are no subsequent pages.
13505 pub next_page_token: std::string::String,
13506
13507 /// Locations which could not be reached.
13508 pub unreachable: std::vec::Vec<std::string::String>,
13509
13510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13511}
13512
13513impl ListWorkflowInvocationsResponse {
13514 /// Creates a new default instance.
13515 pub fn new() -> Self {
13516 std::default::Default::default()
13517 }
13518
13519 /// Sets the value of [workflow_invocations][crate::model::ListWorkflowInvocationsResponse::workflow_invocations].
13520 ///
13521 /// # Example
13522 /// ```ignore,no_run
13523 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13524 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13525 /// let x = ListWorkflowInvocationsResponse::new()
13526 /// .set_workflow_invocations([
13527 /// WorkflowInvocation::default()/* use setters */,
13528 /// WorkflowInvocation::default()/* use (different) setters */,
13529 /// ]);
13530 /// ```
13531 pub fn set_workflow_invocations<T, V>(mut self, v: T) -> Self
13532 where
13533 T: std::iter::IntoIterator<Item = V>,
13534 V: std::convert::Into<crate::model::WorkflowInvocation>,
13535 {
13536 use std::iter::Iterator;
13537 self.workflow_invocations = v.into_iter().map(|i| i.into()).collect();
13538 self
13539 }
13540
13541 /// Sets the value of [next_page_token][crate::model::ListWorkflowInvocationsResponse::next_page_token].
13542 ///
13543 /// # Example
13544 /// ```ignore,no_run
13545 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13546 /// let x = ListWorkflowInvocationsResponse::new().set_next_page_token("example");
13547 /// ```
13548 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13549 self.next_page_token = v.into();
13550 self
13551 }
13552
13553 /// Sets the value of [unreachable][crate::model::ListWorkflowInvocationsResponse::unreachable].
13554 ///
13555 /// # Example
13556 /// ```ignore,no_run
13557 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13558 /// let x = ListWorkflowInvocationsResponse::new().set_unreachable(["a", "b", "c"]);
13559 /// ```
13560 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13561 where
13562 T: std::iter::IntoIterator<Item = V>,
13563 V: std::convert::Into<std::string::String>,
13564 {
13565 use std::iter::Iterator;
13566 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13567 self
13568 }
13569}
13570
13571impl wkt::message::Message for ListWorkflowInvocationsResponse {
13572 fn typename() -> &'static str {
13573 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsResponse"
13574 }
13575}
13576
13577#[doc(hidden)]
13578impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowInvocationsResponse {
13579 type PageItem = crate::model::WorkflowInvocation;
13580
13581 fn items(self) -> std::vec::Vec<Self::PageItem> {
13582 self.workflow_invocations
13583 }
13584
13585 fn next_page_token(&self) -> std::string::String {
13586 use std::clone::Clone;
13587 self.next_page_token.clone()
13588 }
13589}
13590
13591/// `GetWorkflowInvocation` request message.
13592#[derive(Clone, Default, PartialEq)]
13593#[non_exhaustive]
13594pub struct GetWorkflowInvocationRequest {
13595 /// Required. The workflow invocation resource's name.
13596 pub name: std::string::String,
13597
13598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13599}
13600
13601impl GetWorkflowInvocationRequest {
13602 /// Creates a new default instance.
13603 pub fn new() -> Self {
13604 std::default::Default::default()
13605 }
13606
13607 /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
13608 ///
13609 /// # Example
13610 /// ```ignore,no_run
13611 /// # use google_cloud_dataform_v1::model::GetWorkflowInvocationRequest;
13612 /// # let project_id = "project_id";
13613 /// # let location_id = "location_id";
13614 /// # let repository_id = "repository_id";
13615 /// # let workflow_invocation_id = "workflow_invocation_id";
13616 /// let x = GetWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13617 /// ```
13618 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13619 self.name = v.into();
13620 self
13621 }
13622}
13623
13624impl wkt::message::Message for GetWorkflowInvocationRequest {
13625 fn typename() -> &'static str {
13626 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowInvocationRequest"
13627 }
13628}
13629
13630/// `CreateWorkflowInvocation` request message.
13631#[derive(Clone, Default, PartialEq)]
13632#[non_exhaustive]
13633pub struct CreateWorkflowInvocationRequest {
13634 /// Required. The repository in which to create the workflow invocation. Must
13635 /// be in the format `projects/*/locations/*/repositories/*`.
13636 pub parent: std::string::String,
13637
13638 /// Required. The workflow invocation resource to create.
13639 pub workflow_invocation: std::option::Option<crate::model::WorkflowInvocation>,
13640
13641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13642}
13643
13644impl CreateWorkflowInvocationRequest {
13645 /// Creates a new default instance.
13646 pub fn new() -> Self {
13647 std::default::Default::default()
13648 }
13649
13650 /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
13651 ///
13652 /// # Example
13653 /// ```ignore,no_run
13654 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13655 /// # let project_id = "project_id";
13656 /// # let location_id = "location_id";
13657 /// # let repository_id = "repository_id";
13658 /// let x = CreateWorkflowInvocationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
13659 /// ```
13660 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13661 self.parent = v.into();
13662 self
13663 }
13664
13665 /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
13666 ///
13667 /// # Example
13668 /// ```ignore,no_run
13669 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13670 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13671 /// let x = CreateWorkflowInvocationRequest::new().set_workflow_invocation(WorkflowInvocation::default()/* use setters */);
13672 /// ```
13673 pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
13674 where
13675 T: std::convert::Into<crate::model::WorkflowInvocation>,
13676 {
13677 self.workflow_invocation = std::option::Option::Some(v.into());
13678 self
13679 }
13680
13681 /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
13682 ///
13683 /// # Example
13684 /// ```ignore,no_run
13685 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13686 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13687 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(Some(WorkflowInvocation::default()/* use setters */));
13688 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(None::<WorkflowInvocation>);
13689 /// ```
13690 pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
13691 where
13692 T: std::convert::Into<crate::model::WorkflowInvocation>,
13693 {
13694 self.workflow_invocation = v.map(|x| x.into());
13695 self
13696 }
13697}
13698
13699impl wkt::message::Message for CreateWorkflowInvocationRequest {
13700 fn typename() -> &'static str {
13701 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowInvocationRequest"
13702 }
13703}
13704
13705/// `DeleteWorkflowInvocation` request message.
13706#[derive(Clone, Default, PartialEq)]
13707#[non_exhaustive]
13708pub struct DeleteWorkflowInvocationRequest {
13709 /// Required. The workflow invocation resource's name.
13710 pub name: std::string::String,
13711
13712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13713}
13714
13715impl DeleteWorkflowInvocationRequest {
13716 /// Creates a new default instance.
13717 pub fn new() -> Self {
13718 std::default::Default::default()
13719 }
13720
13721 /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
13722 ///
13723 /// # Example
13724 /// ```ignore,no_run
13725 /// # use google_cloud_dataform_v1::model::DeleteWorkflowInvocationRequest;
13726 /// # let project_id = "project_id";
13727 /// # let location_id = "location_id";
13728 /// # let repository_id = "repository_id";
13729 /// # let workflow_invocation_id = "workflow_invocation_id";
13730 /// let x = DeleteWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13731 /// ```
13732 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13733 self.name = v.into();
13734 self
13735 }
13736}
13737
13738impl wkt::message::Message for DeleteWorkflowInvocationRequest {
13739 fn typename() -> &'static str {
13740 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowInvocationRequest"
13741 }
13742}
13743
13744/// `CancelWorkflowInvocation` request message.
13745#[derive(Clone, Default, PartialEq)]
13746#[non_exhaustive]
13747pub struct CancelWorkflowInvocationRequest {
13748 /// Required. The workflow invocation resource's name.
13749 pub name: std::string::String,
13750
13751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13752}
13753
13754impl CancelWorkflowInvocationRequest {
13755 /// Creates a new default instance.
13756 pub fn new() -> Self {
13757 std::default::Default::default()
13758 }
13759
13760 /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
13761 ///
13762 /// # Example
13763 /// ```ignore,no_run
13764 /// # use google_cloud_dataform_v1::model::CancelWorkflowInvocationRequest;
13765 /// # let project_id = "project_id";
13766 /// # let location_id = "location_id";
13767 /// # let repository_id = "repository_id";
13768 /// # let workflow_invocation_id = "workflow_invocation_id";
13769 /// let x = CancelWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13770 /// ```
13771 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13772 self.name = v.into();
13773 self
13774 }
13775}
13776
13777impl wkt::message::Message for CancelWorkflowInvocationRequest {
13778 fn typename() -> &'static str {
13779 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationRequest"
13780 }
13781}
13782
13783/// `CancelWorkflowInvocation` response message.
13784#[derive(Clone, Default, PartialEq)]
13785#[non_exhaustive]
13786pub struct CancelWorkflowInvocationResponse {
13787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13788}
13789
13790impl CancelWorkflowInvocationResponse {
13791 /// Creates a new default instance.
13792 pub fn new() -> Self {
13793 std::default::Default::default()
13794 }
13795}
13796
13797impl wkt::message::Message for CancelWorkflowInvocationResponse {
13798 fn typename() -> &'static str {
13799 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationResponse"
13800 }
13801}
13802
13803/// Represents a single action in a workflow invocation.
13804#[derive(Clone, Default, PartialEq)]
13805#[non_exhaustive]
13806pub struct WorkflowInvocationAction {
13807 /// Output only. This action's identifier. Unique within the workflow
13808 /// invocation.
13809 pub target: std::option::Option<crate::model::Target>,
13810
13811 /// Output only. The action's identifier if the project had been compiled
13812 /// without any overrides configured. Unique within the compilation result.
13813 pub canonical_target: std::option::Option<crate::model::Target>,
13814
13815 /// Output only. This action's current state.
13816 pub state: crate::model::workflow_invocation_action::State,
13817
13818 /// Output only. If and only if action's state is FAILED a failure reason is
13819 /// set.
13820 pub failure_reason: std::string::String,
13821
13822 /// Output only. This action's timing details.
13823 /// `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
13824 /// CANCELLED, FAILED] state.
13825 /// `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
13826 /// state.
13827 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
13828
13829 /// Output only. All the metadata information that is used internally to serve
13830 /// the resource. For example: timestamps, flags, status fields, etc. The
13831 /// format of this field is a JSON string.
13832 pub internal_metadata: std::option::Option<std::string::String>,
13833
13834 /// The action's details.
13835 pub action: std::option::Option<crate::model::workflow_invocation_action::Action>,
13836
13837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13838}
13839
13840impl WorkflowInvocationAction {
13841 /// Creates a new default instance.
13842 pub fn new() -> Self {
13843 std::default::Default::default()
13844 }
13845
13846 /// Sets the value of [target][crate::model::WorkflowInvocationAction::target].
13847 ///
13848 /// # Example
13849 /// ```ignore,no_run
13850 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13851 /// use google_cloud_dataform_v1::model::Target;
13852 /// let x = WorkflowInvocationAction::new().set_target(Target::default()/* use setters */);
13853 /// ```
13854 pub fn set_target<T>(mut self, v: T) -> Self
13855 where
13856 T: std::convert::Into<crate::model::Target>,
13857 {
13858 self.target = std::option::Option::Some(v.into());
13859 self
13860 }
13861
13862 /// Sets or clears the value of [target][crate::model::WorkflowInvocationAction::target].
13863 ///
13864 /// # Example
13865 /// ```ignore,no_run
13866 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13867 /// use google_cloud_dataform_v1::model::Target;
13868 /// let x = WorkflowInvocationAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
13869 /// let x = WorkflowInvocationAction::new().set_or_clear_target(None::<Target>);
13870 /// ```
13871 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
13872 where
13873 T: std::convert::Into<crate::model::Target>,
13874 {
13875 self.target = v.map(|x| x.into());
13876 self
13877 }
13878
13879 /// Sets the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
13880 ///
13881 /// # Example
13882 /// ```ignore,no_run
13883 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13884 /// use google_cloud_dataform_v1::model::Target;
13885 /// let x = WorkflowInvocationAction::new().set_canonical_target(Target::default()/* use setters */);
13886 /// ```
13887 pub fn set_canonical_target<T>(mut self, v: T) -> Self
13888 where
13889 T: std::convert::Into<crate::model::Target>,
13890 {
13891 self.canonical_target = std::option::Option::Some(v.into());
13892 self
13893 }
13894
13895 /// Sets or clears the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
13896 ///
13897 /// # Example
13898 /// ```ignore,no_run
13899 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13900 /// use google_cloud_dataform_v1::model::Target;
13901 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
13902 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(None::<Target>);
13903 /// ```
13904 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
13905 where
13906 T: std::convert::Into<crate::model::Target>,
13907 {
13908 self.canonical_target = v.map(|x| x.into());
13909 self
13910 }
13911
13912 /// Sets the value of [state][crate::model::WorkflowInvocationAction::state].
13913 ///
13914 /// # Example
13915 /// ```ignore,no_run
13916 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13917 /// use google_cloud_dataform_v1::model::workflow_invocation_action::State;
13918 /// let x0 = WorkflowInvocationAction::new().set_state(State::Running);
13919 /// let x1 = WorkflowInvocationAction::new().set_state(State::Skipped);
13920 /// let x2 = WorkflowInvocationAction::new().set_state(State::Disabled);
13921 /// ```
13922 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation_action::State>>(
13923 mut self,
13924 v: T,
13925 ) -> Self {
13926 self.state = v.into();
13927 self
13928 }
13929
13930 /// Sets the value of [failure_reason][crate::model::WorkflowInvocationAction::failure_reason].
13931 ///
13932 /// # Example
13933 /// ```ignore,no_run
13934 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13935 /// let x = WorkflowInvocationAction::new().set_failure_reason("example");
13936 /// ```
13937 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13938 self.failure_reason = v.into();
13939 self
13940 }
13941
13942 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
13943 ///
13944 /// # Example
13945 /// ```ignore,no_run
13946 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13947 /// use google_cloud_type::model::Interval;
13948 /// let x = WorkflowInvocationAction::new().set_invocation_timing(Interval::default()/* use setters */);
13949 /// ```
13950 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
13951 where
13952 T: std::convert::Into<google_cloud_type::model::Interval>,
13953 {
13954 self.invocation_timing = std::option::Option::Some(v.into());
13955 self
13956 }
13957
13958 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
13959 ///
13960 /// # Example
13961 /// ```ignore,no_run
13962 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13963 /// use google_cloud_type::model::Interval;
13964 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
13965 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(None::<Interval>);
13966 /// ```
13967 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
13968 where
13969 T: std::convert::Into<google_cloud_type::model::Interval>,
13970 {
13971 self.invocation_timing = v.map(|x| x.into());
13972 self
13973 }
13974
13975 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
13976 ///
13977 /// # Example
13978 /// ```ignore,no_run
13979 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13980 /// let x = WorkflowInvocationAction::new().set_internal_metadata("example");
13981 /// ```
13982 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
13983 where
13984 T: std::convert::Into<std::string::String>,
13985 {
13986 self.internal_metadata = std::option::Option::Some(v.into());
13987 self
13988 }
13989
13990 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
13991 ///
13992 /// # Example
13993 /// ```ignore,no_run
13994 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13995 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(Some("example"));
13996 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(None::<String>);
13997 /// ```
13998 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13999 where
14000 T: std::convert::Into<std::string::String>,
14001 {
14002 self.internal_metadata = v.map(|x| x.into());
14003 self
14004 }
14005
14006 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action].
14007 ///
14008 /// Note that all the setters affecting `action` are mutually
14009 /// exclusive.
14010 ///
14011 /// # Example
14012 /// ```ignore,no_run
14013 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14014 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14015 /// let x = WorkflowInvocationAction::new().set_action(Some(
14016 /// google_cloud_dataform_v1::model::workflow_invocation_action::Action::BigqueryAction(BigQueryAction::default().into())));
14017 /// ```
14018 pub fn set_action<
14019 T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::Action>>,
14020 >(
14021 mut self,
14022 v: T,
14023 ) -> Self {
14024 self.action = v.into();
14025 self
14026 }
14027
14028 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14029 /// if it holds a `BigqueryAction`, `None` if the field is not set or
14030 /// holds a different branch.
14031 pub fn bigquery_action(
14032 &self,
14033 ) -> std::option::Option<
14034 &std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
14035 > {
14036 #[allow(unreachable_patterns)]
14037 self.action.as_ref().and_then(|v| match v {
14038 crate::model::workflow_invocation_action::Action::BigqueryAction(v) => {
14039 std::option::Option::Some(v)
14040 }
14041 _ => std::option::Option::None,
14042 })
14043 }
14044
14045 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14046 /// to hold a `BigqueryAction`.
14047 ///
14048 /// Note that all the setters affecting `action` are
14049 /// mutually exclusive.
14050 ///
14051 /// # Example
14052 /// ```ignore,no_run
14053 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14054 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14055 /// let x = WorkflowInvocationAction::new().set_bigquery_action(BigQueryAction::default()/* use setters */);
14056 /// assert!(x.bigquery_action().is_some());
14057 /// assert!(x.notebook_action().is_none());
14058 /// assert!(x.data_preparation_action().is_none());
14059 /// ```
14060 pub fn set_bigquery_action<
14061 T: std::convert::Into<
14062 std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
14063 >,
14064 >(
14065 mut self,
14066 v: T,
14067 ) -> Self {
14068 self.action = std::option::Option::Some(
14069 crate::model::workflow_invocation_action::Action::BigqueryAction(v.into()),
14070 );
14071 self
14072 }
14073
14074 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14075 /// if it holds a `NotebookAction`, `None` if the field is not set or
14076 /// holds a different branch.
14077 pub fn notebook_action(
14078 &self,
14079 ) -> std::option::Option<
14080 &std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
14081 > {
14082 #[allow(unreachable_patterns)]
14083 self.action.as_ref().and_then(|v| match v {
14084 crate::model::workflow_invocation_action::Action::NotebookAction(v) => {
14085 std::option::Option::Some(v)
14086 }
14087 _ => std::option::Option::None,
14088 })
14089 }
14090
14091 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14092 /// to hold a `NotebookAction`.
14093 ///
14094 /// Note that all the setters affecting `action` are
14095 /// mutually exclusive.
14096 ///
14097 /// # Example
14098 /// ```ignore,no_run
14099 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14100 /// use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14101 /// let x = WorkflowInvocationAction::new().set_notebook_action(NotebookAction::default()/* use setters */);
14102 /// assert!(x.notebook_action().is_some());
14103 /// assert!(x.bigquery_action().is_none());
14104 /// assert!(x.data_preparation_action().is_none());
14105 /// ```
14106 pub fn set_notebook_action<
14107 T: std::convert::Into<
14108 std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
14109 >,
14110 >(
14111 mut self,
14112 v: T,
14113 ) -> Self {
14114 self.action = std::option::Option::Some(
14115 crate::model::workflow_invocation_action::Action::NotebookAction(v.into()),
14116 );
14117 self
14118 }
14119
14120 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14121 /// if it holds a `DataPreparationAction`, `None` if the field is not set or
14122 /// holds a different branch.
14123 pub fn data_preparation_action(
14124 &self,
14125 ) -> std::option::Option<
14126 &std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
14127 > {
14128 #[allow(unreachable_patterns)]
14129 self.action.as_ref().and_then(|v| match v {
14130 crate::model::workflow_invocation_action::Action::DataPreparationAction(v) => {
14131 std::option::Option::Some(v)
14132 }
14133 _ => std::option::Option::None,
14134 })
14135 }
14136
14137 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14138 /// to hold a `DataPreparationAction`.
14139 ///
14140 /// Note that all the setters affecting `action` are
14141 /// mutually exclusive.
14142 ///
14143 /// # Example
14144 /// ```ignore,no_run
14145 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14146 /// use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14147 /// let x = WorkflowInvocationAction::new().set_data_preparation_action(DataPreparationAction::default()/* use setters */);
14148 /// assert!(x.data_preparation_action().is_some());
14149 /// assert!(x.bigquery_action().is_none());
14150 /// assert!(x.notebook_action().is_none());
14151 /// ```
14152 pub fn set_data_preparation_action<
14153 T: std::convert::Into<
14154 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
14155 >,
14156 >(
14157 mut self,
14158 v: T,
14159 ) -> Self {
14160 self.action = std::option::Option::Some(
14161 crate::model::workflow_invocation_action::Action::DataPreparationAction(v.into()),
14162 );
14163 self
14164 }
14165}
14166
14167impl wkt::message::Message for WorkflowInvocationAction {
14168 fn typename() -> &'static str {
14169 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction"
14170 }
14171}
14172
14173/// Defines additional types related to [WorkflowInvocationAction].
14174pub mod workflow_invocation_action {
14175 #[allow(unused_imports)]
14176 use super::*;
14177
14178 /// Represents a workflow action that will run against BigQuery.
14179 #[derive(Clone, Default, PartialEq)]
14180 #[non_exhaustive]
14181 pub struct BigQueryAction {
14182 /// Output only. The generated BigQuery SQL script that will be executed.
14183 pub sql_script: std::string::String,
14184
14185 /// Output only. The ID of the BigQuery job that executed the SQL in
14186 /// sql_script. Only set once the job has started to run.
14187 pub job_id: std::string::String,
14188
14189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14190 }
14191
14192 impl BigQueryAction {
14193 /// Creates a new default instance.
14194 pub fn new() -> Self {
14195 std::default::Default::default()
14196 }
14197
14198 /// Sets the value of [sql_script][crate::model::workflow_invocation_action::BigQueryAction::sql_script].
14199 ///
14200 /// # Example
14201 /// ```ignore,no_run
14202 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14203 /// let x = BigQueryAction::new().set_sql_script("example");
14204 /// ```
14205 pub fn set_sql_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14206 self.sql_script = v.into();
14207 self
14208 }
14209
14210 /// Sets the value of [job_id][crate::model::workflow_invocation_action::BigQueryAction::job_id].
14211 ///
14212 /// # Example
14213 /// ```ignore,no_run
14214 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14215 /// let x = BigQueryAction::new().set_job_id("example");
14216 /// ```
14217 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14218 self.job_id = v.into();
14219 self
14220 }
14221 }
14222
14223 impl wkt::message::Message for BigQueryAction {
14224 fn typename() -> &'static str {
14225 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.BigQueryAction"
14226 }
14227 }
14228
14229 /// Represents a workflow action that will run against a Notebook runtime.
14230 #[derive(Clone, Default, PartialEq)]
14231 #[non_exhaustive]
14232 pub struct NotebookAction {
14233 /// Output only. The code contents of a Notebook to be run.
14234 pub contents: std::string::String,
14235
14236 /// Output only. The ID of the Gemini Enterprise Agent Platform job that
14237 /// executed the notebook in contents and also the ID used for the outputs
14238 /// created in Google Cloud Storage buckets. Only set once the job has
14239 /// started to run.
14240 pub job_id: std::string::String,
14241
14242 /// Output only. The path to the notebook file in the repository.
14243 pub file_path: std::string::String,
14244
14245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14246 }
14247
14248 impl NotebookAction {
14249 /// Creates a new default instance.
14250 pub fn new() -> Self {
14251 std::default::Default::default()
14252 }
14253
14254 /// Sets the value of [contents][crate::model::workflow_invocation_action::NotebookAction::contents].
14255 ///
14256 /// # Example
14257 /// ```ignore,no_run
14258 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14259 /// let x = NotebookAction::new().set_contents("example");
14260 /// ```
14261 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14262 self.contents = v.into();
14263 self
14264 }
14265
14266 /// Sets the value of [job_id][crate::model::workflow_invocation_action::NotebookAction::job_id].
14267 ///
14268 /// # Example
14269 /// ```ignore,no_run
14270 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14271 /// let x = NotebookAction::new().set_job_id("example");
14272 /// ```
14273 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14274 self.job_id = v.into();
14275 self
14276 }
14277
14278 /// Sets the value of [file_path][crate::model::workflow_invocation_action::NotebookAction::file_path].
14279 ///
14280 /// # Example
14281 /// ```ignore,no_run
14282 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14283 /// let x = NotebookAction::new().set_file_path("example");
14284 /// ```
14285 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14286 self.file_path = v.into();
14287 self
14288 }
14289 }
14290
14291 impl wkt::message::Message for NotebookAction {
14292 fn typename() -> &'static str {
14293 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.NotebookAction"
14294 }
14295 }
14296
14297 /// Represents a workflow action that will run a Data Preparation.
14298 #[derive(Clone, Default, PartialEq)]
14299 #[non_exhaustive]
14300 pub struct DataPreparationAction {
14301 /// Output only. The generated BigQuery SQL script that will be executed. For
14302 /// reference only.
14303 pub generated_sql: std::string::String,
14304
14305 /// Output only. The ID of the BigQuery job that executed the SQL in
14306 /// sql_script. Only set once the job has started to run.
14307 pub job_id: std::string::String,
14308
14309 /// The definition for the data preparation.
14310 pub definition: std::option::Option<
14311 crate::model::workflow_invocation_action::data_preparation_action::Definition,
14312 >,
14313
14314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14315 }
14316
14317 impl DataPreparationAction {
14318 /// Creates a new default instance.
14319 pub fn new() -> Self {
14320 std::default::Default::default()
14321 }
14322
14323 /// Sets the value of [generated_sql][crate::model::workflow_invocation_action::DataPreparationAction::generated_sql].
14324 ///
14325 /// # Example
14326 /// ```ignore,no_run
14327 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14328 /// let x = DataPreparationAction::new().set_generated_sql("example");
14329 /// ```
14330 pub fn set_generated_sql<T: std::convert::Into<std::string::String>>(
14331 mut self,
14332 v: T,
14333 ) -> Self {
14334 self.generated_sql = v.into();
14335 self
14336 }
14337
14338 /// Sets the value of [job_id][crate::model::workflow_invocation_action::DataPreparationAction::job_id].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14343 /// let x = DataPreparationAction::new().set_job_id("example");
14344 /// ```
14345 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14346 self.job_id = v.into();
14347 self
14348 }
14349
14350 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition].
14351 ///
14352 /// Note that all the setters affecting `definition` are mutually
14353 /// exclusive.
14354 ///
14355 /// # Example
14356 /// ```ignore,no_run
14357 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14358 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::Definition;
14359 /// let x = DataPreparationAction::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
14360 /// ```
14361 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
14362 {
14363 self.definition = v.into();
14364 self
14365 }
14366
14367 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14368 /// if it holds a `ContentsYaml`, `None` if the field is not set or
14369 /// holds a different branch.
14370 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
14371 #[allow(unreachable_patterns)]
14372 self.definition.as_ref().and_then(|v| match v {
14373 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(v) => std::option::Option::Some(v),
14374 _ => std::option::Option::None,
14375 })
14376 }
14377
14378 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14379 /// to hold a `ContentsYaml`.
14380 ///
14381 /// Note that all the setters affecting `definition` are
14382 /// mutually exclusive.
14383 ///
14384 /// # Example
14385 /// ```ignore,no_run
14386 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14387 /// let x = DataPreparationAction::new().set_contents_yaml("example");
14388 /// assert!(x.contents_yaml().is_some());
14389 /// assert!(x.contents_sql().is_none());
14390 /// ```
14391 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
14392 mut self,
14393 v: T,
14394 ) -> Self {
14395 self.definition = std::option::Option::Some(
14396 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(
14397 v.into()
14398 )
14399 );
14400 self
14401 }
14402
14403 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14404 /// if it holds a `ContentsSql`, `None` if the field is not set or
14405 /// holds a different branch.
14406 pub fn contents_sql(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>{
14407 #[allow(unreachable_patterns)]
14408 self.definition.as_ref().and_then(|v| match v {
14409 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(v) => std::option::Option::Some(v),
14410 _ => std::option::Option::None,
14411 })
14412 }
14413
14414 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14415 /// to hold a `ContentsSql`.
14416 ///
14417 /// Note that all the setters affecting `definition` are
14418 /// mutually exclusive.
14419 ///
14420 /// # Example
14421 /// ```ignore,no_run
14422 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14423 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14424 /// let x = DataPreparationAction::new().set_contents_sql(ActionSqlDefinition::default()/* use setters */);
14425 /// assert!(x.contents_sql().is_some());
14426 /// assert!(x.contents_yaml().is_none());
14427 /// ```
14428 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{
14429 self.definition = std::option::Option::Some(
14430 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(
14431 v.into()
14432 )
14433 );
14434 self
14435 }
14436 }
14437
14438 impl wkt::message::Message for DataPreparationAction {
14439 fn typename() -> &'static str {
14440 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction"
14441 }
14442 }
14443
14444 /// Defines additional types related to [DataPreparationAction].
14445 pub mod data_preparation_action {
14446 #[allow(unused_imports)]
14447 use super::*;
14448
14449 /// Definition of a SQL Data Preparation
14450 #[derive(Clone, Default, PartialEq)]
14451 #[non_exhaustive]
14452 pub struct ActionSqlDefinition {
14453 /// The SQL query representing the data preparation steps. Formatted as a
14454 /// Pipe SQL query statement.
14455 pub query: std::string::String,
14456
14457 /// Error table configuration,
14458 pub error_table: std::option::Option<
14459 crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable,
14460 >,
14461
14462 /// Load configuration.
14463 pub load_config: std::option::Option<
14464 crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig,
14465 >,
14466
14467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14468 }
14469
14470 impl ActionSqlDefinition {
14471 /// Creates a new default instance.
14472 pub fn new() -> Self {
14473 std::default::Default::default()
14474 }
14475
14476 /// Sets the value of [query][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::query].
14477 ///
14478 /// # Example
14479 /// ```ignore,no_run
14480 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14481 /// let x = ActionSqlDefinition::new().set_query("example");
14482 /// ```
14483 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14484 self.query = v.into();
14485 self
14486 }
14487
14488 /// Sets the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
14489 ///
14490 /// # Example
14491 /// ```ignore,no_run
14492 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14493 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14494 /// let x = ActionSqlDefinition::new().set_error_table(ActionErrorTable::default()/* use setters */);
14495 /// ```
14496 pub fn set_error_table<T>(mut self, v: T) -> Self
14497 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
14498 {
14499 self.error_table = std::option::Option::Some(v.into());
14500 self
14501 }
14502
14503 /// Sets or clears the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
14504 ///
14505 /// # Example
14506 /// ```ignore,no_run
14507 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14508 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14509 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(Some(ActionErrorTable::default()/* use setters */));
14510 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(None::<ActionErrorTable>);
14511 /// ```
14512 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
14513 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
14514 {
14515 self.error_table = v.map(|x| x.into());
14516 self
14517 }
14518
14519 /// Sets the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
14520 ///
14521 /// # Example
14522 /// ```ignore,no_run
14523 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14524 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14525 /// let x = ActionSqlDefinition::new().set_load_config(ActionLoadConfig::default()/* use setters */);
14526 /// ```
14527 pub fn set_load_config<T>(mut self, v: T) -> Self
14528 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
14529 {
14530 self.load_config = std::option::Option::Some(v.into());
14531 self
14532 }
14533
14534 /// Sets or clears the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
14535 ///
14536 /// # Example
14537 /// ```ignore,no_run
14538 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14539 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14540 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(Some(ActionLoadConfig::default()/* use setters */));
14541 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(None::<ActionLoadConfig>);
14542 /// ```
14543 pub fn set_or_clear_load_config<T>(mut self, v: std::option::Option<T>) -> Self
14544 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
14545 {
14546 self.load_config = v.map(|x| x.into());
14547 self
14548 }
14549 }
14550
14551 impl wkt::message::Message for ActionSqlDefinition {
14552 fn typename() -> &'static str {
14553 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition"
14554 }
14555 }
14556
14557 /// Error table information, used to write error data into a BigQuery
14558 /// table.
14559 #[derive(Clone, Default, PartialEq)]
14560 #[non_exhaustive]
14561 pub struct ActionErrorTable {
14562 /// Error Table target.
14563 pub target: std::option::Option<crate::model::Target>,
14564
14565 /// Error table partition expiration in days. Only positive values are
14566 /// allowed.
14567 pub retention_days: i32,
14568
14569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14570 }
14571
14572 impl ActionErrorTable {
14573 /// Creates a new default instance.
14574 pub fn new() -> Self {
14575 std::default::Default::default()
14576 }
14577
14578 /// Sets the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
14579 ///
14580 /// # Example
14581 /// ```ignore,no_run
14582 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14583 /// use google_cloud_dataform_v1::model::Target;
14584 /// let x = ActionErrorTable::new().set_target(Target::default()/* use setters */);
14585 /// ```
14586 pub fn set_target<T>(mut self, v: T) -> Self
14587 where
14588 T: std::convert::Into<crate::model::Target>,
14589 {
14590 self.target = std::option::Option::Some(v.into());
14591 self
14592 }
14593
14594 /// Sets or clears the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
14595 ///
14596 /// # Example
14597 /// ```ignore,no_run
14598 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14599 /// use google_cloud_dataform_v1::model::Target;
14600 /// let x = ActionErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
14601 /// let x = ActionErrorTable::new().set_or_clear_target(None::<Target>);
14602 /// ```
14603 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
14604 where
14605 T: std::convert::Into<crate::model::Target>,
14606 {
14607 self.target = v.map(|x| x.into());
14608 self
14609 }
14610
14611 /// Sets the value of [retention_days][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::retention_days].
14612 ///
14613 /// # Example
14614 /// ```ignore,no_run
14615 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14616 /// let x = ActionErrorTable::new().set_retention_days(42);
14617 /// ```
14618 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14619 self.retention_days = v.into();
14620 self
14621 }
14622 }
14623
14624 impl wkt::message::Message for ActionErrorTable {
14625 fn typename() -> &'static str {
14626 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable"
14627 }
14628 }
14629
14630 /// Simplified load configuration for actions
14631 #[derive(Clone, Default, PartialEq)]
14632 #[non_exhaustive]
14633 pub struct ActionLoadConfig {
14634
14635 /// Load mode
14636 pub mode: std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>,
14637
14638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14639 }
14640
14641 impl ActionLoadConfig {
14642 /// Creates a new default instance.
14643 pub fn new() -> Self {
14644 std::default::Default::default()
14645 }
14646
14647 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode].
14648 ///
14649 /// Note that all the setters affecting `mode` are mutually
14650 /// exclusive.
14651 ///
14652 /// # Example
14653 /// ```ignore,no_run
14654 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14655 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14656 /// let x = ActionLoadConfig::new().set_mode(Some(
14657 /// google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(ActionSimpleLoadMode::default().into())));
14658 /// ```
14659 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
14660 {
14661 self.mode = v.into();
14662 self
14663 }
14664
14665 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14666 /// if it holds a `Replace`, `None` if the field is not set or
14667 /// holds a different branch.
14668 pub fn replace(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
14669 #[allow(unreachable_patterns)]
14670 self.mode.as_ref().and_then(|v| match v {
14671 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(v) => std::option::Option::Some(v),
14672 _ => std::option::Option::None,
14673 })
14674 }
14675
14676 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14677 /// to hold a `Replace`.
14678 ///
14679 /// Note that all the setters affecting `mode` are
14680 /// mutually exclusive.
14681 ///
14682 /// # Example
14683 /// ```ignore,no_run
14684 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14685 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14686 /// let x = ActionLoadConfig::new().set_replace(ActionSimpleLoadMode::default()/* use setters */);
14687 /// assert!(x.replace().is_some());
14688 /// assert!(x.append().is_none());
14689 /// assert!(x.maximum().is_none());
14690 /// assert!(x.unique().is_none());
14691 /// ```
14692 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{
14693 self.mode = std::option::Option::Some(
14694 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(
14695 v.into()
14696 )
14697 );
14698 self
14699 }
14700
14701 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14702 /// if it holds a `Append`, `None` if the field is not set or
14703 /// holds a different branch.
14704 pub fn append(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
14705 #[allow(unreachable_patterns)]
14706 self.mode.as_ref().and_then(|v| match v {
14707 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(v) => std::option::Option::Some(v),
14708 _ => std::option::Option::None,
14709 })
14710 }
14711
14712 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14713 /// to hold a `Append`.
14714 ///
14715 /// Note that all the setters affecting `mode` are
14716 /// mutually exclusive.
14717 ///
14718 /// # Example
14719 /// ```ignore,no_run
14720 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14721 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14722 /// let x = ActionLoadConfig::new().set_append(ActionSimpleLoadMode::default()/* use setters */);
14723 /// assert!(x.append().is_some());
14724 /// assert!(x.replace().is_none());
14725 /// assert!(x.maximum().is_none());
14726 /// assert!(x.unique().is_none());
14727 /// ```
14728 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{
14729 self.mode = std::option::Option::Some(
14730 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(
14731 v.into()
14732 )
14733 );
14734 self
14735 }
14736
14737 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14738 /// if it holds a `Maximum`, `None` if the field is not set or
14739 /// holds a different branch.
14740 pub fn maximum(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
14741 #[allow(unreachable_patterns)]
14742 self.mode.as_ref().and_then(|v| match v {
14743 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(v) => std::option::Option::Some(v),
14744 _ => std::option::Option::None,
14745 })
14746 }
14747
14748 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14749 /// to hold a `Maximum`.
14750 ///
14751 /// Note that all the setters affecting `mode` are
14752 /// mutually exclusive.
14753 ///
14754 /// # Example
14755 /// ```ignore,no_run
14756 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14757 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
14758 /// let x = ActionLoadConfig::new().set_maximum(ActionIncrementalLoadMode::default()/* use setters */);
14759 /// assert!(x.maximum().is_some());
14760 /// assert!(x.replace().is_none());
14761 /// assert!(x.append().is_none());
14762 /// assert!(x.unique().is_none());
14763 /// ```
14764 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{
14765 self.mode = std::option::Option::Some(
14766 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(
14767 v.into()
14768 )
14769 );
14770 self
14771 }
14772
14773 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14774 /// if it holds a `Unique`, `None` if the field is not set or
14775 /// holds a different branch.
14776 pub fn unique(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
14777 #[allow(unreachable_patterns)]
14778 self.mode.as_ref().and_then(|v| match v {
14779 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(v) => std::option::Option::Some(v),
14780 _ => std::option::Option::None,
14781 })
14782 }
14783
14784 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14785 /// to hold a `Unique`.
14786 ///
14787 /// Note that all the setters affecting `mode` are
14788 /// mutually exclusive.
14789 ///
14790 /// # Example
14791 /// ```ignore,no_run
14792 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14793 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
14794 /// let x = ActionLoadConfig::new().set_unique(ActionIncrementalLoadMode::default()/* use setters */);
14795 /// assert!(x.unique().is_some());
14796 /// assert!(x.replace().is_none());
14797 /// assert!(x.append().is_none());
14798 /// assert!(x.maximum().is_none());
14799 /// ```
14800 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{
14801 self.mode = std::option::Option::Some(
14802 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(
14803 v.into()
14804 )
14805 );
14806 self
14807 }
14808 }
14809
14810 impl wkt::message::Message for ActionLoadConfig {
14811 fn typename() -> &'static str {
14812 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig"
14813 }
14814 }
14815
14816 /// Defines additional types related to [ActionLoadConfig].
14817 pub mod action_load_config {
14818 #[allow(unused_imports)]
14819 use super::*;
14820
14821 /// Load mode
14822 #[derive(Clone, Debug, PartialEq)]
14823 #[non_exhaustive]
14824 pub enum Mode {
14825 /// Replace destination table
14826 Replace(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
14827 /// Append into destination table
14828 Append(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
14829 /// Insert records where the value exceeds the previous maximum value for
14830 /// a column in the destination table
14831 Maximum(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
14832 /// Insert records where the value of a column is not already present in
14833 /// the destination table
14834 Unique(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
14835 }
14836 }
14837
14838 /// Simple load definition
14839 #[derive(Clone, Default, PartialEq)]
14840 #[non_exhaustive]
14841 pub struct ActionSimpleLoadMode {
14842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14843 }
14844
14845 impl ActionSimpleLoadMode {
14846 /// Creates a new default instance.
14847 pub fn new() -> Self {
14848 std::default::Default::default()
14849 }
14850 }
14851
14852 impl wkt::message::Message for ActionSimpleLoadMode {
14853 fn typename() -> &'static str {
14854 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode"
14855 }
14856 }
14857
14858 /// Load definition for incremental load modes
14859 #[derive(Clone, Default, PartialEq)]
14860 #[non_exhaustive]
14861 pub struct ActionIncrementalLoadMode {
14862 /// Column name for incremental load modes
14863 pub column: std::string::String,
14864
14865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14866 }
14867
14868 impl ActionIncrementalLoadMode {
14869 /// Creates a new default instance.
14870 pub fn new() -> Self {
14871 std::default::Default::default()
14872 }
14873
14874 /// Sets the value of [column][crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode::column].
14875 ///
14876 /// # Example
14877 /// ```ignore,no_run
14878 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
14879 /// let x = ActionIncrementalLoadMode::new().set_column("example");
14880 /// ```
14881 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14882 self.column = v.into();
14883 self
14884 }
14885 }
14886
14887 impl wkt::message::Message for ActionIncrementalLoadMode {
14888 fn typename() -> &'static str {
14889 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode"
14890 }
14891 }
14892
14893 /// The definition for the data preparation.
14894 #[derive(Clone, Debug, PartialEq)]
14895 #[non_exhaustive]
14896 pub enum Definition {
14897 /// Output only. YAML representing the contents of the data preparation.
14898 /// Can be used to show the customer what the input was to their workflow.
14899 ContentsYaml(std::string::String),
14900 /// SQL definition for a Data Preparation. Contains a SQL query and
14901 /// additional context information.
14902 ContentsSql(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>),
14903 }
14904 }
14905
14906 /// Represents the current state of a workflow invocation action.
14907 ///
14908 /// # Working with unknown values
14909 ///
14910 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14911 /// additional enum variants at any time. Adding new variants is not considered
14912 /// a breaking change. Applications should write their code in anticipation of:
14913 ///
14914 /// - New values appearing in future releases of the client library, **and**
14915 /// - New values received dynamically, without application changes.
14916 ///
14917 /// Please consult the [Working with enums] section in the user guide for some
14918 /// guidelines.
14919 ///
14920 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14921 #[derive(Clone, Debug, PartialEq)]
14922 #[non_exhaustive]
14923 pub enum State {
14924 /// The action has not yet been considered for invocation.
14925 Pending,
14926 /// The action is currently running.
14927 Running,
14928 /// Execution of the action was skipped because upstream dependencies did not
14929 /// all complete successfully. A terminal state.
14930 Skipped,
14931 /// Execution of the action was disabled as per the configuration of the
14932 /// corresponding compilation result action. A terminal state.
14933 Disabled,
14934 /// The action succeeded. A terminal state.
14935 Succeeded,
14936 /// The action was cancelled. A terminal state.
14937 Cancelled,
14938 /// The action failed. A terminal state.
14939 Failed,
14940 /// If set, the enum was initialized with an unknown value.
14941 ///
14942 /// Applications can examine the value using [State::value] or
14943 /// [State::name].
14944 UnknownValue(state::UnknownValue),
14945 }
14946
14947 #[doc(hidden)]
14948 pub mod state {
14949 #[allow(unused_imports)]
14950 use super::*;
14951 #[derive(Clone, Debug, PartialEq)]
14952 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14953 }
14954
14955 impl State {
14956 /// Gets the enum value.
14957 ///
14958 /// Returns `None` if the enum contains an unknown value deserialized from
14959 /// the string representation of enums.
14960 pub fn value(&self) -> std::option::Option<i32> {
14961 match self {
14962 Self::Pending => std::option::Option::Some(0),
14963 Self::Running => std::option::Option::Some(1),
14964 Self::Skipped => std::option::Option::Some(2),
14965 Self::Disabled => std::option::Option::Some(3),
14966 Self::Succeeded => std::option::Option::Some(4),
14967 Self::Cancelled => std::option::Option::Some(5),
14968 Self::Failed => std::option::Option::Some(6),
14969 Self::UnknownValue(u) => u.0.value(),
14970 }
14971 }
14972
14973 /// Gets the enum value as a string.
14974 ///
14975 /// Returns `None` if the enum contains an unknown value deserialized from
14976 /// the integer representation of enums.
14977 pub fn name(&self) -> std::option::Option<&str> {
14978 match self {
14979 Self::Pending => std::option::Option::Some("PENDING"),
14980 Self::Running => std::option::Option::Some("RUNNING"),
14981 Self::Skipped => std::option::Option::Some("SKIPPED"),
14982 Self::Disabled => std::option::Option::Some("DISABLED"),
14983 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14984 Self::Cancelled => std::option::Option::Some("CANCELLED"),
14985 Self::Failed => std::option::Option::Some("FAILED"),
14986 Self::UnknownValue(u) => u.0.name(),
14987 }
14988 }
14989 }
14990
14991 impl std::default::Default for State {
14992 fn default() -> Self {
14993 use std::convert::From;
14994 Self::from(0)
14995 }
14996 }
14997
14998 impl std::fmt::Display for State {
14999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15000 wkt::internal::display_enum(f, self.name(), self.value())
15001 }
15002 }
15003
15004 impl std::convert::From<i32> for State {
15005 fn from(value: i32) -> Self {
15006 match value {
15007 0 => Self::Pending,
15008 1 => Self::Running,
15009 2 => Self::Skipped,
15010 3 => Self::Disabled,
15011 4 => Self::Succeeded,
15012 5 => Self::Cancelled,
15013 6 => Self::Failed,
15014 _ => Self::UnknownValue(state::UnknownValue(
15015 wkt::internal::UnknownEnumValue::Integer(value),
15016 )),
15017 }
15018 }
15019 }
15020
15021 impl std::convert::From<&str> for State {
15022 fn from(value: &str) -> Self {
15023 use std::string::ToString;
15024 match value {
15025 "PENDING" => Self::Pending,
15026 "RUNNING" => Self::Running,
15027 "SKIPPED" => Self::Skipped,
15028 "DISABLED" => Self::Disabled,
15029 "SUCCEEDED" => Self::Succeeded,
15030 "CANCELLED" => Self::Cancelled,
15031 "FAILED" => Self::Failed,
15032 _ => Self::UnknownValue(state::UnknownValue(
15033 wkt::internal::UnknownEnumValue::String(value.to_string()),
15034 )),
15035 }
15036 }
15037 }
15038
15039 impl serde::ser::Serialize for State {
15040 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15041 where
15042 S: serde::Serializer,
15043 {
15044 match self {
15045 Self::Pending => serializer.serialize_i32(0),
15046 Self::Running => serializer.serialize_i32(1),
15047 Self::Skipped => serializer.serialize_i32(2),
15048 Self::Disabled => serializer.serialize_i32(3),
15049 Self::Succeeded => serializer.serialize_i32(4),
15050 Self::Cancelled => serializer.serialize_i32(5),
15051 Self::Failed => serializer.serialize_i32(6),
15052 Self::UnknownValue(u) => u.0.serialize(serializer),
15053 }
15054 }
15055 }
15056
15057 impl<'de> serde::de::Deserialize<'de> for State {
15058 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15059 where
15060 D: serde::Deserializer<'de>,
15061 {
15062 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15063 ".google.cloud.dataform.v1.WorkflowInvocationAction.State",
15064 ))
15065 }
15066 }
15067
15068 /// The action's details.
15069 #[derive(Clone, Debug, PartialEq)]
15070 #[non_exhaustive]
15071 pub enum Action {
15072 /// Output only. The workflow action's bigquery action details.
15073 BigqueryAction(std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>),
15074 /// Output only. The workflow action's notebook action details.
15075 NotebookAction(std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>),
15076 /// Output only. The workflow action's data preparation action details.
15077 DataPreparationAction(
15078 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
15079 ),
15080 }
15081}
15082
15083/// `QueryWorkflowInvocationActions` request message.
15084#[derive(Clone, Default, PartialEq)]
15085#[non_exhaustive]
15086pub struct QueryWorkflowInvocationActionsRequest {
15087 /// Required. The workflow invocation's name.
15088 pub name: std::string::String,
15089
15090 /// Optional. Maximum number of workflow invocations to return. The server may
15091 /// return fewer items than requested. If unspecified, the server will pick an
15092 /// appropriate default.
15093 pub page_size: i32,
15094
15095 /// Optional. Page token received from a previous
15096 /// `QueryWorkflowInvocationActions` call. Provide this to retrieve the
15097 /// subsequent page.
15098 ///
15099 /// When paginating, all other parameters provided to
15100 /// `QueryWorkflowInvocationActions`, with the exception of `page_size`, must
15101 /// match the call that provided the page token.
15102 pub page_token: std::string::String,
15103
15104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15105}
15106
15107impl QueryWorkflowInvocationActionsRequest {
15108 /// Creates a new default instance.
15109 pub fn new() -> Self {
15110 std::default::Default::default()
15111 }
15112
15113 /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
15114 ///
15115 /// # Example
15116 /// ```ignore,no_run
15117 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15118 /// # let project_id = "project_id";
15119 /// # let location_id = "location_id";
15120 /// # let repository_id = "repository_id";
15121 /// # let workflow_invocation_id = "workflow_invocation_id";
15122 /// let x = QueryWorkflowInvocationActionsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
15123 /// ```
15124 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15125 self.name = v.into();
15126 self
15127 }
15128
15129 /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
15130 ///
15131 /// # Example
15132 /// ```ignore,no_run
15133 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15134 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_size(42);
15135 /// ```
15136 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15137 self.page_size = v.into();
15138 self
15139 }
15140
15141 /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
15142 ///
15143 /// # Example
15144 /// ```ignore,no_run
15145 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15146 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_token("example");
15147 /// ```
15148 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15149 self.page_token = v.into();
15150 self
15151 }
15152}
15153
15154impl wkt::message::Message for QueryWorkflowInvocationActionsRequest {
15155 fn typename() -> &'static str {
15156 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsRequest"
15157 }
15158}
15159
15160/// `QueryWorkflowInvocationActions` response message.
15161#[derive(Clone, Default, PartialEq)]
15162#[non_exhaustive]
15163pub struct QueryWorkflowInvocationActionsResponse {
15164 /// List of workflow invocation actions.
15165 pub workflow_invocation_actions: std::vec::Vec<crate::model::WorkflowInvocationAction>,
15166
15167 /// A token, which can be sent as `page_token` to retrieve the next page.
15168 /// If this field is omitted, there are no subsequent pages.
15169 pub next_page_token: std::string::String,
15170
15171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15172}
15173
15174impl QueryWorkflowInvocationActionsResponse {
15175 /// Creates a new default instance.
15176 pub fn new() -> Self {
15177 std::default::Default::default()
15178 }
15179
15180 /// Sets the value of [workflow_invocation_actions][crate::model::QueryWorkflowInvocationActionsResponse::workflow_invocation_actions].
15181 ///
15182 /// # Example
15183 /// ```ignore,no_run
15184 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
15185 /// use google_cloud_dataform_v1::model::WorkflowInvocationAction;
15186 /// let x = QueryWorkflowInvocationActionsResponse::new()
15187 /// .set_workflow_invocation_actions([
15188 /// WorkflowInvocationAction::default()/* use setters */,
15189 /// WorkflowInvocationAction::default()/* use (different) setters */,
15190 /// ]);
15191 /// ```
15192 pub fn set_workflow_invocation_actions<T, V>(mut self, v: T) -> Self
15193 where
15194 T: std::iter::IntoIterator<Item = V>,
15195 V: std::convert::Into<crate::model::WorkflowInvocationAction>,
15196 {
15197 use std::iter::Iterator;
15198 self.workflow_invocation_actions = v.into_iter().map(|i| i.into()).collect();
15199 self
15200 }
15201
15202 /// Sets the value of [next_page_token][crate::model::QueryWorkflowInvocationActionsResponse::next_page_token].
15203 ///
15204 /// # Example
15205 /// ```ignore,no_run
15206 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
15207 /// let x = QueryWorkflowInvocationActionsResponse::new().set_next_page_token("example");
15208 /// ```
15209 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15210 self.next_page_token = v.into();
15211 self
15212 }
15213}
15214
15215impl wkt::message::Message for QueryWorkflowInvocationActionsResponse {
15216 fn typename() -> &'static str {
15217 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsResponse"
15218 }
15219}
15220
15221#[doc(hidden)]
15222impl google_cloud_gax::paginator::internal::PageableResponse
15223 for QueryWorkflowInvocationActionsResponse
15224{
15225 type PageItem = crate::model::WorkflowInvocationAction;
15226
15227 fn items(self) -> std::vec::Vec<Self::PageItem> {
15228 self.workflow_invocation_actions
15229 }
15230
15231 fn next_page_token(&self) -> std::string::String {
15232 use std::clone::Clone;
15233 self.next_page_token.clone()
15234 }
15235}
15236
15237/// Config for all repositories in a given project and location.
15238#[derive(Clone, Default, PartialEq)]
15239#[non_exhaustive]
15240pub struct Config {
15241 /// Identifier. The config name.
15242 pub name: std::string::String,
15243
15244 /// Optional. The default KMS key that is used if no encryption key is provided
15245 /// when a repository is created.
15246 pub default_kms_key_name: std::string::String,
15247
15248 /// Output only. All the metadata information that is used internally to serve
15249 /// the resource. For example: timestamps, flags, status fields, etc. The
15250 /// format of this field is a JSON string.
15251 pub internal_metadata: std::option::Option<std::string::String>,
15252
15253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15254}
15255
15256impl Config {
15257 /// Creates a new default instance.
15258 pub fn new() -> Self {
15259 std::default::Default::default()
15260 }
15261
15262 /// Sets the value of [name][crate::model::Config::name].
15263 ///
15264 /// # Example
15265 /// ```ignore,no_run
15266 /// # use google_cloud_dataform_v1::model::Config;
15267 /// # let project_id = "project_id";
15268 /// # let location_id = "location_id";
15269 /// let x = Config::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
15270 /// ```
15271 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15272 self.name = v.into();
15273 self
15274 }
15275
15276 /// Sets the value of [default_kms_key_name][crate::model::Config::default_kms_key_name].
15277 ///
15278 /// # Example
15279 /// ```ignore,no_run
15280 /// # use google_cloud_dataform_v1::model::Config;
15281 /// let x = Config::new().set_default_kms_key_name("example");
15282 /// ```
15283 pub fn set_default_kms_key_name<T: std::convert::Into<std::string::String>>(
15284 mut self,
15285 v: T,
15286 ) -> Self {
15287 self.default_kms_key_name = v.into();
15288 self
15289 }
15290
15291 /// Sets the value of [internal_metadata][crate::model::Config::internal_metadata].
15292 ///
15293 /// # Example
15294 /// ```ignore,no_run
15295 /// # use google_cloud_dataform_v1::model::Config;
15296 /// let x = Config::new().set_internal_metadata("example");
15297 /// ```
15298 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
15299 where
15300 T: std::convert::Into<std::string::String>,
15301 {
15302 self.internal_metadata = std::option::Option::Some(v.into());
15303 self
15304 }
15305
15306 /// Sets or clears the value of [internal_metadata][crate::model::Config::internal_metadata].
15307 ///
15308 /// # Example
15309 /// ```ignore,no_run
15310 /// # use google_cloud_dataform_v1::model::Config;
15311 /// let x = Config::new().set_or_clear_internal_metadata(Some("example"));
15312 /// let x = Config::new().set_or_clear_internal_metadata(None::<String>);
15313 /// ```
15314 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15315 where
15316 T: std::convert::Into<std::string::String>,
15317 {
15318 self.internal_metadata = v.map(|x| x.into());
15319 self
15320 }
15321}
15322
15323impl wkt::message::Message for Config {
15324 fn typename() -> &'static str {
15325 "type.googleapis.com/google.cloud.dataform.v1.Config"
15326 }
15327}
15328
15329/// `GetConfig` request message.
15330#[derive(Clone, Default, PartialEq)]
15331#[non_exhaustive]
15332pub struct GetConfigRequest {
15333 /// Required. The config name.
15334 pub name: std::string::String,
15335
15336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15337}
15338
15339impl GetConfigRequest {
15340 /// Creates a new default instance.
15341 pub fn new() -> Self {
15342 std::default::Default::default()
15343 }
15344
15345 /// Sets the value of [name][crate::model::GetConfigRequest::name].
15346 ///
15347 /// # Example
15348 /// ```ignore,no_run
15349 /// # use google_cloud_dataform_v1::model::GetConfigRequest;
15350 /// # let project_id = "project_id";
15351 /// # let location_id = "location_id";
15352 /// let x = GetConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
15353 /// ```
15354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15355 self.name = v.into();
15356 self
15357 }
15358}
15359
15360impl wkt::message::Message for GetConfigRequest {
15361 fn typename() -> &'static str {
15362 "type.googleapis.com/google.cloud.dataform.v1.GetConfigRequest"
15363 }
15364}
15365
15366/// `UpdateConfig` request message.
15367#[derive(Clone, Default, PartialEq)]
15368#[non_exhaustive]
15369pub struct UpdateConfigRequest {
15370 /// Required. The config to update.
15371 pub config: std::option::Option<crate::model::Config>,
15372
15373 /// Optional. Specifies the fields to be updated in the config.
15374 pub update_mask: std::option::Option<wkt::FieldMask>,
15375
15376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15377}
15378
15379impl UpdateConfigRequest {
15380 /// Creates a new default instance.
15381 pub fn new() -> Self {
15382 std::default::Default::default()
15383 }
15384
15385 /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
15386 ///
15387 /// # Example
15388 /// ```ignore,no_run
15389 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15390 /// use google_cloud_dataform_v1::model::Config;
15391 /// let x = UpdateConfigRequest::new().set_config(Config::default()/* use setters */);
15392 /// ```
15393 pub fn set_config<T>(mut self, v: T) -> Self
15394 where
15395 T: std::convert::Into<crate::model::Config>,
15396 {
15397 self.config = std::option::Option::Some(v.into());
15398 self
15399 }
15400
15401 /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
15402 ///
15403 /// # Example
15404 /// ```ignore,no_run
15405 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15406 /// use google_cloud_dataform_v1::model::Config;
15407 /// let x = UpdateConfigRequest::new().set_or_clear_config(Some(Config::default()/* use setters */));
15408 /// let x = UpdateConfigRequest::new().set_or_clear_config(None::<Config>);
15409 /// ```
15410 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
15411 where
15412 T: std::convert::Into<crate::model::Config>,
15413 {
15414 self.config = v.map(|x| x.into());
15415 self
15416 }
15417
15418 /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
15419 ///
15420 /// # Example
15421 /// ```ignore,no_run
15422 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15423 /// use wkt::FieldMask;
15424 /// let x = UpdateConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15425 /// ```
15426 pub fn set_update_mask<T>(mut self, v: T) -> Self
15427 where
15428 T: std::convert::Into<wkt::FieldMask>,
15429 {
15430 self.update_mask = std::option::Option::Some(v.into());
15431 self
15432 }
15433
15434 /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
15435 ///
15436 /// # Example
15437 /// ```ignore,no_run
15438 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15439 /// use wkt::FieldMask;
15440 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15441 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15442 /// ```
15443 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15444 where
15445 T: std::convert::Into<wkt::FieldMask>,
15446 {
15447 self.update_mask = v.map(|x| x.into());
15448 self
15449 }
15450}
15451
15452impl wkt::message::Message for UpdateConfigRequest {
15453 fn typename() -> &'static str {
15454 "type.googleapis.com/google.cloud.dataform.v1.UpdateConfigRequest"
15455 }
15456}
15457
15458/// Represents a Dataform Folder. This is a resource that is used to organize
15459/// Files and other Folders and provide hierarchical access controls.
15460#[derive(Clone, Default, PartialEq)]
15461#[non_exhaustive]
15462pub struct Folder {
15463 /// Identifier. The Folder's name.
15464 pub name: std::string::String,
15465
15466 /// Required. The Folder's user-friendly name.
15467 pub display_name: std::string::String,
15468
15469 /// Optional. The containing Folder resource name. This should take
15470 /// the format: projects/{project}/locations/{location}/folders/{folder},
15471 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}, or just
15472 /// "" if this is a root Folder. This field can only be updated through
15473 /// MoveFolder.
15474 pub containing_folder: std::string::String,
15475
15476 /// Output only. The resource name of the TeamFolder that this Folder is
15477 /// associated with. This should take the format:
15478 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this
15479 /// is not set, the Folder is not associated with a TeamFolder and is a
15480 /// UserFolder.
15481 pub team_folder_name: std::string::String,
15482
15483 /// Output only. The timestamp of when the Folder was created.
15484 pub create_time: std::option::Option<wkt::Timestamp>,
15485
15486 /// Output only. The timestamp of when the Folder was last updated.
15487 pub update_time: std::option::Option<wkt::Timestamp>,
15488
15489 /// Output only. All the metadata information that is used internally to serve
15490 /// the resource. For example: timestamps, flags, status fields, etc. The
15491 /// format of this field is a JSON string.
15492 pub internal_metadata: std::option::Option<std::string::String>,
15493
15494 /// Output only. The IAM principal identifier of the creator of the Folder.
15495 pub creator_iam_principal: std::option::Option<std::string::String>,
15496
15497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15498}
15499
15500impl Folder {
15501 /// Creates a new default instance.
15502 pub fn new() -> Self {
15503 std::default::Default::default()
15504 }
15505
15506 /// Sets the value of [name][crate::model::Folder::name].
15507 ///
15508 /// # Example
15509 /// ```ignore,no_run
15510 /// # use google_cloud_dataform_v1::model::Folder;
15511 /// # let project_id = "project_id";
15512 /// # let location_id = "location_id";
15513 /// # let folder_id = "folder_id";
15514 /// let x = Folder::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
15515 /// ```
15516 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15517 self.name = v.into();
15518 self
15519 }
15520
15521 /// Sets the value of [display_name][crate::model::Folder::display_name].
15522 ///
15523 /// # Example
15524 /// ```ignore,no_run
15525 /// # use google_cloud_dataform_v1::model::Folder;
15526 /// let x = Folder::new().set_display_name("example");
15527 /// ```
15528 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15529 self.display_name = v.into();
15530 self
15531 }
15532
15533 /// Sets the value of [containing_folder][crate::model::Folder::containing_folder].
15534 ///
15535 /// # Example
15536 /// ```ignore,no_run
15537 /// # use google_cloud_dataform_v1::model::Folder;
15538 /// let x = Folder::new().set_containing_folder("example");
15539 /// ```
15540 pub fn set_containing_folder<T: std::convert::Into<std::string::String>>(
15541 mut self,
15542 v: T,
15543 ) -> Self {
15544 self.containing_folder = v.into();
15545 self
15546 }
15547
15548 /// Sets the value of [team_folder_name][crate::model::Folder::team_folder_name].
15549 ///
15550 /// # Example
15551 /// ```ignore,no_run
15552 /// # use google_cloud_dataform_v1::model::Folder;
15553 /// let x = Folder::new().set_team_folder_name("example");
15554 /// ```
15555 pub fn set_team_folder_name<T: std::convert::Into<std::string::String>>(
15556 mut self,
15557 v: T,
15558 ) -> Self {
15559 self.team_folder_name = v.into();
15560 self
15561 }
15562
15563 /// Sets the value of [create_time][crate::model::Folder::create_time].
15564 ///
15565 /// # Example
15566 /// ```ignore,no_run
15567 /// # use google_cloud_dataform_v1::model::Folder;
15568 /// use wkt::Timestamp;
15569 /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
15570 /// ```
15571 pub fn set_create_time<T>(mut self, v: T) -> Self
15572 where
15573 T: std::convert::Into<wkt::Timestamp>,
15574 {
15575 self.create_time = std::option::Option::Some(v.into());
15576 self
15577 }
15578
15579 /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
15580 ///
15581 /// # Example
15582 /// ```ignore,no_run
15583 /// # use google_cloud_dataform_v1::model::Folder;
15584 /// use wkt::Timestamp;
15585 /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15586 /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
15587 /// ```
15588 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15589 where
15590 T: std::convert::Into<wkt::Timestamp>,
15591 {
15592 self.create_time = v.map(|x| x.into());
15593 self
15594 }
15595
15596 /// Sets the value of [update_time][crate::model::Folder::update_time].
15597 ///
15598 /// # Example
15599 /// ```ignore,no_run
15600 /// # use google_cloud_dataform_v1::model::Folder;
15601 /// use wkt::Timestamp;
15602 /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
15603 /// ```
15604 pub fn set_update_time<T>(mut self, v: T) -> Self
15605 where
15606 T: std::convert::Into<wkt::Timestamp>,
15607 {
15608 self.update_time = std::option::Option::Some(v.into());
15609 self
15610 }
15611
15612 /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
15613 ///
15614 /// # Example
15615 /// ```ignore,no_run
15616 /// # use google_cloud_dataform_v1::model::Folder;
15617 /// use wkt::Timestamp;
15618 /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15619 /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
15620 /// ```
15621 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15622 where
15623 T: std::convert::Into<wkt::Timestamp>,
15624 {
15625 self.update_time = v.map(|x| x.into());
15626 self
15627 }
15628
15629 /// Sets the value of [internal_metadata][crate::model::Folder::internal_metadata].
15630 ///
15631 /// # Example
15632 /// ```ignore,no_run
15633 /// # use google_cloud_dataform_v1::model::Folder;
15634 /// let x = Folder::new().set_internal_metadata("example");
15635 /// ```
15636 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
15637 where
15638 T: std::convert::Into<std::string::String>,
15639 {
15640 self.internal_metadata = std::option::Option::Some(v.into());
15641 self
15642 }
15643
15644 /// Sets or clears the value of [internal_metadata][crate::model::Folder::internal_metadata].
15645 ///
15646 /// # Example
15647 /// ```ignore,no_run
15648 /// # use google_cloud_dataform_v1::model::Folder;
15649 /// let x = Folder::new().set_or_clear_internal_metadata(Some("example"));
15650 /// let x = Folder::new().set_or_clear_internal_metadata(None::<String>);
15651 /// ```
15652 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15653 where
15654 T: std::convert::Into<std::string::String>,
15655 {
15656 self.internal_metadata = v.map(|x| x.into());
15657 self
15658 }
15659
15660 /// Sets the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
15661 ///
15662 /// # Example
15663 /// ```ignore,no_run
15664 /// # use google_cloud_dataform_v1::model::Folder;
15665 /// let x = Folder::new().set_creator_iam_principal("example");
15666 /// ```
15667 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
15668 where
15669 T: std::convert::Into<std::string::String>,
15670 {
15671 self.creator_iam_principal = std::option::Option::Some(v.into());
15672 self
15673 }
15674
15675 /// Sets or clears the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
15676 ///
15677 /// # Example
15678 /// ```ignore,no_run
15679 /// # use google_cloud_dataform_v1::model::Folder;
15680 /// let x = Folder::new().set_or_clear_creator_iam_principal(Some("example"));
15681 /// let x = Folder::new().set_or_clear_creator_iam_principal(None::<String>);
15682 /// ```
15683 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
15684 where
15685 T: std::convert::Into<std::string::String>,
15686 {
15687 self.creator_iam_principal = v.map(|x| x.into());
15688 self
15689 }
15690}
15691
15692impl wkt::message::Message for Folder {
15693 fn typename() -> &'static str {
15694 "type.googleapis.com/google.cloud.dataform.v1.Folder"
15695 }
15696}
15697
15698/// `CreateFolder` request message.
15699#[derive(Clone, Default, PartialEq)]
15700#[non_exhaustive]
15701pub struct CreateFolderRequest {
15702 /// Required. The location in which to create the Folder. Must be in the format
15703 /// `projects/*/locations/*`.
15704 pub parent: std::string::String,
15705
15706 /// Required. The Folder to create.
15707 pub folder: std::option::Option<crate::model::Folder>,
15708
15709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15710}
15711
15712impl CreateFolderRequest {
15713 /// Creates a new default instance.
15714 pub fn new() -> Self {
15715 std::default::Default::default()
15716 }
15717
15718 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
15719 ///
15720 /// # Example
15721 /// ```ignore,no_run
15722 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15723 /// let x = CreateFolderRequest::new().set_parent("example");
15724 /// ```
15725 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15726 self.parent = v.into();
15727 self
15728 }
15729
15730 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
15731 ///
15732 /// # Example
15733 /// ```ignore,no_run
15734 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15735 /// use google_cloud_dataform_v1::model::Folder;
15736 /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
15737 /// ```
15738 pub fn set_folder<T>(mut self, v: T) -> Self
15739 where
15740 T: std::convert::Into<crate::model::Folder>,
15741 {
15742 self.folder = std::option::Option::Some(v.into());
15743 self
15744 }
15745
15746 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
15747 ///
15748 /// # Example
15749 /// ```ignore,no_run
15750 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15751 /// use google_cloud_dataform_v1::model::Folder;
15752 /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
15753 /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
15754 /// ```
15755 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
15756 where
15757 T: std::convert::Into<crate::model::Folder>,
15758 {
15759 self.folder = v.map(|x| x.into());
15760 self
15761 }
15762}
15763
15764impl wkt::message::Message for CreateFolderRequest {
15765 fn typename() -> &'static str {
15766 "type.googleapis.com/google.cloud.dataform.v1.CreateFolderRequest"
15767 }
15768}
15769
15770/// `MoveFolder` request message.
15771#[derive(Clone, Default, PartialEq)]
15772#[non_exhaustive]
15773pub struct MoveFolderRequest {
15774 /// Required. The full resource name of the Folder to move.
15775 pub name: std::string::String,
15776
15777 /// Optional. The name of the Folder, TeamFolder, or root location to move the
15778 /// Folder to. Can be in the format of: "" to move into the root User folder,
15779 /// `projects/*/locations/*/folders/*`, `projects/*/locations/*/teamFolders/*`
15780 pub destination_containing_folder: std::option::Option<std::string::String>,
15781
15782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15783}
15784
15785impl MoveFolderRequest {
15786 /// Creates a new default instance.
15787 pub fn new() -> Self {
15788 std::default::Default::default()
15789 }
15790
15791 /// Sets the value of [name][crate::model::MoveFolderRequest::name].
15792 ///
15793 /// # Example
15794 /// ```ignore,no_run
15795 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
15796 /// # let project_id = "project_id";
15797 /// # let location_id = "location_id";
15798 /// # let folder_id = "folder_id";
15799 /// let x = MoveFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
15800 /// ```
15801 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15802 self.name = v.into();
15803 self
15804 }
15805
15806 /// Sets the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
15807 ///
15808 /// # Example
15809 /// ```ignore,no_run
15810 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
15811 /// let x = MoveFolderRequest::new().set_destination_containing_folder("example");
15812 /// ```
15813 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
15814 where
15815 T: std::convert::Into<std::string::String>,
15816 {
15817 self.destination_containing_folder = std::option::Option::Some(v.into());
15818 self
15819 }
15820
15821 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
15822 ///
15823 /// # Example
15824 /// ```ignore,no_run
15825 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
15826 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(Some("example"));
15827 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(None::<String>);
15828 /// ```
15829 pub fn set_or_clear_destination_containing_folder<T>(
15830 mut self,
15831 v: std::option::Option<T>,
15832 ) -> Self
15833 where
15834 T: std::convert::Into<std::string::String>,
15835 {
15836 self.destination_containing_folder = v.map(|x| x.into());
15837 self
15838 }
15839}
15840
15841impl wkt::message::Message for MoveFolderRequest {
15842 fn typename() -> &'static str {
15843 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderRequest"
15844 }
15845}
15846
15847/// `GetFolder` request message.
15848#[derive(Clone, Default, PartialEq)]
15849#[non_exhaustive]
15850pub struct GetFolderRequest {
15851 /// Required. The Folder's name.
15852 pub name: std::string::String,
15853
15854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15855}
15856
15857impl GetFolderRequest {
15858 /// Creates a new default instance.
15859 pub fn new() -> Self {
15860 std::default::Default::default()
15861 }
15862
15863 /// Sets the value of [name][crate::model::GetFolderRequest::name].
15864 ///
15865 /// # Example
15866 /// ```ignore,no_run
15867 /// # use google_cloud_dataform_v1::model::GetFolderRequest;
15868 /// # let project_id = "project_id";
15869 /// # let location_id = "location_id";
15870 /// # let folder_id = "folder_id";
15871 /// let x = GetFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
15872 /// ```
15873 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15874 self.name = v.into();
15875 self
15876 }
15877}
15878
15879impl wkt::message::Message for GetFolderRequest {
15880 fn typename() -> &'static str {
15881 "type.googleapis.com/google.cloud.dataform.v1.GetFolderRequest"
15882 }
15883}
15884
15885/// `UpdateFolder` request message.
15886#[derive(Clone, Default, PartialEq)]
15887#[non_exhaustive]
15888pub struct UpdateFolderRequest {
15889 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
15890 /// all fields that can be updated, will be updated. A few fields cannot be
15891 /// updated and will be ignored if specified in the update_mask (e.g.
15892 /// parent_name, team_folder_name).
15893 pub update_mask: std::option::Option<wkt::FieldMask>,
15894
15895 /// Required. The updated Folder.
15896 pub folder: std::option::Option<crate::model::Folder>,
15897
15898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15899}
15900
15901impl UpdateFolderRequest {
15902 /// Creates a new default instance.
15903 pub fn new() -> Self {
15904 std::default::Default::default()
15905 }
15906
15907 /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
15908 ///
15909 /// # Example
15910 /// ```ignore,no_run
15911 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
15912 /// use wkt::FieldMask;
15913 /// let x = UpdateFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15914 /// ```
15915 pub fn set_update_mask<T>(mut self, v: T) -> Self
15916 where
15917 T: std::convert::Into<wkt::FieldMask>,
15918 {
15919 self.update_mask = std::option::Option::Some(v.into());
15920 self
15921 }
15922
15923 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
15924 ///
15925 /// # Example
15926 /// ```ignore,no_run
15927 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
15928 /// use wkt::FieldMask;
15929 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15930 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15931 /// ```
15932 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15933 where
15934 T: std::convert::Into<wkt::FieldMask>,
15935 {
15936 self.update_mask = v.map(|x| x.into());
15937 self
15938 }
15939
15940 /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
15941 ///
15942 /// # Example
15943 /// ```ignore,no_run
15944 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
15945 /// use google_cloud_dataform_v1::model::Folder;
15946 /// let x = UpdateFolderRequest::new().set_folder(Folder::default()/* use setters */);
15947 /// ```
15948 pub fn set_folder<T>(mut self, v: T) -> Self
15949 where
15950 T: std::convert::Into<crate::model::Folder>,
15951 {
15952 self.folder = std::option::Option::Some(v.into());
15953 self
15954 }
15955
15956 /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
15957 ///
15958 /// # Example
15959 /// ```ignore,no_run
15960 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
15961 /// use google_cloud_dataform_v1::model::Folder;
15962 /// let x = UpdateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
15963 /// let x = UpdateFolderRequest::new().set_or_clear_folder(None::<Folder>);
15964 /// ```
15965 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
15966 where
15967 T: std::convert::Into<crate::model::Folder>,
15968 {
15969 self.folder = v.map(|x| x.into());
15970 self
15971 }
15972}
15973
15974impl wkt::message::Message for UpdateFolderRequest {
15975 fn typename() -> &'static str {
15976 "type.googleapis.com/google.cloud.dataform.v1.UpdateFolderRequest"
15977 }
15978}
15979
15980/// `DeleteFolder` request message.
15981#[derive(Clone, Default, PartialEq)]
15982#[non_exhaustive]
15983pub struct DeleteFolderRequest {
15984 /// Required. The Folder's name.
15985 pub name: std::string::String,
15986
15987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15988}
15989
15990impl DeleteFolderRequest {
15991 /// Creates a new default instance.
15992 pub fn new() -> Self {
15993 std::default::Default::default()
15994 }
15995
15996 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
15997 ///
15998 /// # Example
15999 /// ```ignore,no_run
16000 /// # use google_cloud_dataform_v1::model::DeleteFolderRequest;
16001 /// # let project_id = "project_id";
16002 /// # let location_id = "location_id";
16003 /// # let folder_id = "folder_id";
16004 /// let x = DeleteFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16005 /// ```
16006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16007 self.name = v.into();
16008 self
16009 }
16010}
16011
16012impl wkt::message::Message for DeleteFolderRequest {
16013 fn typename() -> &'static str {
16014 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderRequest"
16015 }
16016}
16017
16018/// `DeleteFolderTree` request message.
16019#[derive(Clone, Default, PartialEq)]
16020#[non_exhaustive]
16021pub struct DeleteFolderTreeRequest {
16022 /// Required. The Folder's name.
16023 /// Format: projects/{project}/locations/{location}/folders/{folder}
16024 pub name: std::string::String,
16025
16026 /// Optional. If `false` (default): The operation will fail if any
16027 /// Repository within the folder hierarchy has associated Release Configs or
16028 /// Workflow Configs.
16029 ///
16030 /// If `true`: The operation will attempt to delete everything, including any
16031 /// Release Configs and Workflow Configs linked to Repositories within the
16032 /// folder hierarchy. This permanently removes schedules and resources.
16033 pub force: bool,
16034
16035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16036}
16037
16038impl DeleteFolderTreeRequest {
16039 /// Creates a new default instance.
16040 pub fn new() -> Self {
16041 std::default::Default::default()
16042 }
16043
16044 /// Sets the value of [name][crate::model::DeleteFolderTreeRequest::name].
16045 ///
16046 /// # Example
16047 /// ```ignore,no_run
16048 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
16049 /// # let project_id = "project_id";
16050 /// # let location_id = "location_id";
16051 /// # let folder_id = "folder_id";
16052 /// let x = DeleteFolderTreeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16053 /// ```
16054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16055 self.name = v.into();
16056 self
16057 }
16058
16059 /// Sets the value of [force][crate::model::DeleteFolderTreeRequest::force].
16060 ///
16061 /// # Example
16062 /// ```ignore,no_run
16063 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
16064 /// let x = DeleteFolderTreeRequest::new().set_force(true);
16065 /// ```
16066 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16067 self.force = v.into();
16068 self
16069 }
16070}
16071
16072impl wkt::message::Message for DeleteFolderTreeRequest {
16073 fn typename() -> &'static str {
16074 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeRequest"
16075 }
16076}
16077
16078/// `DeleteTeamFolderTree` request message.
16079#[derive(Clone, Default, PartialEq)]
16080#[non_exhaustive]
16081pub struct DeleteTeamFolderTreeRequest {
16082 /// Required. The TeamFolder's name.
16083 /// Format: projects/{project}/locations/{location}/teamFolders/{team_folder}
16084 pub name: std::string::String,
16085
16086 /// Optional. If `false` (default): The operation will fail if any
16087 /// Repository within the folder hierarchy has associated Release Configs or
16088 /// Workflow Configs.
16089 ///
16090 /// If `true`: The operation will attempt to delete everything, including any
16091 /// Release Configs and Workflow Configs linked to Repositories within the
16092 /// folder hierarchy. This permanently removes schedules and resources.
16093 pub force: bool,
16094
16095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16096}
16097
16098impl DeleteTeamFolderTreeRequest {
16099 /// Creates a new default instance.
16100 pub fn new() -> Self {
16101 std::default::Default::default()
16102 }
16103
16104 /// Sets the value of [name][crate::model::DeleteTeamFolderTreeRequest::name].
16105 ///
16106 /// # Example
16107 /// ```ignore,no_run
16108 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
16109 /// # let project_id = "project_id";
16110 /// # let location_id = "location_id";
16111 /// # let team_folder_id = "team_folder_id";
16112 /// let x = DeleteTeamFolderTreeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
16113 /// ```
16114 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16115 self.name = v.into();
16116 self
16117 }
16118
16119 /// Sets the value of [force][crate::model::DeleteTeamFolderTreeRequest::force].
16120 ///
16121 /// # Example
16122 /// ```ignore,no_run
16123 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
16124 /// let x = DeleteTeamFolderTreeRequest::new().set_force(true);
16125 /// ```
16126 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16127 self.force = v.into();
16128 self
16129 }
16130}
16131
16132impl wkt::message::Message for DeleteTeamFolderTreeRequest {
16133 fn typename() -> &'static str {
16134 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderTreeRequest"
16135 }
16136}
16137
16138/// Contains metadata about the progress of the DeleteFolderTree Long-running
16139/// operations.
16140#[derive(Clone, Default, PartialEq)]
16141#[non_exhaustive]
16142pub struct DeleteFolderTreeMetadata {
16143 /// Output only. The time the operation was created.
16144 pub create_time: std::option::Option<wkt::Timestamp>,
16145
16146 /// Output only. The time the operation finished running.
16147 pub end_time: std::option::Option<wkt::Timestamp>,
16148
16149 /// Output only. Resource name of the target of the operation.
16150 /// Format: projects/{project}/locations/{location}/folders/{folder} or
16151 /// projects/{project}/locations/{location}/teamFolders/{team_folder}
16152 pub target: std::string::String,
16153
16154 /// Output only. The state of the operation.
16155 pub state: crate::model::delete_folder_tree_metadata::State,
16156
16157 /// Output only. Percent complete of the operation [0, 100].
16158 pub percent_complete: i32,
16159
16160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16161}
16162
16163impl DeleteFolderTreeMetadata {
16164 /// Creates a new default instance.
16165 pub fn new() -> Self {
16166 std::default::Default::default()
16167 }
16168
16169 /// Sets the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
16170 ///
16171 /// # Example
16172 /// ```ignore,no_run
16173 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16174 /// use wkt::Timestamp;
16175 /// let x = DeleteFolderTreeMetadata::new().set_create_time(Timestamp::default()/* use setters */);
16176 /// ```
16177 pub fn set_create_time<T>(mut self, v: T) -> Self
16178 where
16179 T: std::convert::Into<wkt::Timestamp>,
16180 {
16181 self.create_time = std::option::Option::Some(v.into());
16182 self
16183 }
16184
16185 /// Sets or clears the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
16186 ///
16187 /// # Example
16188 /// ```ignore,no_run
16189 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16190 /// use wkt::Timestamp;
16191 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16192 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(None::<Timestamp>);
16193 /// ```
16194 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16195 where
16196 T: std::convert::Into<wkt::Timestamp>,
16197 {
16198 self.create_time = v.map(|x| x.into());
16199 self
16200 }
16201
16202 /// Sets the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
16203 ///
16204 /// # Example
16205 /// ```ignore,no_run
16206 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16207 /// use wkt::Timestamp;
16208 /// let x = DeleteFolderTreeMetadata::new().set_end_time(Timestamp::default()/* use setters */);
16209 /// ```
16210 pub fn set_end_time<T>(mut self, v: T) -> Self
16211 where
16212 T: std::convert::Into<wkt::Timestamp>,
16213 {
16214 self.end_time = std::option::Option::Some(v.into());
16215 self
16216 }
16217
16218 /// Sets or clears the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
16219 ///
16220 /// # Example
16221 /// ```ignore,no_run
16222 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16223 /// use wkt::Timestamp;
16224 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16225 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(None::<Timestamp>);
16226 /// ```
16227 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16228 where
16229 T: std::convert::Into<wkt::Timestamp>,
16230 {
16231 self.end_time = v.map(|x| x.into());
16232 self
16233 }
16234
16235 /// Sets the value of [target][crate::model::DeleteFolderTreeMetadata::target].
16236 ///
16237 /// # Example
16238 /// ```ignore,no_run
16239 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16240 /// let x = DeleteFolderTreeMetadata::new().set_target("example");
16241 /// ```
16242 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16243 self.target = v.into();
16244 self
16245 }
16246
16247 /// Sets the value of [state][crate::model::DeleteFolderTreeMetadata::state].
16248 ///
16249 /// # Example
16250 /// ```ignore,no_run
16251 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16252 /// use google_cloud_dataform_v1::model::delete_folder_tree_metadata::State;
16253 /// let x0 = DeleteFolderTreeMetadata::new().set_state(State::Initialized);
16254 /// let x1 = DeleteFolderTreeMetadata::new().set_state(State::InProgress);
16255 /// let x2 = DeleteFolderTreeMetadata::new().set_state(State::Succeeded);
16256 /// ```
16257 pub fn set_state<T: std::convert::Into<crate::model::delete_folder_tree_metadata::State>>(
16258 mut self,
16259 v: T,
16260 ) -> Self {
16261 self.state = v.into();
16262 self
16263 }
16264
16265 /// Sets the value of [percent_complete][crate::model::DeleteFolderTreeMetadata::percent_complete].
16266 ///
16267 /// # Example
16268 /// ```ignore,no_run
16269 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16270 /// let x = DeleteFolderTreeMetadata::new().set_percent_complete(42);
16271 /// ```
16272 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16273 self.percent_complete = v.into();
16274 self
16275 }
16276}
16277
16278impl wkt::message::Message for DeleteFolderTreeMetadata {
16279 fn typename() -> &'static str {
16280 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeMetadata"
16281 }
16282}
16283
16284/// Defines additional types related to [DeleteFolderTreeMetadata].
16285pub mod delete_folder_tree_metadata {
16286 #[allow(unused_imports)]
16287 use super::*;
16288
16289 /// Different states of the DeleteFolderTree operation.
16290 ///
16291 /// # Working with unknown values
16292 ///
16293 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16294 /// additional enum variants at any time. Adding new variants is not considered
16295 /// a breaking change. Applications should write their code in anticipation of:
16296 ///
16297 /// - New values appearing in future releases of the client library, **and**
16298 /// - New values received dynamically, without application changes.
16299 ///
16300 /// Please consult the [Working with enums] section in the user guide for some
16301 /// guidelines.
16302 ///
16303 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16304 #[derive(Clone, Debug, PartialEq)]
16305 #[non_exhaustive]
16306 pub enum State {
16307 /// The state is unspecified.
16308 Unspecified,
16309 /// The operation was initialized and recorded by the server, but not yet
16310 /// started.
16311 Initialized,
16312 /// The operation is in progress.
16313 InProgress,
16314 /// The operation has completed successfully.
16315 Succeeded,
16316 /// The operation has failed.
16317 Failed,
16318 /// If set, the enum was initialized with an unknown value.
16319 ///
16320 /// Applications can examine the value using [State::value] or
16321 /// [State::name].
16322 UnknownValue(state::UnknownValue),
16323 }
16324
16325 #[doc(hidden)]
16326 pub mod state {
16327 #[allow(unused_imports)]
16328 use super::*;
16329 #[derive(Clone, Debug, PartialEq)]
16330 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16331 }
16332
16333 impl State {
16334 /// Gets the enum value.
16335 ///
16336 /// Returns `None` if the enum contains an unknown value deserialized from
16337 /// the string representation of enums.
16338 pub fn value(&self) -> std::option::Option<i32> {
16339 match self {
16340 Self::Unspecified => std::option::Option::Some(0),
16341 Self::Initialized => std::option::Option::Some(1),
16342 Self::InProgress => std::option::Option::Some(2),
16343 Self::Succeeded => std::option::Option::Some(3),
16344 Self::Failed => std::option::Option::Some(4),
16345 Self::UnknownValue(u) => u.0.value(),
16346 }
16347 }
16348
16349 /// Gets the enum value as a string.
16350 ///
16351 /// Returns `None` if the enum contains an unknown value deserialized from
16352 /// the integer representation of enums.
16353 pub fn name(&self) -> std::option::Option<&str> {
16354 match self {
16355 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16356 Self::Initialized => std::option::Option::Some("INITIALIZED"),
16357 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16358 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16359 Self::Failed => std::option::Option::Some("FAILED"),
16360 Self::UnknownValue(u) => u.0.name(),
16361 }
16362 }
16363 }
16364
16365 impl std::default::Default for State {
16366 fn default() -> Self {
16367 use std::convert::From;
16368 Self::from(0)
16369 }
16370 }
16371
16372 impl std::fmt::Display for State {
16373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16374 wkt::internal::display_enum(f, self.name(), self.value())
16375 }
16376 }
16377
16378 impl std::convert::From<i32> for State {
16379 fn from(value: i32) -> Self {
16380 match value {
16381 0 => Self::Unspecified,
16382 1 => Self::Initialized,
16383 2 => Self::InProgress,
16384 3 => Self::Succeeded,
16385 4 => Self::Failed,
16386 _ => Self::UnknownValue(state::UnknownValue(
16387 wkt::internal::UnknownEnumValue::Integer(value),
16388 )),
16389 }
16390 }
16391 }
16392
16393 impl std::convert::From<&str> for State {
16394 fn from(value: &str) -> Self {
16395 use std::string::ToString;
16396 match value {
16397 "STATE_UNSPECIFIED" => Self::Unspecified,
16398 "INITIALIZED" => Self::Initialized,
16399 "IN_PROGRESS" => Self::InProgress,
16400 "SUCCEEDED" => Self::Succeeded,
16401 "FAILED" => Self::Failed,
16402 _ => Self::UnknownValue(state::UnknownValue(
16403 wkt::internal::UnknownEnumValue::String(value.to_string()),
16404 )),
16405 }
16406 }
16407 }
16408
16409 impl serde::ser::Serialize for State {
16410 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16411 where
16412 S: serde::Serializer,
16413 {
16414 match self {
16415 Self::Unspecified => serializer.serialize_i32(0),
16416 Self::Initialized => serializer.serialize_i32(1),
16417 Self::InProgress => serializer.serialize_i32(2),
16418 Self::Succeeded => serializer.serialize_i32(3),
16419 Self::Failed => serializer.serialize_i32(4),
16420 Self::UnknownValue(u) => u.0.serialize(serializer),
16421 }
16422 }
16423 }
16424
16425 impl<'de> serde::de::Deserialize<'de> for State {
16426 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16427 where
16428 D: serde::Deserializer<'de>,
16429 {
16430 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16431 ".google.cloud.dataform.v1.DeleteFolderTreeMetadata.State",
16432 ))
16433 }
16434 }
16435}
16436
16437/// `QueryFolderContents` request message.
16438#[derive(Clone, Default, PartialEq)]
16439#[non_exhaustive]
16440pub struct QueryFolderContentsRequest {
16441 /// Required. Resource name of the Folder to list contents for.
16442 /// Format: projects/*/locations/*/folders/*
16443 pub folder: std::string::String,
16444
16445 /// Optional. Maximum number of paths to return. The server may return fewer
16446 /// items than requested. If unspecified, the server will pick an appropriate
16447 /// default.
16448 pub page_size: i32,
16449
16450 /// Optional. Page token received from a previous `QueryFolderContents` call.
16451 /// Provide this to retrieve the subsequent page.
16452 ///
16453 /// When paginating, all other parameters provided to
16454 /// `QueryFolderContents`, with the exception of `page_size`, must match the
16455 /// call that provided the page token.
16456 pub page_token: std::string::String,
16457
16458 /// Optional. Field to additionally sort results by.
16459 /// Will order Folders before Repositories, and then by `order_by` in ascending
16460 /// order. Supported keywords: display_name (default), create_time,
16461 /// last_modified_time.
16462 /// Examples:
16463 ///
16464 /// * `orderBy="display_name"`
16465 /// * `orderBy="display_name desc"`
16466 pub order_by: std::string::String,
16467
16468 /// Optional. Optional filtering for the returned list. Filtering is currently
16469 /// only supported on the `display_name` field.
16470 ///
16471 /// Example:
16472 ///
16473 /// * `filter="display_name="MyFolder""`
16474 pub filter: std::string::String,
16475
16476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16477}
16478
16479impl QueryFolderContentsRequest {
16480 /// Creates a new default instance.
16481 pub fn new() -> Self {
16482 std::default::Default::default()
16483 }
16484
16485 /// Sets the value of [folder][crate::model::QueryFolderContentsRequest::folder].
16486 ///
16487 /// # Example
16488 /// ```ignore,no_run
16489 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16490 /// # let project_id = "project_id";
16491 /// # let location_id = "location_id";
16492 /// # let folder_id = "folder_id";
16493 /// let x = QueryFolderContentsRequest::new().set_folder(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16494 /// ```
16495 pub fn set_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16496 self.folder = v.into();
16497 self
16498 }
16499
16500 /// Sets the value of [page_size][crate::model::QueryFolderContentsRequest::page_size].
16501 ///
16502 /// # Example
16503 /// ```ignore,no_run
16504 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16505 /// let x = QueryFolderContentsRequest::new().set_page_size(42);
16506 /// ```
16507 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16508 self.page_size = v.into();
16509 self
16510 }
16511
16512 /// Sets the value of [page_token][crate::model::QueryFolderContentsRequest::page_token].
16513 ///
16514 /// # Example
16515 /// ```ignore,no_run
16516 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16517 /// let x = QueryFolderContentsRequest::new().set_page_token("example");
16518 /// ```
16519 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16520 self.page_token = v.into();
16521 self
16522 }
16523
16524 /// Sets the value of [order_by][crate::model::QueryFolderContentsRequest::order_by].
16525 ///
16526 /// # Example
16527 /// ```ignore,no_run
16528 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16529 /// let x = QueryFolderContentsRequest::new().set_order_by("example");
16530 /// ```
16531 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16532 self.order_by = v.into();
16533 self
16534 }
16535
16536 /// Sets the value of [filter][crate::model::QueryFolderContentsRequest::filter].
16537 ///
16538 /// # Example
16539 /// ```ignore,no_run
16540 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16541 /// let x = QueryFolderContentsRequest::new().set_filter("example");
16542 /// ```
16543 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16544 self.filter = v.into();
16545 self
16546 }
16547}
16548
16549impl wkt::message::Message for QueryFolderContentsRequest {
16550 fn typename() -> &'static str {
16551 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsRequest"
16552 }
16553}
16554
16555/// `QueryFolderContents` response message.
16556#[derive(Clone, Default, PartialEq)]
16557#[non_exhaustive]
16558pub struct QueryFolderContentsResponse {
16559 /// List of entries in the folder.
16560 pub entries: std::vec::Vec<crate::model::query_folder_contents_response::FolderContentsEntry>,
16561
16562 /// A token, which can be sent as `page_token` to retrieve the next page.
16563 /// If this field is omitted, there are no subsequent pages.
16564 pub next_page_token: std::string::String,
16565
16566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16567}
16568
16569impl QueryFolderContentsResponse {
16570 /// Creates a new default instance.
16571 pub fn new() -> Self {
16572 std::default::Default::default()
16573 }
16574
16575 /// Sets the value of [entries][crate::model::QueryFolderContentsResponse::entries].
16576 ///
16577 /// # Example
16578 /// ```ignore,no_run
16579 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
16580 /// use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16581 /// let x = QueryFolderContentsResponse::new()
16582 /// .set_entries([
16583 /// FolderContentsEntry::default()/* use setters */,
16584 /// FolderContentsEntry::default()/* use (different) setters */,
16585 /// ]);
16586 /// ```
16587 pub fn set_entries<T, V>(mut self, v: T) -> Self
16588 where
16589 T: std::iter::IntoIterator<Item = V>,
16590 V: std::convert::Into<crate::model::query_folder_contents_response::FolderContentsEntry>,
16591 {
16592 use std::iter::Iterator;
16593 self.entries = v.into_iter().map(|i| i.into()).collect();
16594 self
16595 }
16596
16597 /// Sets the value of [next_page_token][crate::model::QueryFolderContentsResponse::next_page_token].
16598 ///
16599 /// # Example
16600 /// ```ignore,no_run
16601 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
16602 /// let x = QueryFolderContentsResponse::new().set_next_page_token("example");
16603 /// ```
16604 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16605 self.next_page_token = v.into();
16606 self
16607 }
16608}
16609
16610impl wkt::message::Message for QueryFolderContentsResponse {
16611 fn typename() -> &'static str {
16612 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse"
16613 }
16614}
16615
16616#[doc(hidden)]
16617impl google_cloud_gax::paginator::internal::PageableResponse for QueryFolderContentsResponse {
16618 type PageItem = crate::model::query_folder_contents_response::FolderContentsEntry;
16619
16620 fn items(self) -> std::vec::Vec<Self::PageItem> {
16621 self.entries
16622 }
16623
16624 fn next_page_token(&self) -> std::string::String {
16625 use std::clone::Clone;
16626 self.next_page_token.clone()
16627 }
16628}
16629
16630/// Defines additional types related to [QueryFolderContentsResponse].
16631pub mod query_folder_contents_response {
16632 #[allow(unused_imports)]
16633 use super::*;
16634
16635 /// Represents a single content entry.
16636 #[derive(Clone, Default, PartialEq)]
16637 #[non_exhaustive]
16638 pub struct FolderContentsEntry {
16639 /// The content entry.
16640 pub entry: std::option::Option<
16641 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
16642 >,
16643
16644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16645 }
16646
16647 impl FolderContentsEntry {
16648 /// Creates a new default instance.
16649 pub fn new() -> Self {
16650 std::default::Default::default()
16651 }
16652
16653 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry].
16654 ///
16655 /// Note that all the setters affecting `entry` are mutually
16656 /// exclusive.
16657 ///
16658 /// # Example
16659 /// ```ignore,no_run
16660 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16661 /// use google_cloud_dataform_v1::model::Folder;
16662 /// let x = FolderContentsEntry::new().set_entry(Some(
16663 /// google_cloud_dataform_v1::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(Folder::default().into())));
16664 /// ```
16665 pub fn set_entry<
16666 T: std::convert::Into<
16667 std::option::Option<
16668 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
16669 >,
16670 >,
16671 >(
16672 mut self,
16673 v: T,
16674 ) -> Self {
16675 self.entry = v.into();
16676 self
16677 }
16678
16679 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16680 /// if it holds a `Folder`, `None` if the field is not set or
16681 /// holds a different branch.
16682 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
16683 #[allow(unreachable_patterns)]
16684 self.entry.as_ref().and_then(|v| match v {
16685 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
16686 _ => std::option::Option::None,
16687 })
16688 }
16689
16690 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16691 /// to hold a `Folder`.
16692 ///
16693 /// Note that all the setters affecting `entry` are
16694 /// mutually exclusive.
16695 ///
16696 /// # Example
16697 /// ```ignore,no_run
16698 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16699 /// use google_cloud_dataform_v1::model::Folder;
16700 /// let x = FolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
16701 /// assert!(x.folder().is_some());
16702 /// assert!(x.repository().is_none());
16703 /// ```
16704 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
16705 mut self,
16706 v: T,
16707 ) -> Self {
16708 self.entry = std::option::Option::Some(
16709 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(
16710 v.into(),
16711 ),
16712 );
16713 self
16714 }
16715
16716 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16717 /// if it holds a `Repository`, `None` if the field is not set or
16718 /// holds a different branch.
16719 pub fn repository(
16720 &self,
16721 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
16722 #[allow(unreachable_patterns)]
16723 self.entry.as_ref().and_then(|v| match v {
16724 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
16725 _ => std::option::Option::None,
16726 })
16727 }
16728
16729 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16730 /// to hold a `Repository`.
16731 ///
16732 /// Note that all the setters affecting `entry` are
16733 /// mutually exclusive.
16734 ///
16735 /// # Example
16736 /// ```ignore,no_run
16737 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16738 /// use google_cloud_dataform_v1::model::Repository;
16739 /// let x = FolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
16740 /// assert!(x.repository().is_some());
16741 /// assert!(x.folder().is_none());
16742 /// ```
16743 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
16744 mut self,
16745 v: T,
16746 ) -> Self {
16747 self.entry = std::option::Option::Some(
16748 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(
16749 v.into()
16750 )
16751 );
16752 self
16753 }
16754 }
16755
16756 impl wkt::message::Message for FolderContentsEntry {
16757 fn typename() -> &'static str {
16758 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry"
16759 }
16760 }
16761
16762 /// Defines additional types related to [FolderContentsEntry].
16763 pub mod folder_contents_entry {
16764 #[allow(unused_imports)]
16765 use super::*;
16766
16767 /// The content entry.
16768 #[derive(Clone, Debug, PartialEq)]
16769 #[non_exhaustive]
16770 pub enum Entry {
16771 /// A subfolder.
16772 Folder(std::boxed::Box<crate::model::Folder>),
16773 /// A repository.
16774 Repository(std::boxed::Box<crate::model::Repository>),
16775 }
16776 }
16777}
16778
16779/// `QueryUserRootContents` request message.
16780#[derive(Clone, Default, PartialEq)]
16781#[non_exhaustive]
16782pub struct QueryUserRootContentsRequest {
16783 /// Required. Location of the user root folder to list contents for.
16784 /// Format: projects/*/locations/*
16785 pub location: std::string::String,
16786
16787 /// Optional. Maximum number of paths to return. The server may return fewer
16788 /// items than requested. If unspecified, the server will pick an appropriate
16789 /// default.
16790 pub page_size: i32,
16791
16792 /// Optional. Page token received from a previous `QueryUserRootContents` call.
16793 /// Provide this to retrieve the subsequent page.
16794 ///
16795 /// When paginating, all other parameters provided to
16796 /// `QueryUserRootFolderContents`, with the exception of `page_size`, must
16797 /// match the call that provided the page token.
16798 pub page_token: std::string::String,
16799
16800 /// Optional. Field to additionally sort results by.
16801 /// Will order Folders before Repositories, and then by `order_by` in ascending
16802 /// order. Supported keywords: display_name (default), created_at,
16803 /// last_modified_at. Examples:
16804 ///
16805 /// * `orderBy="display_name"`
16806 /// * `orderBy="display_name desc"`
16807 pub order_by: std::string::String,
16808
16809 /// Optional. Optional filtering for the returned list. Filtering is currently
16810 /// only supported on the `display_name` field.
16811 ///
16812 /// Example:
16813 ///
16814 /// * `filter="display_name="MyFolder""`
16815 pub filter: std::string::String,
16816
16817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16818}
16819
16820impl QueryUserRootContentsRequest {
16821 /// Creates a new default instance.
16822 pub fn new() -> Self {
16823 std::default::Default::default()
16824 }
16825
16826 /// Sets the value of [location][crate::model::QueryUserRootContentsRequest::location].
16827 ///
16828 /// # Example
16829 /// ```ignore,no_run
16830 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
16831 /// let x = QueryUserRootContentsRequest::new().set_location("example");
16832 /// ```
16833 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16834 self.location = v.into();
16835 self
16836 }
16837
16838 /// Sets the value of [page_size][crate::model::QueryUserRootContentsRequest::page_size].
16839 ///
16840 /// # Example
16841 /// ```ignore,no_run
16842 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
16843 /// let x = QueryUserRootContentsRequest::new().set_page_size(42);
16844 /// ```
16845 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16846 self.page_size = v.into();
16847 self
16848 }
16849
16850 /// Sets the value of [page_token][crate::model::QueryUserRootContentsRequest::page_token].
16851 ///
16852 /// # Example
16853 /// ```ignore,no_run
16854 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
16855 /// let x = QueryUserRootContentsRequest::new().set_page_token("example");
16856 /// ```
16857 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16858 self.page_token = v.into();
16859 self
16860 }
16861
16862 /// Sets the value of [order_by][crate::model::QueryUserRootContentsRequest::order_by].
16863 ///
16864 /// # Example
16865 /// ```ignore,no_run
16866 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
16867 /// let x = QueryUserRootContentsRequest::new().set_order_by("example");
16868 /// ```
16869 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16870 self.order_by = v.into();
16871 self
16872 }
16873
16874 /// Sets the value of [filter][crate::model::QueryUserRootContentsRequest::filter].
16875 ///
16876 /// # Example
16877 /// ```ignore,no_run
16878 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
16879 /// let x = QueryUserRootContentsRequest::new().set_filter("example");
16880 /// ```
16881 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16882 self.filter = v.into();
16883 self
16884 }
16885}
16886
16887impl wkt::message::Message for QueryUserRootContentsRequest {
16888 fn typename() -> &'static str {
16889 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsRequest"
16890 }
16891}
16892
16893/// `QueryUserRootContents` response message.
16894#[derive(Clone, Default, PartialEq)]
16895#[non_exhaustive]
16896pub struct QueryUserRootContentsResponse {
16897 /// List of entries in the folder.
16898 pub entries: std::vec::Vec<crate::model::query_user_root_contents_response::RootContentsEntry>,
16899
16900 /// A token, which can be sent as `page_token` to retrieve the next page.
16901 /// If this field is omitted, there are no subsequent pages.
16902 pub next_page_token: std::string::String,
16903
16904 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16905}
16906
16907impl QueryUserRootContentsResponse {
16908 /// Creates a new default instance.
16909 pub fn new() -> Self {
16910 std::default::Default::default()
16911 }
16912
16913 /// Sets the value of [entries][crate::model::QueryUserRootContentsResponse::entries].
16914 ///
16915 /// # Example
16916 /// ```ignore,no_run
16917 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
16918 /// use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
16919 /// let x = QueryUserRootContentsResponse::new()
16920 /// .set_entries([
16921 /// RootContentsEntry::default()/* use setters */,
16922 /// RootContentsEntry::default()/* use (different) setters */,
16923 /// ]);
16924 /// ```
16925 pub fn set_entries<T, V>(mut self, v: T) -> Self
16926 where
16927 T: std::iter::IntoIterator<Item = V>,
16928 V: std::convert::Into<crate::model::query_user_root_contents_response::RootContentsEntry>,
16929 {
16930 use std::iter::Iterator;
16931 self.entries = v.into_iter().map(|i| i.into()).collect();
16932 self
16933 }
16934
16935 /// Sets the value of [next_page_token][crate::model::QueryUserRootContentsResponse::next_page_token].
16936 ///
16937 /// # Example
16938 /// ```ignore,no_run
16939 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
16940 /// let x = QueryUserRootContentsResponse::new().set_next_page_token("example");
16941 /// ```
16942 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16943 self.next_page_token = v.into();
16944 self
16945 }
16946}
16947
16948impl wkt::message::Message for QueryUserRootContentsResponse {
16949 fn typename() -> &'static str {
16950 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse"
16951 }
16952}
16953
16954#[doc(hidden)]
16955impl google_cloud_gax::paginator::internal::PageableResponse for QueryUserRootContentsResponse {
16956 type PageItem = crate::model::query_user_root_contents_response::RootContentsEntry;
16957
16958 fn items(self) -> std::vec::Vec<Self::PageItem> {
16959 self.entries
16960 }
16961
16962 fn next_page_token(&self) -> std::string::String {
16963 use std::clone::Clone;
16964 self.next_page_token.clone()
16965 }
16966}
16967
16968/// Defines additional types related to [QueryUserRootContentsResponse].
16969pub mod query_user_root_contents_response {
16970 #[allow(unused_imports)]
16971 use super::*;
16972
16973 /// Represents a single content entry.
16974 #[derive(Clone, Default, PartialEq)]
16975 #[non_exhaustive]
16976 pub struct RootContentsEntry {
16977 /// The content entry.
16978 pub entry: std::option::Option<
16979 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
16980 >,
16981
16982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16983 }
16984
16985 impl RootContentsEntry {
16986 /// Creates a new default instance.
16987 pub fn new() -> Self {
16988 std::default::Default::default()
16989 }
16990
16991 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry].
16992 ///
16993 /// Note that all the setters affecting `entry` are mutually
16994 /// exclusive.
16995 ///
16996 /// # Example
16997 /// ```ignore,no_run
16998 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
16999 /// use google_cloud_dataform_v1::model::Folder;
17000 /// let x = RootContentsEntry::new().set_entry(Some(
17001 /// google_cloud_dataform_v1::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(Folder::default().into())));
17002 /// ```
17003 pub fn set_entry<
17004 T: std::convert::Into<
17005 std::option::Option<
17006 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
17007 >,
17008 >,
17009 >(
17010 mut self,
17011 v: T,
17012 ) -> Self {
17013 self.entry = v.into();
17014 self
17015 }
17016
17017 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17018 /// if it holds a `Folder`, `None` if the field is not set or
17019 /// holds a different branch.
17020 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
17021 #[allow(unreachable_patterns)]
17022 self.entry.as_ref().and_then(|v| match v {
17023 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
17024 _ => std::option::Option::None,
17025 })
17026 }
17027
17028 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17029 /// to hold a `Folder`.
17030 ///
17031 /// Note that all the setters affecting `entry` are
17032 /// mutually exclusive.
17033 ///
17034 /// # Example
17035 /// ```ignore,no_run
17036 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17037 /// use google_cloud_dataform_v1::model::Folder;
17038 /// let x = RootContentsEntry::new().set_folder(Folder::default()/* use setters */);
17039 /// assert!(x.folder().is_some());
17040 /// assert!(x.repository().is_none());
17041 /// ```
17042 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
17043 mut self,
17044 v: T,
17045 ) -> Self {
17046 self.entry = std::option::Option::Some(
17047 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(
17048 v.into(),
17049 ),
17050 );
17051 self
17052 }
17053
17054 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17055 /// if it holds a `Repository`, `None` if the field is not set or
17056 /// holds a different branch.
17057 pub fn repository(
17058 &self,
17059 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
17060 #[allow(unreachable_patterns)]
17061 self.entry.as_ref().and_then(|v| match v {
17062 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
17063 _ => std::option::Option::None,
17064 })
17065 }
17066
17067 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17068 /// to hold a `Repository`.
17069 ///
17070 /// Note that all the setters affecting `entry` are
17071 /// mutually exclusive.
17072 ///
17073 /// # Example
17074 /// ```ignore,no_run
17075 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17076 /// use google_cloud_dataform_v1::model::Repository;
17077 /// let x = RootContentsEntry::new().set_repository(Repository::default()/* use setters */);
17078 /// assert!(x.repository().is_some());
17079 /// assert!(x.folder().is_none());
17080 /// ```
17081 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
17082 mut self,
17083 v: T,
17084 ) -> Self {
17085 self.entry = std::option::Option::Some(
17086 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(
17087 v.into()
17088 )
17089 );
17090 self
17091 }
17092 }
17093
17094 impl wkt::message::Message for RootContentsEntry {
17095 fn typename() -> &'static str {
17096 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry"
17097 }
17098 }
17099
17100 /// Defines additional types related to [RootContentsEntry].
17101 pub mod root_contents_entry {
17102 #[allow(unused_imports)]
17103 use super::*;
17104
17105 /// The content entry.
17106 #[derive(Clone, Debug, PartialEq)]
17107 #[non_exhaustive]
17108 pub enum Entry {
17109 /// A subfolder.
17110 Folder(std::boxed::Box<crate::model::Folder>),
17111 /// A repository.
17112 Repository(std::boxed::Box<crate::model::Repository>),
17113 }
17114 }
17115}
17116
17117/// Represents a Dataform TeamFolder. This is a resource that sits at the project
17118/// level and is used to organize Repositories and Folders with hierarchical
17119/// access controls. They provide a team context and stricter access controls.
17120#[derive(Clone, Default, PartialEq)]
17121#[non_exhaustive]
17122pub struct TeamFolder {
17123 /// Identifier. The TeamFolder's name.
17124 pub name: std::string::String,
17125
17126 /// Required. The TeamFolder's user-friendly name.
17127 pub display_name: std::string::String,
17128
17129 /// Output only. The timestamp of when the TeamFolder was created.
17130 pub create_time: std::option::Option<wkt::Timestamp>,
17131
17132 /// Output only. The timestamp of when the TeamFolder was last updated.
17133 pub update_time: std::option::Option<wkt::Timestamp>,
17134
17135 /// Output only. All the metadata information that is used internally to serve
17136 /// the resource. For example: timestamps, flags, status fields, etc. The
17137 /// format of this field is a JSON string.
17138 pub internal_metadata: std::option::Option<std::string::String>,
17139
17140 /// Output only. The IAM principal identifier of the creator of the TeamFolder.
17141 pub creator_iam_principal: std::option::Option<std::string::String>,
17142
17143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17144}
17145
17146impl TeamFolder {
17147 /// Creates a new default instance.
17148 pub fn new() -> Self {
17149 std::default::Default::default()
17150 }
17151
17152 /// Sets the value of [name][crate::model::TeamFolder::name].
17153 ///
17154 /// # Example
17155 /// ```ignore,no_run
17156 /// # use google_cloud_dataform_v1::model::TeamFolder;
17157 /// # let project_id = "project_id";
17158 /// # let location_id = "location_id";
17159 /// # let team_folder_id = "team_folder_id";
17160 /// let x = TeamFolder::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17161 /// ```
17162 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17163 self.name = v.into();
17164 self
17165 }
17166
17167 /// Sets the value of [display_name][crate::model::TeamFolder::display_name].
17168 ///
17169 /// # Example
17170 /// ```ignore,no_run
17171 /// # use google_cloud_dataform_v1::model::TeamFolder;
17172 /// let x = TeamFolder::new().set_display_name("example");
17173 /// ```
17174 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17175 self.display_name = v.into();
17176 self
17177 }
17178
17179 /// Sets the value of [create_time][crate::model::TeamFolder::create_time].
17180 ///
17181 /// # Example
17182 /// ```ignore,no_run
17183 /// # use google_cloud_dataform_v1::model::TeamFolder;
17184 /// use wkt::Timestamp;
17185 /// let x = TeamFolder::new().set_create_time(Timestamp::default()/* use setters */);
17186 /// ```
17187 pub fn set_create_time<T>(mut self, v: T) -> Self
17188 where
17189 T: std::convert::Into<wkt::Timestamp>,
17190 {
17191 self.create_time = std::option::Option::Some(v.into());
17192 self
17193 }
17194
17195 /// Sets or clears the value of [create_time][crate::model::TeamFolder::create_time].
17196 ///
17197 /// # Example
17198 /// ```ignore,no_run
17199 /// # use google_cloud_dataform_v1::model::TeamFolder;
17200 /// use wkt::Timestamp;
17201 /// let x = TeamFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17202 /// let x = TeamFolder::new().set_or_clear_create_time(None::<Timestamp>);
17203 /// ```
17204 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17205 where
17206 T: std::convert::Into<wkt::Timestamp>,
17207 {
17208 self.create_time = v.map(|x| x.into());
17209 self
17210 }
17211
17212 /// Sets the value of [update_time][crate::model::TeamFolder::update_time].
17213 ///
17214 /// # Example
17215 /// ```ignore,no_run
17216 /// # use google_cloud_dataform_v1::model::TeamFolder;
17217 /// use wkt::Timestamp;
17218 /// let x = TeamFolder::new().set_update_time(Timestamp::default()/* use setters */);
17219 /// ```
17220 pub fn set_update_time<T>(mut self, v: T) -> Self
17221 where
17222 T: std::convert::Into<wkt::Timestamp>,
17223 {
17224 self.update_time = std::option::Option::Some(v.into());
17225 self
17226 }
17227
17228 /// Sets or clears the value of [update_time][crate::model::TeamFolder::update_time].
17229 ///
17230 /// # Example
17231 /// ```ignore,no_run
17232 /// # use google_cloud_dataform_v1::model::TeamFolder;
17233 /// use wkt::Timestamp;
17234 /// let x = TeamFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17235 /// let x = TeamFolder::new().set_or_clear_update_time(None::<Timestamp>);
17236 /// ```
17237 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17238 where
17239 T: std::convert::Into<wkt::Timestamp>,
17240 {
17241 self.update_time = v.map(|x| x.into());
17242 self
17243 }
17244
17245 /// Sets the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
17246 ///
17247 /// # Example
17248 /// ```ignore,no_run
17249 /// # use google_cloud_dataform_v1::model::TeamFolder;
17250 /// let x = TeamFolder::new().set_internal_metadata("example");
17251 /// ```
17252 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
17253 where
17254 T: std::convert::Into<std::string::String>,
17255 {
17256 self.internal_metadata = std::option::Option::Some(v.into());
17257 self
17258 }
17259
17260 /// Sets or clears the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
17261 ///
17262 /// # Example
17263 /// ```ignore,no_run
17264 /// # use google_cloud_dataform_v1::model::TeamFolder;
17265 /// let x = TeamFolder::new().set_or_clear_internal_metadata(Some("example"));
17266 /// let x = TeamFolder::new().set_or_clear_internal_metadata(None::<String>);
17267 /// ```
17268 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17269 where
17270 T: std::convert::Into<std::string::String>,
17271 {
17272 self.internal_metadata = v.map(|x| x.into());
17273 self
17274 }
17275
17276 /// Sets the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
17277 ///
17278 /// # Example
17279 /// ```ignore,no_run
17280 /// # use google_cloud_dataform_v1::model::TeamFolder;
17281 /// let x = TeamFolder::new().set_creator_iam_principal("example");
17282 /// ```
17283 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
17284 where
17285 T: std::convert::Into<std::string::String>,
17286 {
17287 self.creator_iam_principal = std::option::Option::Some(v.into());
17288 self
17289 }
17290
17291 /// Sets or clears the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
17292 ///
17293 /// # Example
17294 /// ```ignore,no_run
17295 /// # use google_cloud_dataform_v1::model::TeamFolder;
17296 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(Some("example"));
17297 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(None::<String>);
17298 /// ```
17299 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
17300 where
17301 T: std::convert::Into<std::string::String>,
17302 {
17303 self.creator_iam_principal = v.map(|x| x.into());
17304 self
17305 }
17306}
17307
17308impl wkt::message::Message for TeamFolder {
17309 fn typename() -> &'static str {
17310 "type.googleapis.com/google.cloud.dataform.v1.TeamFolder"
17311 }
17312}
17313
17314/// `CreateTeamFolder` request message.
17315#[derive(Clone, Default, PartialEq)]
17316#[non_exhaustive]
17317pub struct CreateTeamFolderRequest {
17318 /// Required. The location in which to create the TeamFolder. Must be in the
17319 /// format `projects/*/locations/*`.
17320 pub parent: std::string::String,
17321
17322 /// Required. The TeamFolder to create.
17323 pub team_folder: std::option::Option<crate::model::TeamFolder>,
17324
17325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17326}
17327
17328impl CreateTeamFolderRequest {
17329 /// Creates a new default instance.
17330 pub fn new() -> Self {
17331 std::default::Default::default()
17332 }
17333
17334 /// Sets the value of [parent][crate::model::CreateTeamFolderRequest::parent].
17335 ///
17336 /// # Example
17337 /// ```ignore,no_run
17338 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17339 /// let x = CreateTeamFolderRequest::new().set_parent("example");
17340 /// ```
17341 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17342 self.parent = v.into();
17343 self
17344 }
17345
17346 /// Sets the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
17347 ///
17348 /// # Example
17349 /// ```ignore,no_run
17350 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17351 /// use google_cloud_dataform_v1::model::TeamFolder;
17352 /// let x = CreateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
17353 /// ```
17354 pub fn set_team_folder<T>(mut self, v: T) -> Self
17355 where
17356 T: std::convert::Into<crate::model::TeamFolder>,
17357 {
17358 self.team_folder = std::option::Option::Some(v.into());
17359 self
17360 }
17361
17362 /// Sets or clears the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
17363 ///
17364 /// # Example
17365 /// ```ignore,no_run
17366 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17367 /// use google_cloud_dataform_v1::model::TeamFolder;
17368 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
17369 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
17370 /// ```
17371 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
17372 where
17373 T: std::convert::Into<crate::model::TeamFolder>,
17374 {
17375 self.team_folder = v.map(|x| x.into());
17376 self
17377 }
17378}
17379
17380impl wkt::message::Message for CreateTeamFolderRequest {
17381 fn typename() -> &'static str {
17382 "type.googleapis.com/google.cloud.dataform.v1.CreateTeamFolderRequest"
17383 }
17384}
17385
17386/// `GetTeamFolder` request message.
17387#[derive(Clone, Default, PartialEq)]
17388#[non_exhaustive]
17389pub struct GetTeamFolderRequest {
17390 /// Required. The TeamFolder's name.
17391 pub name: std::string::String,
17392
17393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17394}
17395
17396impl GetTeamFolderRequest {
17397 /// Creates a new default instance.
17398 pub fn new() -> Self {
17399 std::default::Default::default()
17400 }
17401
17402 /// Sets the value of [name][crate::model::GetTeamFolderRequest::name].
17403 ///
17404 /// # Example
17405 /// ```ignore,no_run
17406 /// # use google_cloud_dataform_v1::model::GetTeamFolderRequest;
17407 /// # let project_id = "project_id";
17408 /// # let location_id = "location_id";
17409 /// # let team_folder_id = "team_folder_id";
17410 /// let x = GetTeamFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17411 /// ```
17412 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17413 self.name = v.into();
17414 self
17415 }
17416}
17417
17418impl wkt::message::Message for GetTeamFolderRequest {
17419 fn typename() -> &'static str {
17420 "type.googleapis.com/google.cloud.dataform.v1.GetTeamFolderRequest"
17421 }
17422}
17423
17424/// `UpdateTeamFolder` request message.
17425#[derive(Clone, Default, PartialEq)]
17426#[non_exhaustive]
17427pub struct UpdateTeamFolderRequest {
17428 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
17429 /// all fields will be updated.
17430 pub update_mask: std::option::Option<wkt::FieldMask>,
17431
17432 /// Required. The updated TeamFolder.
17433 pub team_folder: std::option::Option<crate::model::TeamFolder>,
17434
17435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17436}
17437
17438impl UpdateTeamFolderRequest {
17439 /// Creates a new default instance.
17440 pub fn new() -> Self {
17441 std::default::Default::default()
17442 }
17443
17444 /// Sets the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
17445 ///
17446 /// # Example
17447 /// ```ignore,no_run
17448 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17449 /// use wkt::FieldMask;
17450 /// let x = UpdateTeamFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17451 /// ```
17452 pub fn set_update_mask<T>(mut self, v: T) -> Self
17453 where
17454 T: std::convert::Into<wkt::FieldMask>,
17455 {
17456 self.update_mask = std::option::Option::Some(v.into());
17457 self
17458 }
17459
17460 /// Sets or clears the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
17461 ///
17462 /// # Example
17463 /// ```ignore,no_run
17464 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17465 /// use wkt::FieldMask;
17466 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17467 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17468 /// ```
17469 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17470 where
17471 T: std::convert::Into<wkt::FieldMask>,
17472 {
17473 self.update_mask = v.map(|x| x.into());
17474 self
17475 }
17476
17477 /// Sets the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
17478 ///
17479 /// # Example
17480 /// ```ignore,no_run
17481 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17482 /// use google_cloud_dataform_v1::model::TeamFolder;
17483 /// let x = UpdateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
17484 /// ```
17485 pub fn set_team_folder<T>(mut self, v: T) -> Self
17486 where
17487 T: std::convert::Into<crate::model::TeamFolder>,
17488 {
17489 self.team_folder = std::option::Option::Some(v.into());
17490 self
17491 }
17492
17493 /// Sets or clears the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
17494 ///
17495 /// # Example
17496 /// ```ignore,no_run
17497 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17498 /// use google_cloud_dataform_v1::model::TeamFolder;
17499 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
17500 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
17501 /// ```
17502 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
17503 where
17504 T: std::convert::Into<crate::model::TeamFolder>,
17505 {
17506 self.team_folder = v.map(|x| x.into());
17507 self
17508 }
17509}
17510
17511impl wkt::message::Message for UpdateTeamFolderRequest {
17512 fn typename() -> &'static str {
17513 "type.googleapis.com/google.cloud.dataform.v1.UpdateTeamFolderRequest"
17514 }
17515}
17516
17517/// `DeleteTeamFolder` request message.
17518#[derive(Clone, Default, PartialEq)]
17519#[non_exhaustive]
17520pub struct DeleteTeamFolderRequest {
17521 /// Required. The TeamFolder's name.
17522 pub name: std::string::String,
17523
17524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17525}
17526
17527impl DeleteTeamFolderRequest {
17528 /// Creates a new default instance.
17529 pub fn new() -> Self {
17530 std::default::Default::default()
17531 }
17532
17533 /// Sets the value of [name][crate::model::DeleteTeamFolderRequest::name].
17534 ///
17535 /// # Example
17536 /// ```ignore,no_run
17537 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderRequest;
17538 /// # let project_id = "project_id";
17539 /// # let location_id = "location_id";
17540 /// # let team_folder_id = "team_folder_id";
17541 /// let x = DeleteTeamFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17542 /// ```
17543 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17544 self.name = v.into();
17545 self
17546 }
17547}
17548
17549impl wkt::message::Message for DeleteTeamFolderRequest {
17550 fn typename() -> &'static str {
17551 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderRequest"
17552 }
17553}
17554
17555/// `QueryTeamFolderContents` request message.
17556#[derive(Clone, Default, PartialEq)]
17557#[non_exhaustive]
17558pub struct QueryTeamFolderContentsRequest {
17559 /// Required. Resource name of the TeamFolder to list contents for.
17560 /// Format: `projects/*/locations/*/teamFolders/*`.
17561 pub team_folder: std::string::String,
17562
17563 /// Optional. Maximum number of paths to return. The server may return fewer
17564 /// items than requested. If unspecified, the server will pick an appropriate
17565 /// default.
17566 pub page_size: i32,
17567
17568 /// Optional. Page token received from a previous `QueryTeamFolderContents`
17569 /// call. Provide this to retrieve the subsequent page.
17570 ///
17571 /// When paginating, all other parameters provided to
17572 /// `QueryTeamFolderContents`, with the exception of `page_size`, must match
17573 /// the call that provided the page token.
17574 pub page_token: std::string::String,
17575
17576 /// Optional. Field to additionally sort results by.
17577 /// Will order Folders before Repositories, and then by `order_by` in ascending
17578 /// order. Supported keywords: `display_name` (default), `create_time`,
17579 /// last_modified_time.
17580 /// Examples:
17581 ///
17582 /// * `orderBy="display_name"`
17583 /// * `orderBy="display_name desc"`
17584 pub order_by: std::string::String,
17585
17586 /// Optional. Optional filtering for the returned list. Filtering is currently
17587 /// only supported on the `display_name` field.
17588 ///
17589 /// Example:
17590 ///
17591 /// * `filter="display_name="MyFolder""`
17592 pub filter: std::string::String,
17593
17594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17595}
17596
17597impl QueryTeamFolderContentsRequest {
17598 /// Creates a new default instance.
17599 pub fn new() -> Self {
17600 std::default::Default::default()
17601 }
17602
17603 /// Sets the value of [team_folder][crate::model::QueryTeamFolderContentsRequest::team_folder].
17604 ///
17605 /// # Example
17606 /// ```ignore,no_run
17607 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17608 /// # let project_id = "project_id";
17609 /// # let location_id = "location_id";
17610 /// # let team_folder_id = "team_folder_id";
17611 /// let x = QueryTeamFolderContentsRequest::new().set_team_folder(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17612 /// ```
17613 pub fn set_team_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17614 self.team_folder = v.into();
17615 self
17616 }
17617
17618 /// Sets the value of [page_size][crate::model::QueryTeamFolderContentsRequest::page_size].
17619 ///
17620 /// # Example
17621 /// ```ignore,no_run
17622 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17623 /// let x = QueryTeamFolderContentsRequest::new().set_page_size(42);
17624 /// ```
17625 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17626 self.page_size = v.into();
17627 self
17628 }
17629
17630 /// Sets the value of [page_token][crate::model::QueryTeamFolderContentsRequest::page_token].
17631 ///
17632 /// # Example
17633 /// ```ignore,no_run
17634 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17635 /// let x = QueryTeamFolderContentsRequest::new().set_page_token("example");
17636 /// ```
17637 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17638 self.page_token = v.into();
17639 self
17640 }
17641
17642 /// Sets the value of [order_by][crate::model::QueryTeamFolderContentsRequest::order_by].
17643 ///
17644 /// # Example
17645 /// ```ignore,no_run
17646 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17647 /// let x = QueryTeamFolderContentsRequest::new().set_order_by("example");
17648 /// ```
17649 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17650 self.order_by = v.into();
17651 self
17652 }
17653
17654 /// Sets the value of [filter][crate::model::QueryTeamFolderContentsRequest::filter].
17655 ///
17656 /// # Example
17657 /// ```ignore,no_run
17658 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17659 /// let x = QueryTeamFolderContentsRequest::new().set_filter("example");
17660 /// ```
17661 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17662 self.filter = v.into();
17663 self
17664 }
17665}
17666
17667impl wkt::message::Message for QueryTeamFolderContentsRequest {
17668 fn typename() -> &'static str {
17669 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsRequest"
17670 }
17671}
17672
17673/// `QueryTeamFolderContents` response message.
17674#[derive(Clone, Default, PartialEq)]
17675#[non_exhaustive]
17676pub struct QueryTeamFolderContentsResponse {
17677 /// List of entries in the TeamFolder.
17678 pub entries:
17679 std::vec::Vec<crate::model::query_team_folder_contents_response::TeamFolderContentsEntry>,
17680
17681 /// A token, which can be sent as `page_token` to retrieve the next page.
17682 /// If this field is omitted, there are no subsequent pages.
17683 pub next_page_token: std::string::String,
17684
17685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17686}
17687
17688impl QueryTeamFolderContentsResponse {
17689 /// Creates a new default instance.
17690 pub fn new() -> Self {
17691 std::default::Default::default()
17692 }
17693
17694 /// Sets the value of [entries][crate::model::QueryTeamFolderContentsResponse::entries].
17695 ///
17696 /// # Example
17697 /// ```ignore,no_run
17698 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
17699 /// use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17700 /// let x = QueryTeamFolderContentsResponse::new()
17701 /// .set_entries([
17702 /// TeamFolderContentsEntry::default()/* use setters */,
17703 /// TeamFolderContentsEntry::default()/* use (different) setters */,
17704 /// ]);
17705 /// ```
17706 pub fn set_entries<T, V>(mut self, v: T) -> Self
17707 where
17708 T: std::iter::IntoIterator<Item = V>,
17709 V: std::convert::Into<
17710 crate::model::query_team_folder_contents_response::TeamFolderContentsEntry,
17711 >,
17712 {
17713 use std::iter::Iterator;
17714 self.entries = v.into_iter().map(|i| i.into()).collect();
17715 self
17716 }
17717
17718 /// Sets the value of [next_page_token][crate::model::QueryTeamFolderContentsResponse::next_page_token].
17719 ///
17720 /// # Example
17721 /// ```ignore,no_run
17722 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
17723 /// let x = QueryTeamFolderContentsResponse::new().set_next_page_token("example");
17724 /// ```
17725 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17726 self.next_page_token = v.into();
17727 self
17728 }
17729}
17730
17731impl wkt::message::Message for QueryTeamFolderContentsResponse {
17732 fn typename() -> &'static str {
17733 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse"
17734 }
17735}
17736
17737#[doc(hidden)]
17738impl google_cloud_gax::paginator::internal::PageableResponse for QueryTeamFolderContentsResponse {
17739 type PageItem = crate::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17740
17741 fn items(self) -> std::vec::Vec<Self::PageItem> {
17742 self.entries
17743 }
17744
17745 fn next_page_token(&self) -> std::string::String {
17746 use std::clone::Clone;
17747 self.next_page_token.clone()
17748 }
17749}
17750
17751/// Defines additional types related to [QueryTeamFolderContentsResponse].
17752pub mod query_team_folder_contents_response {
17753 #[allow(unused_imports)]
17754 use super::*;
17755
17756 /// Represents a single content entry.
17757 #[derive(Clone, Default, PartialEq)]
17758 #[non_exhaustive]
17759 pub struct TeamFolderContentsEntry {
17760 /// The content entry.
17761 pub entry: std::option::Option<
17762 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry,
17763 >,
17764
17765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17766 }
17767
17768 impl TeamFolderContentsEntry {
17769 /// Creates a new default instance.
17770 pub fn new() -> Self {
17771 std::default::Default::default()
17772 }
17773
17774 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry].
17775 ///
17776 /// Note that all the setters affecting `entry` are mutually
17777 /// exclusive.
17778 ///
17779 /// # Example
17780 /// ```ignore,no_run
17781 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17782 /// use google_cloud_dataform_v1::model::Folder;
17783 /// let x = TeamFolderContentsEntry::new().set_entry(Some(
17784 /// google_cloud_dataform_v1::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(Folder::default().into())));
17785 /// ```
17786 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
17787 {
17788 self.entry = v.into();
17789 self
17790 }
17791
17792 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
17793 /// if it holds a `Folder`, `None` if the field is not set or
17794 /// holds a different branch.
17795 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
17796 #[allow(unreachable_patterns)]
17797 self.entry.as_ref().and_then(|v| match v {
17798 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
17799 _ => std::option::Option::None,
17800 })
17801 }
17802
17803 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
17804 /// to hold a `Folder`.
17805 ///
17806 /// Note that all the setters affecting `entry` are
17807 /// mutually exclusive.
17808 ///
17809 /// # Example
17810 /// ```ignore,no_run
17811 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17812 /// use google_cloud_dataform_v1::model::Folder;
17813 /// let x = TeamFolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
17814 /// assert!(x.folder().is_some());
17815 /// assert!(x.repository().is_none());
17816 /// ```
17817 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
17818 mut self,
17819 v: T,
17820 ) -> Self {
17821 self.entry = std::option::Option::Some(
17822 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(
17823 v.into()
17824 )
17825 );
17826 self
17827 }
17828
17829 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
17830 /// if it holds a `Repository`, `None` if the field is not set or
17831 /// holds a different branch.
17832 pub fn repository(
17833 &self,
17834 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
17835 #[allow(unreachable_patterns)]
17836 self.entry.as_ref().and_then(|v| match v {
17837 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
17838 _ => std::option::Option::None,
17839 })
17840 }
17841
17842 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
17843 /// to hold a `Repository`.
17844 ///
17845 /// Note that all the setters affecting `entry` are
17846 /// mutually exclusive.
17847 ///
17848 /// # Example
17849 /// ```ignore,no_run
17850 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17851 /// use google_cloud_dataform_v1::model::Repository;
17852 /// let x = TeamFolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
17853 /// assert!(x.repository().is_some());
17854 /// assert!(x.folder().is_none());
17855 /// ```
17856 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
17857 mut self,
17858 v: T,
17859 ) -> Self {
17860 self.entry = std::option::Option::Some(
17861 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(
17862 v.into()
17863 )
17864 );
17865 self
17866 }
17867 }
17868
17869 impl wkt::message::Message for TeamFolderContentsEntry {
17870 fn typename() -> &'static str {
17871 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry"
17872 }
17873 }
17874
17875 /// Defines additional types related to [TeamFolderContentsEntry].
17876 pub mod team_folder_contents_entry {
17877 #[allow(unused_imports)]
17878 use super::*;
17879
17880 /// The content entry.
17881 #[derive(Clone, Debug, PartialEq)]
17882 #[non_exhaustive]
17883 pub enum Entry {
17884 /// A subfolder.
17885 Folder(std::boxed::Box<crate::model::Folder>),
17886 /// A repository.
17887 Repository(std::boxed::Box<crate::model::Repository>),
17888 }
17889 }
17890}
17891
17892/// `SearchTeamFolders` request message.
17893#[derive(Clone, Default, PartialEq)]
17894#[non_exhaustive]
17895pub struct SearchTeamFoldersRequest {
17896 /// Required. Location in which to query TeamFolders.
17897 /// Format: `projects/*/locations/*`.
17898 pub location: std::string::String,
17899
17900 /// Optional. Maximum number of `TeamFolders` to return. The server may return
17901 /// fewer items than requested. If unspecified, the server will pick a default
17902 /// of `page_size` = 50.
17903 pub page_size: i32,
17904
17905 /// Optional. Page token received from a previous `SearchTeamFolders` call.
17906 /// Provide this to retrieve the subsequent page.
17907 ///
17908 /// When paginating, all other parameters provided to
17909 /// `SearchTeamFolders`, with the exception of `page_size`, must
17910 /// match the call that provided the page token.
17911 pub page_token: std::string::String,
17912
17913 /// Optional. Field to additionally sort results by.
17914 /// Supported keywords: `display_name` (default), `create_time`,
17915 /// `last_modified_time`. Examples:
17916 ///
17917 /// * `orderBy="display_name"`
17918 /// * `orderBy="display_name desc"`
17919 pub order_by: std::string::String,
17920
17921 /// Optional. Optional filtering for the returned list. Filtering is currently
17922 /// only supported on the `display_name` field.
17923 ///
17924 /// Example:
17925 ///
17926 /// * `filter="display_name="MyFolder""`
17927 pub filter: std::string::String,
17928
17929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17930}
17931
17932impl SearchTeamFoldersRequest {
17933 /// Creates a new default instance.
17934 pub fn new() -> Self {
17935 std::default::Default::default()
17936 }
17937
17938 /// Sets the value of [location][crate::model::SearchTeamFoldersRequest::location].
17939 ///
17940 /// # Example
17941 /// ```ignore,no_run
17942 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
17943 /// let x = SearchTeamFoldersRequest::new().set_location("example");
17944 /// ```
17945 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17946 self.location = v.into();
17947 self
17948 }
17949
17950 /// Sets the value of [page_size][crate::model::SearchTeamFoldersRequest::page_size].
17951 ///
17952 /// # Example
17953 /// ```ignore,no_run
17954 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
17955 /// let x = SearchTeamFoldersRequest::new().set_page_size(42);
17956 /// ```
17957 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17958 self.page_size = v.into();
17959 self
17960 }
17961
17962 /// Sets the value of [page_token][crate::model::SearchTeamFoldersRequest::page_token].
17963 ///
17964 /// # Example
17965 /// ```ignore,no_run
17966 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
17967 /// let x = SearchTeamFoldersRequest::new().set_page_token("example");
17968 /// ```
17969 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17970 self.page_token = v.into();
17971 self
17972 }
17973
17974 /// Sets the value of [order_by][crate::model::SearchTeamFoldersRequest::order_by].
17975 ///
17976 /// # Example
17977 /// ```ignore,no_run
17978 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
17979 /// let x = SearchTeamFoldersRequest::new().set_order_by("example");
17980 /// ```
17981 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17982 self.order_by = v.into();
17983 self
17984 }
17985
17986 /// Sets the value of [filter][crate::model::SearchTeamFoldersRequest::filter].
17987 ///
17988 /// # Example
17989 /// ```ignore,no_run
17990 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
17991 /// let x = SearchTeamFoldersRequest::new().set_filter("example");
17992 /// ```
17993 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17994 self.filter = v.into();
17995 self
17996 }
17997}
17998
17999impl wkt::message::Message for SearchTeamFoldersRequest {
18000 fn typename() -> &'static str {
18001 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersRequest"
18002 }
18003}
18004
18005/// `SearchTeamFolders` response message.
18006#[derive(Clone, Default, PartialEq)]
18007#[non_exhaustive]
18008pub struct SearchTeamFoldersResponse {
18009 /// List of TeamFolders that match the search query.
18010 pub results: std::vec::Vec<crate::model::search_team_folders_response::TeamFolderSearchResult>,
18011
18012 /// A token, which can be sent as `page_token` to retrieve the next page.
18013 /// If this field is omitted, there are no subsequent pages.
18014 pub next_page_token: std::string::String,
18015
18016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18017}
18018
18019impl SearchTeamFoldersResponse {
18020 /// Creates a new default instance.
18021 pub fn new() -> Self {
18022 std::default::Default::default()
18023 }
18024
18025 /// Sets the value of [results][crate::model::SearchTeamFoldersResponse::results].
18026 ///
18027 /// # Example
18028 /// ```ignore,no_run
18029 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
18030 /// use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18031 /// let x = SearchTeamFoldersResponse::new()
18032 /// .set_results([
18033 /// TeamFolderSearchResult::default()/* use setters */,
18034 /// TeamFolderSearchResult::default()/* use (different) setters */,
18035 /// ]);
18036 /// ```
18037 pub fn set_results<T, V>(mut self, v: T) -> Self
18038 where
18039 T: std::iter::IntoIterator<Item = V>,
18040 V: std::convert::Into<crate::model::search_team_folders_response::TeamFolderSearchResult>,
18041 {
18042 use std::iter::Iterator;
18043 self.results = v.into_iter().map(|i| i.into()).collect();
18044 self
18045 }
18046
18047 /// Sets the value of [next_page_token][crate::model::SearchTeamFoldersResponse::next_page_token].
18048 ///
18049 /// # Example
18050 /// ```ignore,no_run
18051 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
18052 /// let x = SearchTeamFoldersResponse::new().set_next_page_token("example");
18053 /// ```
18054 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18055 self.next_page_token = v.into();
18056 self
18057 }
18058}
18059
18060impl wkt::message::Message for SearchTeamFoldersResponse {
18061 fn typename() -> &'static str {
18062 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse"
18063 }
18064}
18065
18066#[doc(hidden)]
18067impl google_cloud_gax::paginator::internal::PageableResponse for SearchTeamFoldersResponse {
18068 type PageItem = crate::model::search_team_folders_response::TeamFolderSearchResult;
18069
18070 fn items(self) -> std::vec::Vec<Self::PageItem> {
18071 self.results
18072 }
18073
18074 fn next_page_token(&self) -> std::string::String {
18075 use std::clone::Clone;
18076 self.next_page_token.clone()
18077 }
18078}
18079
18080/// Defines additional types related to [SearchTeamFoldersResponse].
18081pub mod search_team_folders_response {
18082 #[allow(unused_imports)]
18083 use super::*;
18084
18085 /// Represents a single content entry.
18086 #[derive(Clone, Default, PartialEq)]
18087 #[non_exhaustive]
18088 pub struct TeamFolderSearchResult {
18089 /// The content entry.
18090 pub entry: std::option::Option<
18091 crate::model::search_team_folders_response::team_folder_search_result::Entry,
18092 >,
18093
18094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18095 }
18096
18097 impl TeamFolderSearchResult {
18098 /// Creates a new default instance.
18099 pub fn new() -> Self {
18100 std::default::Default::default()
18101 }
18102
18103 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry].
18104 ///
18105 /// Note that all the setters affecting `entry` are mutually
18106 /// exclusive.
18107 ///
18108 /// # Example
18109 /// ```ignore,no_run
18110 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18111 /// use google_cloud_dataform_v1::model::TeamFolder;
18112 /// let x = TeamFolderSearchResult::new().set_entry(Some(
18113 /// google_cloud_dataform_v1::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(TeamFolder::default().into())));
18114 /// ```
18115 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
18116 {
18117 self.entry = v.into();
18118 self
18119 }
18120
18121 /// The value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
18122 /// if it holds a `TeamFolder`, `None` if the field is not set or
18123 /// holds a different branch.
18124 pub fn team_folder(
18125 &self,
18126 ) -> std::option::Option<&std::boxed::Box<crate::model::TeamFolder>> {
18127 #[allow(unreachable_patterns)]
18128 self.entry.as_ref().and_then(|v| match v {
18129 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(v) => std::option::Option::Some(v),
18130 _ => std::option::Option::None,
18131 })
18132 }
18133
18134 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
18135 /// to hold a `TeamFolder`.
18136 ///
18137 /// Note that all the setters affecting `entry` are
18138 /// mutually exclusive.
18139 ///
18140 /// # Example
18141 /// ```ignore,no_run
18142 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18143 /// use google_cloud_dataform_v1::model::TeamFolder;
18144 /// let x = TeamFolderSearchResult::new().set_team_folder(TeamFolder::default()/* use setters */);
18145 /// assert!(x.team_folder().is_some());
18146 /// ```
18147 pub fn set_team_folder<T: std::convert::Into<std::boxed::Box<crate::model::TeamFolder>>>(
18148 mut self,
18149 v: T,
18150 ) -> Self {
18151 self.entry = std::option::Option::Some(
18152 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(
18153 v.into()
18154 )
18155 );
18156 self
18157 }
18158 }
18159
18160 impl wkt::message::Message for TeamFolderSearchResult {
18161 fn typename() -> &'static str {
18162 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse.TeamFolderSearchResult"
18163 }
18164 }
18165
18166 /// Defines additional types related to [TeamFolderSearchResult].
18167 pub mod team_folder_search_result {
18168 #[allow(unused_imports)]
18169 use super::*;
18170
18171 /// The content entry.
18172 #[derive(Clone, Debug, PartialEq)]
18173 #[non_exhaustive]
18174 pub enum Entry {
18175 /// A TeamFolder resource that is in the project / location.
18176 TeamFolder(std::boxed::Box<crate::model::TeamFolder>),
18177 }
18178 }
18179}
18180
18181/// Contains metadata about the progress of the MoveFolder Long-running
18182/// operations.
18183#[derive(Clone, Default, PartialEq)]
18184#[non_exhaustive]
18185pub struct MoveFolderMetadata {
18186 /// Output only. The time the operation was created.
18187 pub create_time: std::option::Option<wkt::Timestamp>,
18188
18189 /// Output only. The time the operation finished running.
18190 pub end_time: std::option::Option<wkt::Timestamp>,
18191
18192 /// Output only. Server-defined resource path for the target of the operation.
18193 pub target: std::string::String,
18194
18195 /// The state of the move.
18196 pub state: crate::model::move_folder_metadata::State,
18197
18198 /// Percent complete of the move [0, 100].
18199 pub percent_complete: i32,
18200
18201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18202}
18203
18204impl MoveFolderMetadata {
18205 /// Creates a new default instance.
18206 pub fn new() -> Self {
18207 std::default::Default::default()
18208 }
18209
18210 /// Sets the value of [create_time][crate::model::MoveFolderMetadata::create_time].
18211 ///
18212 /// # Example
18213 /// ```ignore,no_run
18214 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18215 /// use wkt::Timestamp;
18216 /// let x = MoveFolderMetadata::new().set_create_time(Timestamp::default()/* use setters */);
18217 /// ```
18218 pub fn set_create_time<T>(mut self, v: T) -> Self
18219 where
18220 T: std::convert::Into<wkt::Timestamp>,
18221 {
18222 self.create_time = std::option::Option::Some(v.into());
18223 self
18224 }
18225
18226 /// Sets or clears the value of [create_time][crate::model::MoveFolderMetadata::create_time].
18227 ///
18228 /// # Example
18229 /// ```ignore,no_run
18230 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18231 /// use wkt::Timestamp;
18232 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18233 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(None::<Timestamp>);
18234 /// ```
18235 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18236 where
18237 T: std::convert::Into<wkt::Timestamp>,
18238 {
18239 self.create_time = v.map(|x| x.into());
18240 self
18241 }
18242
18243 /// Sets the value of [end_time][crate::model::MoveFolderMetadata::end_time].
18244 ///
18245 /// # Example
18246 /// ```ignore,no_run
18247 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18248 /// use wkt::Timestamp;
18249 /// let x = MoveFolderMetadata::new().set_end_time(Timestamp::default()/* use setters */);
18250 /// ```
18251 pub fn set_end_time<T>(mut self, v: T) -> Self
18252 where
18253 T: std::convert::Into<wkt::Timestamp>,
18254 {
18255 self.end_time = std::option::Option::Some(v.into());
18256 self
18257 }
18258
18259 /// Sets or clears the value of [end_time][crate::model::MoveFolderMetadata::end_time].
18260 ///
18261 /// # Example
18262 /// ```ignore,no_run
18263 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18264 /// use wkt::Timestamp;
18265 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
18266 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(None::<Timestamp>);
18267 /// ```
18268 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18269 where
18270 T: std::convert::Into<wkt::Timestamp>,
18271 {
18272 self.end_time = v.map(|x| x.into());
18273 self
18274 }
18275
18276 /// Sets the value of [target][crate::model::MoveFolderMetadata::target].
18277 ///
18278 /// # Example
18279 /// ```ignore,no_run
18280 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18281 /// let x = MoveFolderMetadata::new().set_target("example");
18282 /// ```
18283 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18284 self.target = v.into();
18285 self
18286 }
18287
18288 /// Sets the value of [state][crate::model::MoveFolderMetadata::state].
18289 ///
18290 /// # Example
18291 /// ```ignore,no_run
18292 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18293 /// use google_cloud_dataform_v1::model::move_folder_metadata::State;
18294 /// let x0 = MoveFolderMetadata::new().set_state(State::Initialized);
18295 /// let x1 = MoveFolderMetadata::new().set_state(State::InProgress);
18296 /// let x2 = MoveFolderMetadata::new().set_state(State::Success);
18297 /// ```
18298 pub fn set_state<T: std::convert::Into<crate::model::move_folder_metadata::State>>(
18299 mut self,
18300 v: T,
18301 ) -> Self {
18302 self.state = v.into();
18303 self
18304 }
18305
18306 /// Sets the value of [percent_complete][crate::model::MoveFolderMetadata::percent_complete].
18307 ///
18308 /// # Example
18309 /// ```ignore,no_run
18310 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18311 /// let x = MoveFolderMetadata::new().set_percent_complete(42);
18312 /// ```
18313 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18314 self.percent_complete = v.into();
18315 self
18316 }
18317}
18318
18319impl wkt::message::Message for MoveFolderMetadata {
18320 fn typename() -> &'static str {
18321 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderMetadata"
18322 }
18323}
18324
18325/// Defines additional types related to [MoveFolderMetadata].
18326pub mod move_folder_metadata {
18327 #[allow(unused_imports)]
18328 use super::*;
18329
18330 /// Different states of the move.
18331 ///
18332 /// # Working with unknown values
18333 ///
18334 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18335 /// additional enum variants at any time. Adding new variants is not considered
18336 /// a breaking change. Applications should write their code in anticipation of:
18337 ///
18338 /// - New values appearing in future releases of the client library, **and**
18339 /// - New values received dynamically, without application changes.
18340 ///
18341 /// Please consult the [Working with enums] section in the user guide for some
18342 /// guidelines.
18343 ///
18344 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18345 #[derive(Clone, Debug, PartialEq)]
18346 #[non_exhaustive]
18347 pub enum State {
18348 /// The state is unspecified.
18349 Unspecified,
18350 /// The move was initialized and recorded by the server, but not yet started.
18351 Initialized,
18352 /// The move is in progress.
18353 InProgress,
18354 /// The move has completed successfully.
18355 Success,
18356 /// The move has failed.
18357 Failed,
18358 /// If set, the enum was initialized with an unknown value.
18359 ///
18360 /// Applications can examine the value using [State::value] or
18361 /// [State::name].
18362 UnknownValue(state::UnknownValue),
18363 }
18364
18365 #[doc(hidden)]
18366 pub mod state {
18367 #[allow(unused_imports)]
18368 use super::*;
18369 #[derive(Clone, Debug, PartialEq)]
18370 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18371 }
18372
18373 impl State {
18374 /// Gets the enum value.
18375 ///
18376 /// Returns `None` if the enum contains an unknown value deserialized from
18377 /// the string representation of enums.
18378 pub fn value(&self) -> std::option::Option<i32> {
18379 match self {
18380 Self::Unspecified => std::option::Option::Some(0),
18381 Self::Initialized => std::option::Option::Some(1),
18382 Self::InProgress => std::option::Option::Some(2),
18383 Self::Success => std::option::Option::Some(3),
18384 Self::Failed => std::option::Option::Some(4),
18385 Self::UnknownValue(u) => u.0.value(),
18386 }
18387 }
18388
18389 /// Gets the enum value as a string.
18390 ///
18391 /// Returns `None` if the enum contains an unknown value deserialized from
18392 /// the integer representation of enums.
18393 pub fn name(&self) -> std::option::Option<&str> {
18394 match self {
18395 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18396 Self::Initialized => std::option::Option::Some("INITIALIZED"),
18397 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18398 Self::Success => std::option::Option::Some("SUCCESS"),
18399 Self::Failed => std::option::Option::Some("FAILED"),
18400 Self::UnknownValue(u) => u.0.name(),
18401 }
18402 }
18403 }
18404
18405 impl std::default::Default for State {
18406 fn default() -> Self {
18407 use std::convert::From;
18408 Self::from(0)
18409 }
18410 }
18411
18412 impl std::fmt::Display for State {
18413 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18414 wkt::internal::display_enum(f, self.name(), self.value())
18415 }
18416 }
18417
18418 impl std::convert::From<i32> for State {
18419 fn from(value: i32) -> Self {
18420 match value {
18421 0 => Self::Unspecified,
18422 1 => Self::Initialized,
18423 2 => Self::InProgress,
18424 3 => Self::Success,
18425 4 => Self::Failed,
18426 _ => Self::UnknownValue(state::UnknownValue(
18427 wkt::internal::UnknownEnumValue::Integer(value),
18428 )),
18429 }
18430 }
18431 }
18432
18433 impl std::convert::From<&str> for State {
18434 fn from(value: &str) -> Self {
18435 use std::string::ToString;
18436 match value {
18437 "STATE_UNSPECIFIED" => Self::Unspecified,
18438 "INITIALIZED" => Self::Initialized,
18439 "IN_PROGRESS" => Self::InProgress,
18440 "SUCCESS" => Self::Success,
18441 "FAILED" => Self::Failed,
18442 _ => Self::UnknownValue(state::UnknownValue(
18443 wkt::internal::UnknownEnumValue::String(value.to_string()),
18444 )),
18445 }
18446 }
18447 }
18448
18449 impl serde::ser::Serialize for State {
18450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18451 where
18452 S: serde::Serializer,
18453 {
18454 match self {
18455 Self::Unspecified => serializer.serialize_i32(0),
18456 Self::Initialized => serializer.serialize_i32(1),
18457 Self::InProgress => serializer.serialize_i32(2),
18458 Self::Success => serializer.serialize_i32(3),
18459 Self::Failed => serializer.serialize_i32(4),
18460 Self::UnknownValue(u) => u.0.serialize(serializer),
18461 }
18462 }
18463 }
18464
18465 impl<'de> serde::de::Deserialize<'de> for State {
18466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18467 where
18468 D: serde::Deserializer<'de>,
18469 {
18470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18471 ".google.cloud.dataform.v1.MoveFolderMetadata.State",
18472 ))
18473 }
18474 }
18475}
18476
18477/// Contains metadata about the progress of the MoveRepository Long-running
18478/// operations.
18479#[derive(Clone, Default, PartialEq)]
18480#[non_exhaustive]
18481pub struct MoveRepositoryMetadata {
18482 /// Output only. The time the operation was created.
18483 pub create_time: std::option::Option<wkt::Timestamp>,
18484
18485 /// Output only. The time the operation finished running.
18486 pub end_time: std::option::Option<wkt::Timestamp>,
18487
18488 /// Output only. Server-defined resource path for the target of the operation.
18489 pub target: std::string::String,
18490
18491 /// The state of the move.
18492 pub state: crate::model::move_repository_metadata::State,
18493
18494 /// Percent complete of the move [0, 100].
18495 pub percent_complete: i32,
18496
18497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18498}
18499
18500impl MoveRepositoryMetadata {
18501 /// Creates a new default instance.
18502 pub fn new() -> Self {
18503 std::default::Default::default()
18504 }
18505
18506 /// Sets the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
18507 ///
18508 /// # Example
18509 /// ```ignore,no_run
18510 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18511 /// use wkt::Timestamp;
18512 /// let x = MoveRepositoryMetadata::new().set_create_time(Timestamp::default()/* use setters */);
18513 /// ```
18514 pub fn set_create_time<T>(mut self, v: T) -> Self
18515 where
18516 T: std::convert::Into<wkt::Timestamp>,
18517 {
18518 self.create_time = std::option::Option::Some(v.into());
18519 self
18520 }
18521
18522 /// Sets or clears the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
18523 ///
18524 /// # Example
18525 /// ```ignore,no_run
18526 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18527 /// use wkt::Timestamp;
18528 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18529 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(None::<Timestamp>);
18530 /// ```
18531 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18532 where
18533 T: std::convert::Into<wkt::Timestamp>,
18534 {
18535 self.create_time = v.map(|x| x.into());
18536 self
18537 }
18538
18539 /// Sets the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
18540 ///
18541 /// # Example
18542 /// ```ignore,no_run
18543 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18544 /// use wkt::Timestamp;
18545 /// let x = MoveRepositoryMetadata::new().set_end_time(Timestamp::default()/* use setters */);
18546 /// ```
18547 pub fn set_end_time<T>(mut self, v: T) -> Self
18548 where
18549 T: std::convert::Into<wkt::Timestamp>,
18550 {
18551 self.end_time = std::option::Option::Some(v.into());
18552 self
18553 }
18554
18555 /// Sets or clears the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
18556 ///
18557 /// # Example
18558 /// ```ignore,no_run
18559 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18560 /// use wkt::Timestamp;
18561 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
18562 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(None::<Timestamp>);
18563 /// ```
18564 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18565 where
18566 T: std::convert::Into<wkt::Timestamp>,
18567 {
18568 self.end_time = v.map(|x| x.into());
18569 self
18570 }
18571
18572 /// Sets the value of [target][crate::model::MoveRepositoryMetadata::target].
18573 ///
18574 /// # Example
18575 /// ```ignore,no_run
18576 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18577 /// let x = MoveRepositoryMetadata::new().set_target("example");
18578 /// ```
18579 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18580 self.target = v.into();
18581 self
18582 }
18583
18584 /// Sets the value of [state][crate::model::MoveRepositoryMetadata::state].
18585 ///
18586 /// # Example
18587 /// ```ignore,no_run
18588 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18589 /// use google_cloud_dataform_v1::model::move_repository_metadata::State;
18590 /// let x0 = MoveRepositoryMetadata::new().set_state(State::Initialized);
18591 /// let x1 = MoveRepositoryMetadata::new().set_state(State::InProgress);
18592 /// let x2 = MoveRepositoryMetadata::new().set_state(State::Success);
18593 /// ```
18594 pub fn set_state<T: std::convert::Into<crate::model::move_repository_metadata::State>>(
18595 mut self,
18596 v: T,
18597 ) -> Self {
18598 self.state = v.into();
18599 self
18600 }
18601
18602 /// Sets the value of [percent_complete][crate::model::MoveRepositoryMetadata::percent_complete].
18603 ///
18604 /// # Example
18605 /// ```ignore,no_run
18606 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18607 /// let x = MoveRepositoryMetadata::new().set_percent_complete(42);
18608 /// ```
18609 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18610 self.percent_complete = v.into();
18611 self
18612 }
18613}
18614
18615impl wkt::message::Message for MoveRepositoryMetadata {
18616 fn typename() -> &'static str {
18617 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryMetadata"
18618 }
18619}
18620
18621/// Defines additional types related to [MoveRepositoryMetadata].
18622pub mod move_repository_metadata {
18623 #[allow(unused_imports)]
18624 use super::*;
18625
18626 /// Different states of the move.
18627 ///
18628 /// # Working with unknown values
18629 ///
18630 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18631 /// additional enum variants at any time. Adding new variants is not considered
18632 /// a breaking change. Applications should write their code in anticipation of:
18633 ///
18634 /// - New values appearing in future releases of the client library, **and**
18635 /// - New values received dynamically, without application changes.
18636 ///
18637 /// Please consult the [Working with enums] section in the user guide for some
18638 /// guidelines.
18639 ///
18640 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18641 #[derive(Clone, Debug, PartialEq)]
18642 #[non_exhaustive]
18643 pub enum State {
18644 /// The state is unspecified.
18645 Unspecified,
18646 /// The move was initialized and recorded by the server, but not yet started.
18647 Initialized,
18648 /// The move is in progress.
18649 InProgress,
18650 /// The move has completed successfully.
18651 Success,
18652 /// The move has failed.
18653 Failed,
18654 /// If set, the enum was initialized with an unknown value.
18655 ///
18656 /// Applications can examine the value using [State::value] or
18657 /// [State::name].
18658 UnknownValue(state::UnknownValue),
18659 }
18660
18661 #[doc(hidden)]
18662 pub mod state {
18663 #[allow(unused_imports)]
18664 use super::*;
18665 #[derive(Clone, Debug, PartialEq)]
18666 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18667 }
18668
18669 impl State {
18670 /// Gets the enum value.
18671 ///
18672 /// Returns `None` if the enum contains an unknown value deserialized from
18673 /// the string representation of enums.
18674 pub fn value(&self) -> std::option::Option<i32> {
18675 match self {
18676 Self::Unspecified => std::option::Option::Some(0),
18677 Self::Initialized => std::option::Option::Some(1),
18678 Self::InProgress => std::option::Option::Some(2),
18679 Self::Success => std::option::Option::Some(3),
18680 Self::Failed => std::option::Option::Some(4),
18681 Self::UnknownValue(u) => u.0.value(),
18682 }
18683 }
18684
18685 /// Gets the enum value as a string.
18686 ///
18687 /// Returns `None` if the enum contains an unknown value deserialized from
18688 /// the integer representation of enums.
18689 pub fn name(&self) -> std::option::Option<&str> {
18690 match self {
18691 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18692 Self::Initialized => std::option::Option::Some("INITIALIZED"),
18693 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18694 Self::Success => std::option::Option::Some("SUCCESS"),
18695 Self::Failed => std::option::Option::Some("FAILED"),
18696 Self::UnknownValue(u) => u.0.name(),
18697 }
18698 }
18699 }
18700
18701 impl std::default::Default for State {
18702 fn default() -> Self {
18703 use std::convert::From;
18704 Self::from(0)
18705 }
18706 }
18707
18708 impl std::fmt::Display for State {
18709 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18710 wkt::internal::display_enum(f, self.name(), self.value())
18711 }
18712 }
18713
18714 impl std::convert::From<i32> for State {
18715 fn from(value: i32) -> Self {
18716 match value {
18717 0 => Self::Unspecified,
18718 1 => Self::Initialized,
18719 2 => Self::InProgress,
18720 3 => Self::Success,
18721 4 => Self::Failed,
18722 _ => Self::UnknownValue(state::UnknownValue(
18723 wkt::internal::UnknownEnumValue::Integer(value),
18724 )),
18725 }
18726 }
18727 }
18728
18729 impl std::convert::From<&str> for State {
18730 fn from(value: &str) -> Self {
18731 use std::string::ToString;
18732 match value {
18733 "STATE_UNSPECIFIED" => Self::Unspecified,
18734 "INITIALIZED" => Self::Initialized,
18735 "IN_PROGRESS" => Self::InProgress,
18736 "SUCCESS" => Self::Success,
18737 "FAILED" => Self::Failed,
18738 _ => Self::UnknownValue(state::UnknownValue(
18739 wkt::internal::UnknownEnumValue::String(value.to_string()),
18740 )),
18741 }
18742 }
18743 }
18744
18745 impl serde::ser::Serialize for State {
18746 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18747 where
18748 S: serde::Serializer,
18749 {
18750 match self {
18751 Self::Unspecified => serializer.serialize_i32(0),
18752 Self::Initialized => serializer.serialize_i32(1),
18753 Self::InProgress => serializer.serialize_i32(2),
18754 Self::Success => serializer.serialize_i32(3),
18755 Self::Failed => serializer.serialize_i32(4),
18756 Self::UnknownValue(u) => u.0.serialize(serializer),
18757 }
18758 }
18759 }
18760
18761 impl<'de> serde::de::Deserialize<'de> for State {
18762 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18763 where
18764 D: serde::Deserializer<'de>,
18765 {
18766 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18767 ".google.cloud.dataform.v1.MoveRepositoryMetadata.State",
18768 ))
18769 }
18770 }
18771}
18772
18773/// Represents the level of detail to return for directory contents.
18774///
18775/// # Working with unknown values
18776///
18777/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18778/// additional enum variants at any time. Adding new variants is not considered
18779/// a breaking change. Applications should write their code in anticipation of:
18780///
18781/// - New values appearing in future releases of the client library, **and**
18782/// - New values received dynamically, without application changes.
18783///
18784/// Please consult the [Working with enums] section in the user guide for some
18785/// guidelines.
18786///
18787/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18788#[derive(Clone, Debug, PartialEq)]
18789#[non_exhaustive]
18790pub enum DirectoryContentsView {
18791 /// The default unset value. Defaults to DIRECTORY_CONTENTS_VIEW_BASIC.
18792 Unspecified,
18793 /// Includes only the file or directory name. This is the default behavior.
18794 Basic,
18795 /// Includes all metadata for each file or directory. Currently not supported
18796 /// by CMEK-protected workspaces.
18797 Metadata,
18798 /// If set, the enum was initialized with an unknown value.
18799 ///
18800 /// Applications can examine the value using [DirectoryContentsView::value] or
18801 /// [DirectoryContentsView::name].
18802 UnknownValue(directory_contents_view::UnknownValue),
18803}
18804
18805#[doc(hidden)]
18806pub mod directory_contents_view {
18807 #[allow(unused_imports)]
18808 use super::*;
18809 #[derive(Clone, Debug, PartialEq)]
18810 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18811}
18812
18813impl DirectoryContentsView {
18814 /// Gets the enum value.
18815 ///
18816 /// Returns `None` if the enum contains an unknown value deserialized from
18817 /// the string representation of enums.
18818 pub fn value(&self) -> std::option::Option<i32> {
18819 match self {
18820 Self::Unspecified => std::option::Option::Some(0),
18821 Self::Basic => std::option::Option::Some(1),
18822 Self::Metadata => std::option::Option::Some(2),
18823 Self::UnknownValue(u) => u.0.value(),
18824 }
18825 }
18826
18827 /// Gets the enum value as a string.
18828 ///
18829 /// Returns `None` if the enum contains an unknown value deserialized from
18830 /// the integer representation of enums.
18831 pub fn name(&self) -> std::option::Option<&str> {
18832 match self {
18833 Self::Unspecified => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_UNSPECIFIED"),
18834 Self::Basic => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_BASIC"),
18835 Self::Metadata => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_METADATA"),
18836 Self::UnknownValue(u) => u.0.name(),
18837 }
18838 }
18839}
18840
18841impl std::default::Default for DirectoryContentsView {
18842 fn default() -> Self {
18843 use std::convert::From;
18844 Self::from(0)
18845 }
18846}
18847
18848impl std::fmt::Display for DirectoryContentsView {
18849 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18850 wkt::internal::display_enum(f, self.name(), self.value())
18851 }
18852}
18853
18854impl std::convert::From<i32> for DirectoryContentsView {
18855 fn from(value: i32) -> Self {
18856 match value {
18857 0 => Self::Unspecified,
18858 1 => Self::Basic,
18859 2 => Self::Metadata,
18860 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
18861 wkt::internal::UnknownEnumValue::Integer(value),
18862 )),
18863 }
18864 }
18865}
18866
18867impl std::convert::From<&str> for DirectoryContentsView {
18868 fn from(value: &str) -> Self {
18869 use std::string::ToString;
18870 match value {
18871 "DIRECTORY_CONTENTS_VIEW_UNSPECIFIED" => Self::Unspecified,
18872 "DIRECTORY_CONTENTS_VIEW_BASIC" => Self::Basic,
18873 "DIRECTORY_CONTENTS_VIEW_METADATA" => Self::Metadata,
18874 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
18875 wkt::internal::UnknownEnumValue::String(value.to_string()),
18876 )),
18877 }
18878 }
18879}
18880
18881impl serde::ser::Serialize for DirectoryContentsView {
18882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18883 where
18884 S: serde::Serializer,
18885 {
18886 match self {
18887 Self::Unspecified => serializer.serialize_i32(0),
18888 Self::Basic => serializer.serialize_i32(1),
18889 Self::Metadata => serializer.serialize_i32(2),
18890 Self::UnknownValue(u) => u.0.serialize(serializer),
18891 }
18892 }
18893}
18894
18895impl<'de> serde::de::Deserialize<'de> for DirectoryContentsView {
18896 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18897 where
18898 D: serde::Deserializer<'de>,
18899 {
18900 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryContentsView>::new(
18901 ".google.cloud.dataform.v1.DirectoryContentsView",
18902 ))
18903 }
18904}