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 /// Optional. Includes configuration options for end user authentication.
151 pub end_user_auth_config: std::option::Option<crate::model::repository::EndUserAuthConfig>,
152
153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl Repository {
157 /// Creates a new default instance.
158 pub fn new() -> Self {
159 std::default::Default::default()
160 }
161
162 /// Sets the value of [name][crate::model::Repository::name].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_dataform_v1::model::Repository;
167 /// # let project_id = "project_id";
168 /// # let location_id = "location_id";
169 /// # let repository_id = "repository_id";
170 /// let x = Repository::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
171 /// ```
172 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
173 self.name = v.into();
174 self
175 }
176
177 /// Sets the value of [containing_folder][crate::model::Repository::containing_folder].
178 ///
179 /// # Example
180 /// ```ignore,no_run
181 /// # use google_cloud_dataform_v1::model::Repository;
182 /// let x = Repository::new().set_containing_folder("example");
183 /// ```
184 pub fn set_containing_folder<T>(mut self, v: T) -> Self
185 where
186 T: std::convert::Into<std::string::String>,
187 {
188 self.containing_folder = std::option::Option::Some(v.into());
189 self
190 }
191
192 /// Sets or clears the value of [containing_folder][crate::model::Repository::containing_folder].
193 ///
194 /// # Example
195 /// ```ignore,no_run
196 /// # use google_cloud_dataform_v1::model::Repository;
197 /// let x = Repository::new().set_or_clear_containing_folder(Some("example"));
198 /// let x = Repository::new().set_or_clear_containing_folder(None::<String>);
199 /// ```
200 pub fn set_or_clear_containing_folder<T>(mut self, v: std::option::Option<T>) -> Self
201 where
202 T: std::convert::Into<std::string::String>,
203 {
204 self.containing_folder = v.map(|x| x.into());
205 self
206 }
207
208 /// Sets the value of [team_folder_name][crate::model::Repository::team_folder_name].
209 ///
210 /// # Example
211 /// ```ignore,no_run
212 /// # use google_cloud_dataform_v1::model::Repository;
213 /// let x = Repository::new().set_team_folder_name("example");
214 /// ```
215 pub fn set_team_folder_name<T>(mut self, v: T) -> Self
216 where
217 T: std::convert::Into<std::string::String>,
218 {
219 self.team_folder_name = std::option::Option::Some(v.into());
220 self
221 }
222
223 /// Sets or clears the value of [team_folder_name][crate::model::Repository::team_folder_name].
224 ///
225 /// # Example
226 /// ```ignore,no_run
227 /// # use google_cloud_dataform_v1::model::Repository;
228 /// let x = Repository::new().set_or_clear_team_folder_name(Some("example"));
229 /// let x = Repository::new().set_or_clear_team_folder_name(None::<String>);
230 /// ```
231 pub fn set_or_clear_team_folder_name<T>(mut self, v: std::option::Option<T>) -> Self
232 where
233 T: std::convert::Into<std::string::String>,
234 {
235 self.team_folder_name = v.map(|x| x.into());
236 self
237 }
238
239 /// Sets the value of [create_time][crate::model::Repository::create_time].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_dataform_v1::model::Repository;
244 /// use wkt::Timestamp;
245 /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
246 /// ```
247 pub fn set_create_time<T>(mut self, v: T) -> Self
248 where
249 T: std::convert::Into<wkt::Timestamp>,
250 {
251 self.create_time = std::option::Option::Some(v.into());
252 self
253 }
254
255 /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
256 ///
257 /// # Example
258 /// ```ignore,no_run
259 /// # use google_cloud_dataform_v1::model::Repository;
260 /// use wkt::Timestamp;
261 /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
262 /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
263 /// ```
264 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
265 where
266 T: std::convert::Into<wkt::Timestamp>,
267 {
268 self.create_time = v.map(|x| x.into());
269 self
270 }
271
272 /// Sets the value of [display_name][crate::model::Repository::display_name].
273 ///
274 /// # Example
275 /// ```ignore,no_run
276 /// # use google_cloud_dataform_v1::model::Repository;
277 /// let x = Repository::new().set_display_name("example");
278 /// ```
279 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
280 self.display_name = v.into();
281 self
282 }
283
284 /// Sets the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
285 ///
286 /// # Example
287 /// ```ignore,no_run
288 /// # use google_cloud_dataform_v1::model::Repository;
289 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
290 /// let x = Repository::new().set_git_remote_settings(GitRemoteSettings::default()/* use setters */);
291 /// ```
292 pub fn set_git_remote_settings<T>(mut self, v: T) -> Self
293 where
294 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
295 {
296 self.git_remote_settings = std::option::Option::Some(v.into());
297 self
298 }
299
300 /// Sets or clears the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
301 ///
302 /// # Example
303 /// ```ignore,no_run
304 /// # use google_cloud_dataform_v1::model::Repository;
305 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
306 /// let x = Repository::new().set_or_clear_git_remote_settings(Some(GitRemoteSettings::default()/* use setters */));
307 /// let x = Repository::new().set_or_clear_git_remote_settings(None::<GitRemoteSettings>);
308 /// ```
309 pub fn set_or_clear_git_remote_settings<T>(mut self, v: std::option::Option<T>) -> Self
310 where
311 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
312 {
313 self.git_remote_settings = v.map(|x| x.into());
314 self
315 }
316
317 /// Sets the value of [npmrc_environment_variables_secret_version][crate::model::Repository::npmrc_environment_variables_secret_version].
318 ///
319 /// # Example
320 /// ```ignore,no_run
321 /// # use google_cloud_dataform_v1::model::Repository;
322 /// let x = Repository::new().set_npmrc_environment_variables_secret_version("example");
323 /// ```
324 pub fn set_npmrc_environment_variables_secret_version<
325 T: std::convert::Into<std::string::String>,
326 >(
327 mut self,
328 v: T,
329 ) -> Self {
330 self.npmrc_environment_variables_secret_version = v.into();
331 self
332 }
333
334 /// Sets the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
335 ///
336 /// # Example
337 /// ```ignore,no_run
338 /// # use google_cloud_dataform_v1::model::Repository;
339 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
340 /// let x = Repository::new().set_workspace_compilation_overrides(WorkspaceCompilationOverrides::default()/* use setters */);
341 /// ```
342 pub fn set_workspace_compilation_overrides<T>(mut self, v: T) -> Self
343 where
344 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
345 {
346 self.workspace_compilation_overrides = std::option::Option::Some(v.into());
347 self
348 }
349
350 /// Sets or clears the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
351 ///
352 /// # Example
353 /// ```ignore,no_run
354 /// # use google_cloud_dataform_v1::model::Repository;
355 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
356 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(Some(WorkspaceCompilationOverrides::default()/* use setters */));
357 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(None::<WorkspaceCompilationOverrides>);
358 /// ```
359 pub fn set_or_clear_workspace_compilation_overrides<T>(
360 mut self,
361 v: std::option::Option<T>,
362 ) -> Self
363 where
364 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
365 {
366 self.workspace_compilation_overrides = v.map(|x| x.into());
367 self
368 }
369
370 /// Sets the value of [labels][crate::model::Repository::labels].
371 ///
372 /// # Example
373 /// ```ignore,no_run
374 /// # use google_cloud_dataform_v1::model::Repository;
375 /// let x = Repository::new().set_labels([
376 /// ("key0", "abc"),
377 /// ("key1", "xyz"),
378 /// ]);
379 /// ```
380 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
381 where
382 T: std::iter::IntoIterator<Item = (K, V)>,
383 K: std::convert::Into<std::string::String>,
384 V: std::convert::Into<std::string::String>,
385 {
386 use std::iter::Iterator;
387 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
388 self
389 }
390
391 /// Sets the value of [set_authenticated_user_admin][crate::model::Repository::set_authenticated_user_admin].
392 ///
393 /// # Example
394 /// ```ignore,no_run
395 /// # use google_cloud_dataform_v1::model::Repository;
396 /// let x = Repository::new().set_set_authenticated_user_admin(true);
397 /// ```
398 pub fn set_set_authenticated_user_admin<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
399 self.set_authenticated_user_admin = v.into();
400 self
401 }
402
403 /// Sets the value of [service_account][crate::model::Repository::service_account].
404 ///
405 /// # Example
406 /// ```ignore,no_run
407 /// # use google_cloud_dataform_v1::model::Repository;
408 /// let x = Repository::new().set_service_account("example");
409 /// ```
410 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
411 self.service_account = v.into();
412 self
413 }
414
415 /// Sets the value of [kms_key_name][crate::model::Repository::kms_key_name].
416 ///
417 /// # Example
418 /// ```ignore,no_run
419 /// # use google_cloud_dataform_v1::model::Repository;
420 /// let x = Repository::new().set_kms_key_name("example");
421 /// ```
422 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
423 self.kms_key_name = v.into();
424 self
425 }
426
427 /// Sets the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
428 ///
429 /// # Example
430 /// ```ignore,no_run
431 /// # use google_cloud_dataform_v1::model::Repository;
432 /// use google_cloud_dataform_v1::model::DataEncryptionState;
433 /// let x = Repository::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
434 /// ```
435 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
436 where
437 T: std::convert::Into<crate::model::DataEncryptionState>,
438 {
439 self.data_encryption_state = std::option::Option::Some(v.into());
440 self
441 }
442
443 /// Sets or clears the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
444 ///
445 /// # Example
446 /// ```ignore,no_run
447 /// # use google_cloud_dataform_v1::model::Repository;
448 /// use google_cloud_dataform_v1::model::DataEncryptionState;
449 /// let x = Repository::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
450 /// let x = Repository::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
451 /// ```
452 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
453 where
454 T: std::convert::Into<crate::model::DataEncryptionState>,
455 {
456 self.data_encryption_state = v.map(|x| x.into());
457 self
458 }
459
460 /// Sets the value of [internal_metadata][crate::model::Repository::internal_metadata].
461 ///
462 /// # Example
463 /// ```ignore,no_run
464 /// # use google_cloud_dataform_v1::model::Repository;
465 /// let x = Repository::new().set_internal_metadata("example");
466 /// ```
467 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
468 where
469 T: std::convert::Into<std::string::String>,
470 {
471 self.internal_metadata = std::option::Option::Some(v.into());
472 self
473 }
474
475 /// Sets or clears the value of [internal_metadata][crate::model::Repository::internal_metadata].
476 ///
477 /// # Example
478 /// ```ignore,no_run
479 /// # use google_cloud_dataform_v1::model::Repository;
480 /// let x = Repository::new().set_or_clear_internal_metadata(Some("example"));
481 /// let x = Repository::new().set_or_clear_internal_metadata(None::<String>);
482 /// ```
483 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
484 where
485 T: std::convert::Into<std::string::String>,
486 {
487 self.internal_metadata = v.map(|x| x.into());
488 self
489 }
490
491 /// Sets the value of [end_user_auth_config][crate::model::Repository::end_user_auth_config].
492 ///
493 /// # Example
494 /// ```ignore,no_run
495 /// # use google_cloud_dataform_v1::model::Repository;
496 /// use google_cloud_dataform_v1::model::repository::EndUserAuthConfig;
497 /// let x = Repository::new().set_end_user_auth_config(EndUserAuthConfig::default()/* use setters */);
498 /// ```
499 pub fn set_end_user_auth_config<T>(mut self, v: T) -> Self
500 where
501 T: std::convert::Into<crate::model::repository::EndUserAuthConfig>,
502 {
503 self.end_user_auth_config = std::option::Option::Some(v.into());
504 self
505 }
506
507 /// Sets or clears the value of [end_user_auth_config][crate::model::Repository::end_user_auth_config].
508 ///
509 /// # Example
510 /// ```ignore,no_run
511 /// # use google_cloud_dataform_v1::model::Repository;
512 /// use google_cloud_dataform_v1::model::repository::EndUserAuthConfig;
513 /// let x = Repository::new().set_or_clear_end_user_auth_config(Some(EndUserAuthConfig::default()/* use setters */));
514 /// let x = Repository::new().set_or_clear_end_user_auth_config(None::<EndUserAuthConfig>);
515 /// ```
516 pub fn set_or_clear_end_user_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<crate::model::repository::EndUserAuthConfig>,
519 {
520 self.end_user_auth_config = v.map(|x| x.into());
521 self
522 }
523}
524
525impl wkt::message::Message for Repository {
526 fn typename() -> &'static str {
527 "type.googleapis.com/google.cloud.dataform.v1.Repository"
528 }
529}
530
531/// Defines additional types related to [Repository].
532pub mod repository {
533 #[allow(unused_imports)]
534 use super::*;
535
536 /// Controls Git remote configuration for a repository.
537 #[derive(Clone, Default, PartialEq)]
538 #[non_exhaustive]
539 pub struct GitRemoteSettings {
540 /// Required. The Git remote's URL.
541 pub url: std::string::String,
542
543 /// Optional. The Git remote's default branch name.
544 /// If not set, `main` will be used.
545 pub default_branch: std::string::String,
546
547 /// Output only. The Git remote's effective default branch name.
548 /// This is the default branch name of the Git remote if it is set,
549 /// otherwise it is `main`.
550 pub effective_default_branch: std::string::String,
551
552 /// Optional. The name of the Secret Manager secret version to use as an
553 /// authentication token for Git operations. Must be in the format
554 /// `projects/*/secrets/*/versions/*`.
555 pub authentication_token_secret_version: std::string::String,
556
557 /// Optional. Authentication fields for remote uris using SSH protocol.
558 pub ssh_authentication_config: std::option::Option<
559 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
560 >,
561
562 /// Optional. Resource name for the `GitRepositoryLink` used for machine
563 /// credentials. Must be in the format
564 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`
565 pub git_repository_link: std::option::Option<std::string::String>,
566
567 /// Output only. Deprecated: The field does not contain any token status
568 /// information.
569 #[deprecated]
570 pub token_status: crate::model::repository::git_remote_settings::TokenStatus,
571
572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
573 }
574
575 impl GitRemoteSettings {
576 /// Creates a new default instance.
577 pub fn new() -> Self {
578 std::default::Default::default()
579 }
580
581 /// Sets the value of [url][crate::model::repository::GitRemoteSettings::url].
582 ///
583 /// # Example
584 /// ```ignore,no_run
585 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
586 /// let x = GitRemoteSettings::new().set_url("example");
587 /// ```
588 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
589 self.url = v.into();
590 self
591 }
592
593 /// Sets the value of [default_branch][crate::model::repository::GitRemoteSettings::default_branch].
594 ///
595 /// # Example
596 /// ```ignore,no_run
597 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
598 /// let x = GitRemoteSettings::new().set_default_branch("example");
599 /// ```
600 pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
601 mut self,
602 v: T,
603 ) -> Self {
604 self.default_branch = v.into();
605 self
606 }
607
608 /// Sets the value of [effective_default_branch][crate::model::repository::GitRemoteSettings::effective_default_branch].
609 ///
610 /// # Example
611 /// ```ignore,no_run
612 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
613 /// let x = GitRemoteSettings::new().set_effective_default_branch("example");
614 /// ```
615 pub fn set_effective_default_branch<T: std::convert::Into<std::string::String>>(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.effective_default_branch = v.into();
620 self
621 }
622
623 /// Sets the value of [authentication_token_secret_version][crate::model::repository::GitRemoteSettings::authentication_token_secret_version].
624 ///
625 /// # Example
626 /// ```ignore,no_run
627 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
628 /// let x = GitRemoteSettings::new().set_authentication_token_secret_version("example");
629 /// ```
630 pub fn set_authentication_token_secret_version<
631 T: std::convert::Into<std::string::String>,
632 >(
633 mut self,
634 v: T,
635 ) -> Self {
636 self.authentication_token_secret_version = v.into();
637 self
638 }
639
640 /// Sets the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
645 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
646 /// let x = GitRemoteSettings::new().set_ssh_authentication_config(SshAuthenticationConfig::default()/* use setters */);
647 /// ```
648 pub fn set_ssh_authentication_config<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<
651 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
652 >,
653 {
654 self.ssh_authentication_config = std::option::Option::Some(v.into());
655 self
656 }
657
658 /// Sets or clears the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
659 ///
660 /// # Example
661 /// ```ignore,no_run
662 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
663 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
664 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(Some(SshAuthenticationConfig::default()/* use setters */));
665 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(None::<SshAuthenticationConfig>);
666 /// ```
667 pub fn set_or_clear_ssh_authentication_config<T>(
668 mut self,
669 v: std::option::Option<T>,
670 ) -> Self
671 where
672 T: std::convert::Into<
673 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
674 >,
675 {
676 self.ssh_authentication_config = v.map(|x| x.into());
677 self
678 }
679
680 /// Sets the value of [git_repository_link][crate::model::repository::GitRemoteSettings::git_repository_link].
681 ///
682 /// # Example
683 /// ```ignore,no_run
684 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
685 /// let x = GitRemoteSettings::new().set_git_repository_link("example");
686 /// ```
687 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
688 where
689 T: std::convert::Into<std::string::String>,
690 {
691 self.git_repository_link = std::option::Option::Some(v.into());
692 self
693 }
694
695 /// Sets or clears the value of [git_repository_link][crate::model::repository::GitRemoteSettings::git_repository_link].
696 ///
697 /// # Example
698 /// ```ignore,no_run
699 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
700 /// let x = GitRemoteSettings::new().set_or_clear_git_repository_link(Some("example"));
701 /// let x = GitRemoteSettings::new().set_or_clear_git_repository_link(None::<String>);
702 /// ```
703 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
704 where
705 T: std::convert::Into<std::string::String>,
706 {
707 self.git_repository_link = v.map(|x| x.into());
708 self
709 }
710
711 /// Sets the value of [token_status][crate::model::repository::GitRemoteSettings::token_status].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
716 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::TokenStatus;
717 /// let x0 = GitRemoteSettings::new().set_token_status(TokenStatus::NotFound);
718 /// let x1 = GitRemoteSettings::new().set_token_status(TokenStatus::Invalid);
719 /// let x2 = GitRemoteSettings::new().set_token_status(TokenStatus::Valid);
720 /// ```
721 #[deprecated]
722 pub fn set_token_status<
723 T: std::convert::Into<crate::model::repository::git_remote_settings::TokenStatus>,
724 >(
725 mut self,
726 v: T,
727 ) -> Self {
728 self.token_status = v.into();
729 self
730 }
731 }
732
733 impl wkt::message::Message for GitRemoteSettings {
734 fn typename() -> &'static str {
735 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings"
736 }
737 }
738
739 /// Defines additional types related to [GitRemoteSettings].
740 pub mod git_remote_settings {
741 #[allow(unused_imports)]
742 use super::*;
743
744 /// Configures fields for performing SSH authentication.
745 #[derive(Clone, Default, PartialEq)]
746 #[non_exhaustive]
747 pub struct SshAuthenticationConfig {
748 /// Required. The name of the Secret Manager secret version to use as a
749 /// ssh private key for Git operations.
750 /// Must be in the format `projects/*/secrets/*/versions/*`.
751 pub user_private_key_secret_version: std::string::String,
752
753 /// Required. Content of a public SSH key to verify an identity of a remote
754 /// Git host.
755 pub host_public_key: std::string::String,
756
757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
758 }
759
760 impl SshAuthenticationConfig {
761 /// Creates a new default instance.
762 pub fn new() -> Self {
763 std::default::Default::default()
764 }
765
766 /// Sets the value of [user_private_key_secret_version][crate::model::repository::git_remote_settings::SshAuthenticationConfig::user_private_key_secret_version].
767 ///
768 /// # Example
769 /// ```ignore,no_run
770 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
771 /// let x = SshAuthenticationConfig::new().set_user_private_key_secret_version("example");
772 /// ```
773 pub fn set_user_private_key_secret_version<
774 T: std::convert::Into<std::string::String>,
775 >(
776 mut self,
777 v: T,
778 ) -> Self {
779 self.user_private_key_secret_version = v.into();
780 self
781 }
782
783 /// Sets the value of [host_public_key][crate::model::repository::git_remote_settings::SshAuthenticationConfig::host_public_key].
784 ///
785 /// # Example
786 /// ```ignore,no_run
787 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
788 /// let x = SshAuthenticationConfig::new().set_host_public_key("example");
789 /// ```
790 pub fn set_host_public_key<T: std::convert::Into<std::string::String>>(
791 mut self,
792 v: T,
793 ) -> Self {
794 self.host_public_key = v.into();
795 self
796 }
797 }
798
799 impl wkt::message::Message for SshAuthenticationConfig {
800 fn typename() -> &'static str {
801 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings.SshAuthenticationConfig"
802 }
803 }
804
805 /// The status of the authentication token.
806 ///
807 /// # Working with unknown values
808 ///
809 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
810 /// additional enum variants at any time. Adding new variants is not considered
811 /// a breaking change. Applications should write their code in anticipation of:
812 ///
813 /// - New values appearing in future releases of the client library, **and**
814 /// - New values received dynamically, without application changes.
815 ///
816 /// Please consult the [Working with enums] section in the user guide for some
817 /// guidelines.
818 ///
819 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
820 #[derive(Clone, Debug, PartialEq)]
821 #[non_exhaustive]
822 pub enum TokenStatus {
823 /// Default value. This value is unused.
824 Unspecified,
825 /// The token could not be found in Secret Manager (or the Dataform
826 /// Service Account did not have permission to access it).
827 NotFound,
828 /// The token could not be used to authenticate against the Git remote.
829 Invalid,
830 /// The token was used successfully to authenticate against the Git remote.
831 Valid,
832 /// If set, the enum was initialized with an unknown value.
833 ///
834 /// Applications can examine the value using [TokenStatus::value] or
835 /// [TokenStatus::name].
836 UnknownValue(token_status::UnknownValue),
837 }
838
839 #[doc(hidden)]
840 pub mod token_status {
841 #[allow(unused_imports)]
842 use super::*;
843 #[derive(Clone, Debug, PartialEq)]
844 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
845 }
846
847 impl TokenStatus {
848 /// Gets the enum value.
849 ///
850 /// Returns `None` if the enum contains an unknown value deserialized from
851 /// the string representation of enums.
852 pub fn value(&self) -> std::option::Option<i32> {
853 match self {
854 Self::Unspecified => std::option::Option::Some(0),
855 Self::NotFound => std::option::Option::Some(1),
856 Self::Invalid => std::option::Option::Some(2),
857 Self::Valid => std::option::Option::Some(3),
858 Self::UnknownValue(u) => u.0.value(),
859 }
860 }
861
862 /// Gets the enum value as a string.
863 ///
864 /// Returns `None` if the enum contains an unknown value deserialized from
865 /// the integer representation of enums.
866 pub fn name(&self) -> std::option::Option<&str> {
867 match self {
868 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
869 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
870 Self::Invalid => std::option::Option::Some("INVALID"),
871 Self::Valid => std::option::Option::Some("VALID"),
872 Self::UnknownValue(u) => u.0.name(),
873 }
874 }
875 }
876
877 impl std::default::Default for TokenStatus {
878 fn default() -> Self {
879 use std::convert::From;
880 Self::from(0)
881 }
882 }
883
884 impl std::fmt::Display for TokenStatus {
885 fn fmt(
886 &self,
887 f: &mut std::fmt::Formatter<'_>,
888 ) -> std::result::Result<(), std::fmt::Error> {
889 wkt::internal::display_enum(f, self.name(), self.value())
890 }
891 }
892
893 impl std::convert::From<i32> for TokenStatus {
894 fn from(value: i32) -> Self {
895 match value {
896 0 => Self::Unspecified,
897 1 => Self::NotFound,
898 2 => Self::Invalid,
899 3 => Self::Valid,
900 _ => Self::UnknownValue(token_status::UnknownValue(
901 wkt::internal::UnknownEnumValue::Integer(value),
902 )),
903 }
904 }
905 }
906
907 impl std::convert::From<&str> for TokenStatus {
908 fn from(value: &str) -> Self {
909 use std::string::ToString;
910 match value {
911 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
912 "NOT_FOUND" => Self::NotFound,
913 "INVALID" => Self::Invalid,
914 "VALID" => Self::Valid,
915 _ => Self::UnknownValue(token_status::UnknownValue(
916 wkt::internal::UnknownEnumValue::String(value.to_string()),
917 )),
918 }
919 }
920 }
921
922 impl serde::ser::Serialize for TokenStatus {
923 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
924 where
925 S: serde::Serializer,
926 {
927 match self {
928 Self::Unspecified => serializer.serialize_i32(0),
929 Self::NotFound => serializer.serialize_i32(1),
930 Self::Invalid => serializer.serialize_i32(2),
931 Self::Valid => serializer.serialize_i32(3),
932 Self::UnknownValue(u) => u.0.serialize(serializer),
933 }
934 }
935 }
936
937 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
938 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
939 where
940 D: serde::Deserializer<'de>,
941 {
942 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
943 ".google.cloud.dataform.v1.Repository.GitRemoteSettings.TokenStatus",
944 ))
945 }
946 }
947 }
948
949 /// Configures workspace compilation overrides for a repository.
950 #[derive(Clone, Default, PartialEq)]
951 #[non_exhaustive]
952 pub struct WorkspaceCompilationOverrides {
953 /// Optional. The default database (Google Cloud project ID).
954 pub default_database: std::string::String,
955
956 /// Optional. The suffix that should be appended to all schema (BigQuery
957 /// dataset ID) names.
958 pub schema_suffix: std::string::String,
959
960 /// Optional. The prefix that should be prepended to all table names.
961 pub table_prefix: std::string::String,
962
963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
964 }
965
966 impl WorkspaceCompilationOverrides {
967 /// Creates a new default instance.
968 pub fn new() -> Self {
969 std::default::Default::default()
970 }
971
972 /// Sets the value of [default_database][crate::model::repository::WorkspaceCompilationOverrides::default_database].
973 ///
974 /// # Example
975 /// ```ignore,no_run
976 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
977 /// let x = WorkspaceCompilationOverrides::new().set_default_database("example");
978 /// ```
979 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
980 mut self,
981 v: T,
982 ) -> Self {
983 self.default_database = v.into();
984 self
985 }
986
987 /// Sets the value of [schema_suffix][crate::model::repository::WorkspaceCompilationOverrides::schema_suffix].
988 ///
989 /// # Example
990 /// ```ignore,no_run
991 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
992 /// let x = WorkspaceCompilationOverrides::new().set_schema_suffix("example");
993 /// ```
994 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(
995 mut self,
996 v: T,
997 ) -> Self {
998 self.schema_suffix = v.into();
999 self
1000 }
1001
1002 /// Sets the value of [table_prefix][crate::model::repository::WorkspaceCompilationOverrides::table_prefix].
1003 ///
1004 /// # Example
1005 /// ```ignore,no_run
1006 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
1007 /// let x = WorkspaceCompilationOverrides::new().set_table_prefix("example");
1008 /// ```
1009 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(
1010 mut self,
1011 v: T,
1012 ) -> Self {
1013 self.table_prefix = v.into();
1014 self
1015 }
1016 }
1017
1018 impl wkt::message::Message for WorkspaceCompilationOverrides {
1019 fn typename() -> &'static str {
1020 "type.googleapis.com/google.cloud.dataform.v1.Repository.WorkspaceCompilationOverrides"
1021 }
1022 }
1023
1024 /// Includes configuration options for repository end user authentication.
1025 #[derive(Clone, Default, PartialEq)]
1026 #[non_exhaustive]
1027 pub struct EndUserAuthConfig {
1028 /// Optional. OAuth configuration for repository end user authentication.
1029 pub oauth_config: std::option::Option<crate::model::OAuthConfig>,
1030
1031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1032 }
1033
1034 impl EndUserAuthConfig {
1035 /// Creates a new default instance.
1036 pub fn new() -> Self {
1037 std::default::Default::default()
1038 }
1039
1040 /// Sets the value of [oauth_config][crate::model::repository::EndUserAuthConfig::oauth_config].
1041 ///
1042 /// # Example
1043 /// ```ignore,no_run
1044 /// # use google_cloud_dataform_v1::model::repository::EndUserAuthConfig;
1045 /// use google_cloud_dataform_v1::model::OAuthConfig;
1046 /// let x = EndUserAuthConfig::new().set_oauth_config(OAuthConfig::default()/* use setters */);
1047 /// ```
1048 pub fn set_oauth_config<T>(mut self, v: T) -> Self
1049 where
1050 T: std::convert::Into<crate::model::OAuthConfig>,
1051 {
1052 self.oauth_config = std::option::Option::Some(v.into());
1053 self
1054 }
1055
1056 /// Sets or clears the value of [oauth_config][crate::model::repository::EndUserAuthConfig::oauth_config].
1057 ///
1058 /// # Example
1059 /// ```ignore,no_run
1060 /// # use google_cloud_dataform_v1::model::repository::EndUserAuthConfig;
1061 /// use google_cloud_dataform_v1::model::OAuthConfig;
1062 /// let x = EndUserAuthConfig::new().set_or_clear_oauth_config(Some(OAuthConfig::default()/* use setters */));
1063 /// let x = EndUserAuthConfig::new().set_or_clear_oauth_config(None::<OAuthConfig>);
1064 /// ```
1065 pub fn set_or_clear_oauth_config<T>(mut self, v: std::option::Option<T>) -> Self
1066 where
1067 T: std::convert::Into<crate::model::OAuthConfig>,
1068 {
1069 self.oauth_config = v.map(|x| x.into());
1070 self
1071 }
1072 }
1073
1074 impl wkt::message::Message for EndUserAuthConfig {
1075 fn typename() -> &'static str {
1076 "type.googleapis.com/google.cloud.dataform.v1.Repository.EndUserAuthConfig"
1077 }
1078 }
1079}
1080
1081/// OAuth configuration for end user authentication.
1082#[derive(Clone, Default, PartialEq)]
1083#[non_exhaustive]
1084pub struct OAuthConfig {
1085 /// Optional. Additional OAuth scopes to use for BigQuery executions.
1086 /// Scopes always in use:
1087 /// `<https://www.googleapis.com/auth/bigquery>`
1088 pub additional_oauth_scopes: std::vec::Vec<std::string::String>,
1089
1090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1091}
1092
1093impl OAuthConfig {
1094 /// Creates a new default instance.
1095 pub fn new() -> Self {
1096 std::default::Default::default()
1097 }
1098
1099 /// Sets the value of [additional_oauth_scopes][crate::model::OAuthConfig::additional_oauth_scopes].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_dataform_v1::model::OAuthConfig;
1104 /// let x = OAuthConfig::new().set_additional_oauth_scopes(["a", "b", "c"]);
1105 /// ```
1106 pub fn set_additional_oauth_scopes<T, V>(mut self, v: T) -> Self
1107 where
1108 T: std::iter::IntoIterator<Item = V>,
1109 V: std::convert::Into<std::string::String>,
1110 {
1111 use std::iter::Iterator;
1112 self.additional_oauth_scopes = v.into_iter().map(|i| i.into()).collect();
1113 self
1114 }
1115}
1116
1117impl wkt::message::Message for OAuthConfig {
1118 fn typename() -> &'static str {
1119 "type.googleapis.com/google.cloud.dataform.v1.OAuthConfig"
1120 }
1121}
1122
1123/// Metadata used to identify if a resource is user scoped.
1124#[derive(Clone, Default, PartialEq)]
1125#[non_exhaustive]
1126pub struct PrivateResourceMetadata {
1127 /// Output only. If true, this resource is user-scoped, meaning it is either a
1128 /// workspace or sourced from a workspace.
1129 pub user_scoped: bool,
1130
1131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1132}
1133
1134impl PrivateResourceMetadata {
1135 /// Creates a new default instance.
1136 pub fn new() -> Self {
1137 std::default::Default::default()
1138 }
1139
1140 /// Sets the value of [user_scoped][crate::model::PrivateResourceMetadata::user_scoped].
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_dataform_v1::model::PrivateResourceMetadata;
1145 /// let x = PrivateResourceMetadata::new().set_user_scoped(true);
1146 /// ```
1147 pub fn set_user_scoped<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1148 self.user_scoped = v.into();
1149 self
1150 }
1151}
1152
1153impl wkt::message::Message for PrivateResourceMetadata {
1154 fn typename() -> &'static str {
1155 "type.googleapis.com/google.cloud.dataform.v1.PrivateResourceMetadata"
1156 }
1157}
1158
1159/// `ListRepositories` request message.
1160#[derive(Clone, Default, PartialEq)]
1161#[non_exhaustive]
1162pub struct ListRepositoriesRequest {
1163 /// Required. The location in which to list repositories. Must be in the format
1164 /// `projects/*/locations/*`.
1165 pub parent: std::string::String,
1166
1167 /// Optional. Maximum number of repositories to return. The server may return
1168 /// fewer items than requested. If unspecified, the server will pick an
1169 /// appropriate default.
1170 pub page_size: i32,
1171
1172 /// Optional. Page token received from a previous `ListRepositories` call.
1173 /// Provide this to retrieve the subsequent page.
1174 ///
1175 /// When paginating, all other parameters provided to `ListRepositories`,
1176 /// with the exception of `page_size`, must match the call that provided the
1177 /// page token.
1178 pub page_token: std::string::String,
1179
1180 /// Optional. This field only supports ordering by `name`. If unspecified, the
1181 /// server will choose the ordering. If specified, the default order is
1182 /// ascending for the `name` field.
1183 pub order_by: std::string::String,
1184
1185 /// Optional. Filter for the returned list.
1186 pub filter: std::string::String,
1187
1188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1189}
1190
1191impl ListRepositoriesRequest {
1192 /// Creates a new default instance.
1193 pub fn new() -> Self {
1194 std::default::Default::default()
1195 }
1196
1197 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
1198 ///
1199 /// # Example
1200 /// ```ignore,no_run
1201 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1202 /// let x = ListRepositoriesRequest::new().set_parent("example");
1203 /// ```
1204 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1205 self.parent = v.into();
1206 self
1207 }
1208
1209 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
1210 ///
1211 /// # Example
1212 /// ```ignore,no_run
1213 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1214 /// let x = ListRepositoriesRequest::new().set_page_size(42);
1215 /// ```
1216 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1217 self.page_size = v.into();
1218 self
1219 }
1220
1221 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
1222 ///
1223 /// # Example
1224 /// ```ignore,no_run
1225 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1226 /// let x = ListRepositoriesRequest::new().set_page_token("example");
1227 /// ```
1228 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1229 self.page_token = v.into();
1230 self
1231 }
1232
1233 /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
1234 ///
1235 /// # Example
1236 /// ```ignore,no_run
1237 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1238 /// let x = ListRepositoriesRequest::new().set_order_by("example");
1239 /// ```
1240 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1241 self.order_by = v.into();
1242 self
1243 }
1244
1245 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
1246 ///
1247 /// # Example
1248 /// ```ignore,no_run
1249 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1250 /// let x = ListRepositoriesRequest::new().set_filter("example");
1251 /// ```
1252 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1253 self.filter = v.into();
1254 self
1255 }
1256}
1257
1258impl wkt::message::Message for ListRepositoriesRequest {
1259 fn typename() -> &'static str {
1260 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesRequest"
1261 }
1262}
1263
1264/// `ListRepositories` response message.
1265#[derive(Clone, Default, PartialEq)]
1266#[non_exhaustive]
1267pub struct ListRepositoriesResponse {
1268 /// List of repositories.
1269 pub repositories: std::vec::Vec<crate::model::Repository>,
1270
1271 /// A token which can be sent as `page_token` to retrieve the next page.
1272 /// If this field is omitted, there are no subsequent pages.
1273 pub next_page_token: std::string::String,
1274
1275 /// Locations which could not be reached.
1276 pub unreachable: std::vec::Vec<std::string::String>,
1277
1278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1279}
1280
1281impl ListRepositoriesResponse {
1282 /// Creates a new default instance.
1283 pub fn new() -> Self {
1284 std::default::Default::default()
1285 }
1286
1287 /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
1288 ///
1289 /// # Example
1290 /// ```ignore,no_run
1291 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1292 /// use google_cloud_dataform_v1::model::Repository;
1293 /// let x = ListRepositoriesResponse::new()
1294 /// .set_repositories([
1295 /// Repository::default()/* use setters */,
1296 /// Repository::default()/* use (different) setters */,
1297 /// ]);
1298 /// ```
1299 pub fn set_repositories<T, V>(mut self, v: T) -> Self
1300 where
1301 T: std::iter::IntoIterator<Item = V>,
1302 V: std::convert::Into<crate::model::Repository>,
1303 {
1304 use std::iter::Iterator;
1305 self.repositories = v.into_iter().map(|i| i.into()).collect();
1306 self
1307 }
1308
1309 /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
1310 ///
1311 /// # Example
1312 /// ```ignore,no_run
1313 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1314 /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
1315 /// ```
1316 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1317 self.next_page_token = v.into();
1318 self
1319 }
1320
1321 /// Sets the value of [unreachable][crate::model::ListRepositoriesResponse::unreachable].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1326 /// let x = ListRepositoriesResponse::new().set_unreachable(["a", "b", "c"]);
1327 /// ```
1328 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1329 where
1330 T: std::iter::IntoIterator<Item = V>,
1331 V: std::convert::Into<std::string::String>,
1332 {
1333 use std::iter::Iterator;
1334 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1335 self
1336 }
1337}
1338
1339impl wkt::message::Message for ListRepositoriesResponse {
1340 fn typename() -> &'static str {
1341 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesResponse"
1342 }
1343}
1344
1345#[doc(hidden)]
1346impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
1347 type PageItem = crate::model::Repository;
1348
1349 fn items(self) -> std::vec::Vec<Self::PageItem> {
1350 self.repositories
1351 }
1352
1353 fn next_page_token(&self) -> std::string::String {
1354 use std::clone::Clone;
1355 self.next_page_token.clone()
1356 }
1357}
1358
1359/// `MoveRepository` request message.
1360#[derive(Clone, Default, PartialEq)]
1361#[non_exhaustive]
1362pub struct MoveRepositoryRequest {
1363 /// Required. The full resource name of the repository to move.
1364 pub name: std::string::String,
1365
1366 /// Optional. The name of the Folder, TeamFolder, or root location to move the
1367 /// repository to. Can be in the format of: "" to move into the root User
1368 /// folder, `projects/*/locations/*/folders/*`,
1369 /// `projects/*/locations/*/teamFolders/*`
1370 pub destination_containing_folder: std::option::Option<std::string::String>,
1371
1372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1373}
1374
1375impl MoveRepositoryRequest {
1376 /// Creates a new default instance.
1377 pub fn new() -> Self {
1378 std::default::Default::default()
1379 }
1380
1381 /// Sets the value of [name][crate::model::MoveRepositoryRequest::name].
1382 ///
1383 /// # Example
1384 /// ```ignore,no_run
1385 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1386 /// # let project_id = "project_id";
1387 /// # let location_id = "location_id";
1388 /// # let repository_id = "repository_id";
1389 /// let x = MoveRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1390 /// ```
1391 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1392 self.name = v.into();
1393 self
1394 }
1395
1396 /// Sets the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1397 ///
1398 /// # Example
1399 /// ```ignore,no_run
1400 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1401 /// let x = MoveRepositoryRequest::new().set_destination_containing_folder("example");
1402 /// ```
1403 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
1404 where
1405 T: std::convert::Into<std::string::String>,
1406 {
1407 self.destination_containing_folder = std::option::Option::Some(v.into());
1408 self
1409 }
1410
1411 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1412 ///
1413 /// # Example
1414 /// ```ignore,no_run
1415 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1416 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(Some("example"));
1417 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(None::<String>);
1418 /// ```
1419 pub fn set_or_clear_destination_containing_folder<T>(
1420 mut self,
1421 v: std::option::Option<T>,
1422 ) -> Self
1423 where
1424 T: std::convert::Into<std::string::String>,
1425 {
1426 self.destination_containing_folder = v.map(|x| x.into());
1427 self
1428 }
1429}
1430
1431impl wkt::message::Message for MoveRepositoryRequest {
1432 fn typename() -> &'static str {
1433 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryRequest"
1434 }
1435}
1436
1437/// `GetRepository` request message.
1438#[derive(Clone, Default, PartialEq)]
1439#[non_exhaustive]
1440pub struct GetRepositoryRequest {
1441 /// Required. The repository's name.
1442 pub name: std::string::String,
1443
1444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1445}
1446
1447impl GetRepositoryRequest {
1448 /// Creates a new default instance.
1449 pub fn new() -> Self {
1450 std::default::Default::default()
1451 }
1452
1453 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_dataform_v1::model::GetRepositoryRequest;
1458 /// # let project_id = "project_id";
1459 /// # let location_id = "location_id";
1460 /// # let repository_id = "repository_id";
1461 /// let x = GetRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1462 /// ```
1463 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1464 self.name = v.into();
1465 self
1466 }
1467}
1468
1469impl wkt::message::Message for GetRepositoryRequest {
1470 fn typename() -> &'static str {
1471 "type.googleapis.com/google.cloud.dataform.v1.GetRepositoryRequest"
1472 }
1473}
1474
1475/// `CreateRepository` request message.
1476#[derive(Clone, Default, PartialEq)]
1477#[non_exhaustive]
1478pub struct CreateRepositoryRequest {
1479 /// Required. The location in which to create the repository. Must be in the
1480 /// format `projects/*/locations/*`.
1481 pub parent: std::string::String,
1482
1483 /// Required. The repository to create.
1484 pub repository: std::option::Option<crate::model::Repository>,
1485
1486 /// Required. The ID to use for the repository, which will become the final
1487 /// component of the repository's resource name.
1488 pub repository_id: std::string::String,
1489
1490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1491}
1492
1493impl CreateRepositoryRequest {
1494 /// Creates a new default instance.
1495 pub fn new() -> Self {
1496 std::default::Default::default()
1497 }
1498
1499 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
1500 ///
1501 /// # Example
1502 /// ```ignore,no_run
1503 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1504 /// let x = CreateRepositoryRequest::new().set_parent("example");
1505 /// ```
1506 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.parent = v.into();
1508 self
1509 }
1510
1511 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
1512 ///
1513 /// # Example
1514 /// ```ignore,no_run
1515 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1516 /// use google_cloud_dataform_v1::model::Repository;
1517 /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1518 /// ```
1519 pub fn set_repository<T>(mut self, v: T) -> Self
1520 where
1521 T: std::convert::Into<crate::model::Repository>,
1522 {
1523 self.repository = std::option::Option::Some(v.into());
1524 self
1525 }
1526
1527 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
1528 ///
1529 /// # Example
1530 /// ```ignore,no_run
1531 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1532 /// use google_cloud_dataform_v1::model::Repository;
1533 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1534 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1535 /// ```
1536 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1537 where
1538 T: std::convert::Into<crate::model::Repository>,
1539 {
1540 self.repository = v.map(|x| x.into());
1541 self
1542 }
1543
1544 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
1545 ///
1546 /// # Example
1547 /// ```ignore,no_run
1548 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1549 /// let x = CreateRepositoryRequest::new().set_repository_id("example");
1550 /// ```
1551 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1552 self.repository_id = v.into();
1553 self
1554 }
1555}
1556
1557impl wkt::message::Message for CreateRepositoryRequest {
1558 fn typename() -> &'static str {
1559 "type.googleapis.com/google.cloud.dataform.v1.CreateRepositoryRequest"
1560 }
1561}
1562
1563/// `UpdateRepository` request message.
1564#[derive(Clone, Default, PartialEq)]
1565#[non_exhaustive]
1566pub struct UpdateRepositoryRequest {
1567 /// Optional. Specifies the fields to be updated in the repository. If left
1568 /// unset, all fields will be updated.
1569 pub update_mask: std::option::Option<wkt::FieldMask>,
1570
1571 /// Required. The repository to update.
1572 pub repository: std::option::Option<crate::model::Repository>,
1573
1574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1575}
1576
1577impl UpdateRepositoryRequest {
1578 /// Creates a new default instance.
1579 pub fn new() -> Self {
1580 std::default::Default::default()
1581 }
1582
1583 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1584 ///
1585 /// # Example
1586 /// ```ignore,no_run
1587 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1588 /// use wkt::FieldMask;
1589 /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1590 /// ```
1591 pub fn set_update_mask<T>(mut self, v: T) -> Self
1592 where
1593 T: std::convert::Into<wkt::FieldMask>,
1594 {
1595 self.update_mask = std::option::Option::Some(v.into());
1596 self
1597 }
1598
1599 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1604 /// use wkt::FieldMask;
1605 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1606 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1607 /// ```
1608 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1609 where
1610 T: std::convert::Into<wkt::FieldMask>,
1611 {
1612 self.update_mask = v.map(|x| x.into());
1613 self
1614 }
1615
1616 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1617 ///
1618 /// # Example
1619 /// ```ignore,no_run
1620 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1621 /// use google_cloud_dataform_v1::model::Repository;
1622 /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1623 /// ```
1624 pub fn set_repository<T>(mut self, v: T) -> Self
1625 where
1626 T: std::convert::Into<crate::model::Repository>,
1627 {
1628 self.repository = std::option::Option::Some(v.into());
1629 self
1630 }
1631
1632 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1633 ///
1634 /// # Example
1635 /// ```ignore,no_run
1636 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1637 /// use google_cloud_dataform_v1::model::Repository;
1638 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1639 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1640 /// ```
1641 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1642 where
1643 T: std::convert::Into<crate::model::Repository>,
1644 {
1645 self.repository = v.map(|x| x.into());
1646 self
1647 }
1648}
1649
1650impl wkt::message::Message for UpdateRepositoryRequest {
1651 fn typename() -> &'static str {
1652 "type.googleapis.com/google.cloud.dataform.v1.UpdateRepositoryRequest"
1653 }
1654}
1655
1656/// `DeleteRepository` request message.
1657#[derive(Clone, Default, PartialEq)]
1658#[non_exhaustive]
1659pub struct DeleteRepositoryRequest {
1660 /// Required. The repository's name.
1661 pub name: std::string::String,
1662
1663 /// Optional. If set to true, child resources of this repository (compilation
1664 /// results and workflow invocations) will also be deleted. Otherwise, the
1665 /// request will only succeed if the repository has no child resources.
1666 ///
1667 /// **Note:** *This flag doesn't support deletion of workspaces, release
1668 /// configs or workflow configs. If any of such resources exists in the
1669 /// repository, the request will fail.*.
1670 pub force: bool,
1671
1672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1673}
1674
1675impl DeleteRepositoryRequest {
1676 /// Creates a new default instance.
1677 pub fn new() -> Self {
1678 std::default::Default::default()
1679 }
1680
1681 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1682 ///
1683 /// # Example
1684 /// ```ignore,no_run
1685 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1686 /// # let project_id = "project_id";
1687 /// # let location_id = "location_id";
1688 /// # let repository_id = "repository_id";
1689 /// let x = DeleteRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1690 /// ```
1691 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1692 self.name = v.into();
1693 self
1694 }
1695
1696 /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
1697 ///
1698 /// # Example
1699 /// ```ignore,no_run
1700 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1701 /// let x = DeleteRepositoryRequest::new().set_force(true);
1702 /// ```
1703 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1704 self.force = v.into();
1705 self
1706 }
1707}
1708
1709impl wkt::message::Message for DeleteRepositoryRequest {
1710 fn typename() -> &'static str {
1711 "type.googleapis.com/google.cloud.dataform.v1.DeleteRepositoryRequest"
1712 }
1713}
1714
1715/// `CommitRepositoryChanges` request message.
1716#[derive(Clone, Default, PartialEq)]
1717#[non_exhaustive]
1718pub struct CommitRepositoryChangesRequest {
1719 /// Required. The repository's name.
1720 pub name: std::string::String,
1721
1722 /// Required. The changes to commit to the repository.
1723 pub commit_metadata: std::option::Option<crate::model::CommitMetadata>,
1724
1725 /// Optional. The commit SHA which must be the repository's current HEAD before
1726 /// applying this commit; otherwise this request will fail. If unset, no
1727 /// validation on the current HEAD commit SHA is performed.
1728 pub required_head_commit_sha: std::string::String,
1729
1730 /// Optional. A map to the path of the file to the operation. The path is the
1731 /// full file path including filename, from repository root.
1732 pub file_operations: std::collections::HashMap<
1733 std::string::String,
1734 crate::model::commit_repository_changes_request::FileOperation,
1735 >,
1736
1737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1738}
1739
1740impl CommitRepositoryChangesRequest {
1741 /// Creates a new default instance.
1742 pub fn new() -> Self {
1743 std::default::Default::default()
1744 }
1745
1746 /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
1747 ///
1748 /// # Example
1749 /// ```ignore,no_run
1750 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1751 /// # let project_id = "project_id";
1752 /// # let location_id = "location_id";
1753 /// # let repository_id = "repository_id";
1754 /// let x = CommitRepositoryChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1755 /// ```
1756 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.name = v.into();
1758 self
1759 }
1760
1761 /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1762 ///
1763 /// # Example
1764 /// ```ignore,no_run
1765 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1766 /// use google_cloud_dataform_v1::model::CommitMetadata;
1767 /// let x = CommitRepositoryChangesRequest::new().set_commit_metadata(CommitMetadata::default()/* use setters */);
1768 /// ```
1769 pub fn set_commit_metadata<T>(mut self, v: T) -> Self
1770 where
1771 T: std::convert::Into<crate::model::CommitMetadata>,
1772 {
1773 self.commit_metadata = std::option::Option::Some(v.into());
1774 self
1775 }
1776
1777 /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1778 ///
1779 /// # Example
1780 /// ```ignore,no_run
1781 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1782 /// use google_cloud_dataform_v1::model::CommitMetadata;
1783 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(Some(CommitMetadata::default()/* use setters */));
1784 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(None::<CommitMetadata>);
1785 /// ```
1786 pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1787 where
1788 T: std::convert::Into<crate::model::CommitMetadata>,
1789 {
1790 self.commit_metadata = v.map(|x| x.into());
1791 self
1792 }
1793
1794 /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
1795 ///
1796 /// # Example
1797 /// ```ignore,no_run
1798 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1799 /// let x = CommitRepositoryChangesRequest::new().set_required_head_commit_sha("example");
1800 /// ```
1801 pub fn set_required_head_commit_sha<T: std::convert::Into<std::string::String>>(
1802 mut self,
1803 v: T,
1804 ) -> Self {
1805 self.required_head_commit_sha = v.into();
1806 self
1807 }
1808
1809 /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
1810 ///
1811 /// # Example
1812 /// ```ignore,no_run
1813 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1814 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1815 /// let x = CommitRepositoryChangesRequest::new().set_file_operations([
1816 /// ("key0", FileOperation::default()/* use setters */),
1817 /// ("key1", FileOperation::default()/* use (different) setters */),
1818 /// ]);
1819 /// ```
1820 pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
1821 where
1822 T: std::iter::IntoIterator<Item = (K, V)>,
1823 K: std::convert::Into<std::string::String>,
1824 V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
1825 {
1826 use std::iter::Iterator;
1827 self.file_operations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1828 self
1829 }
1830}
1831
1832impl wkt::message::Message for CommitRepositoryChangesRequest {
1833 fn typename() -> &'static str {
1834 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest"
1835 }
1836}
1837
1838/// Defines additional types related to [CommitRepositoryChangesRequest].
1839pub mod commit_repository_changes_request {
1840 #[allow(unused_imports)]
1841 use super::*;
1842
1843 /// Represents a single file operation to the repository.
1844 #[derive(Clone, Default, PartialEq)]
1845 #[non_exhaustive]
1846 pub struct FileOperation {
1847 /// The operation to perform on the file.
1848 pub operation: std::option::Option<
1849 crate::model::commit_repository_changes_request::file_operation::Operation,
1850 >,
1851
1852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1853 }
1854
1855 impl FileOperation {
1856 /// Creates a new default instance.
1857 pub fn new() -> Self {
1858 std::default::Default::default()
1859 }
1860
1861 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation].
1862 ///
1863 /// Note that all the setters affecting `operation` are mutually
1864 /// exclusive.
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1869 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1870 /// let x = FileOperation::new().set_operation(Some(
1871 /// google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::Operation::WriteFile(WriteFile::default().into())));
1872 /// ```
1873 pub fn set_operation<
1874 T: std::convert::Into<
1875 std::option::Option<
1876 crate::model::commit_repository_changes_request::file_operation::Operation,
1877 >,
1878 >,
1879 >(
1880 mut self,
1881 v: T,
1882 ) -> Self {
1883 self.operation = v.into();
1884 self
1885 }
1886
1887 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1888 /// if it holds a `WriteFile`, `None` if the field is not set or
1889 /// holds a different branch.
1890 pub fn write_file(
1891 &self,
1892 ) -> std::option::Option<
1893 &std::boxed::Box<
1894 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1895 >,
1896 > {
1897 #[allow(unreachable_patterns)]
1898 self.operation.as_ref().and_then(|v| match v {
1899 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(v) => std::option::Option::Some(v),
1900 _ => std::option::Option::None,
1901 })
1902 }
1903
1904 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1905 /// to hold a `WriteFile`.
1906 ///
1907 /// Note that all the setters affecting `operation` are
1908 /// mutually exclusive.
1909 ///
1910 /// # Example
1911 /// ```ignore,no_run
1912 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1913 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1914 /// let x = FileOperation::new().set_write_file(WriteFile::default()/* use setters */);
1915 /// assert!(x.write_file().is_some());
1916 /// assert!(x.delete_file().is_none());
1917 /// ```
1918 pub fn set_write_file<
1919 T: std::convert::Into<
1920 std::boxed::Box<
1921 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1922 >,
1923 >,
1924 >(
1925 mut self,
1926 v: T,
1927 ) -> Self {
1928 self.operation = std::option::Option::Some(
1929 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(
1930 v.into()
1931 )
1932 );
1933 self
1934 }
1935
1936 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1937 /// if it holds a `DeleteFile`, `None` if the field is not set or
1938 /// holds a different branch.
1939 pub fn delete_file(
1940 &self,
1941 ) -> std::option::Option<
1942 &std::boxed::Box<
1943 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1944 >,
1945 > {
1946 #[allow(unreachable_patterns)]
1947 self.operation.as_ref().and_then(|v| match v {
1948 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(v) => std::option::Option::Some(v),
1949 _ => std::option::Option::None,
1950 })
1951 }
1952
1953 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1954 /// to hold a `DeleteFile`.
1955 ///
1956 /// Note that all the setters affecting `operation` are
1957 /// mutually exclusive.
1958 ///
1959 /// # Example
1960 /// ```ignore,no_run
1961 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1962 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::DeleteFile;
1963 /// let x = FileOperation::new().set_delete_file(DeleteFile::default()/* use setters */);
1964 /// assert!(x.delete_file().is_some());
1965 /// assert!(x.write_file().is_none());
1966 /// ```
1967 pub fn set_delete_file<
1968 T: std::convert::Into<
1969 std::boxed::Box<
1970 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1971 >,
1972 >,
1973 >(
1974 mut self,
1975 v: T,
1976 ) -> Self {
1977 self.operation = std::option::Option::Some(
1978 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(
1979 v.into()
1980 )
1981 );
1982 self
1983 }
1984 }
1985
1986 impl wkt::message::Message for FileOperation {
1987 fn typename() -> &'static str {
1988 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation"
1989 }
1990 }
1991
1992 /// Defines additional types related to [FileOperation].
1993 pub mod file_operation {
1994 #[allow(unused_imports)]
1995 use super::*;
1996
1997 /// Represents the write file operation (for files added or modified).
1998 #[derive(Clone, Default, PartialEq)]
1999 #[non_exhaustive]
2000 pub struct WriteFile {
2001 /// The file's contents.
2002 pub contents: ::bytes::Bytes,
2003
2004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2005 }
2006
2007 impl WriteFile {
2008 /// Creates a new default instance.
2009 pub fn new() -> Self {
2010 std::default::Default::default()
2011 }
2012
2013 /// Sets the value of [contents][crate::model::commit_repository_changes_request::file_operation::WriteFile::contents].
2014 ///
2015 /// # Example
2016 /// ```ignore,no_run
2017 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
2018 /// let x = WriteFile::new().set_contents(bytes::Bytes::from_static(b"example"));
2019 /// ```
2020 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2021 self.contents = v.into();
2022 self
2023 }
2024 }
2025
2026 impl wkt::message::Message for WriteFile {
2027 fn typename() -> &'static str {
2028 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.WriteFile"
2029 }
2030 }
2031
2032 /// Represents the delete file operation.
2033 #[derive(Clone, Default, PartialEq)]
2034 #[non_exhaustive]
2035 pub struct DeleteFile {
2036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2037 }
2038
2039 impl DeleteFile {
2040 /// Creates a new default instance.
2041 pub fn new() -> Self {
2042 std::default::Default::default()
2043 }
2044 }
2045
2046 impl wkt::message::Message for DeleteFile {
2047 fn typename() -> &'static str {
2048 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.DeleteFile"
2049 }
2050 }
2051
2052 /// The operation to perform on the file.
2053 #[derive(Clone, Debug, PartialEq)]
2054 #[non_exhaustive]
2055 pub enum Operation {
2056 /// Represents the write operation.
2057 WriteFile(
2058 std::boxed::Box<
2059 crate::model::commit_repository_changes_request::file_operation::WriteFile,
2060 >,
2061 ),
2062 /// Represents the delete operation.
2063 DeleteFile(
2064 std::boxed::Box<
2065 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
2066 >,
2067 ),
2068 }
2069 }
2070}
2071
2072/// `CommitRepositoryChanges` response message.
2073#[derive(Clone, Default, PartialEq)]
2074#[non_exhaustive]
2075pub struct CommitRepositoryChangesResponse {
2076 /// The commit SHA of the current commit.
2077 pub commit_sha: std::string::String,
2078
2079 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2080}
2081
2082impl CommitRepositoryChangesResponse {
2083 /// Creates a new default instance.
2084 pub fn new() -> Self {
2085 std::default::Default::default()
2086 }
2087
2088 /// Sets the value of [commit_sha][crate::model::CommitRepositoryChangesResponse::commit_sha].
2089 ///
2090 /// # Example
2091 /// ```ignore,no_run
2092 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesResponse;
2093 /// let x = CommitRepositoryChangesResponse::new().set_commit_sha("example");
2094 /// ```
2095 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.commit_sha = v.into();
2097 self
2098 }
2099}
2100
2101impl wkt::message::Message for CommitRepositoryChangesResponse {
2102 fn typename() -> &'static str {
2103 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesResponse"
2104 }
2105}
2106
2107/// `ReadRepositoryFile` request message.
2108#[derive(Clone, Default, PartialEq)]
2109#[non_exhaustive]
2110pub struct ReadRepositoryFileRequest {
2111 /// Required. The repository's name.
2112 pub name: std::string::String,
2113
2114 /// Optional. The commit SHA for the commit to read from. If unset, the file
2115 /// will be read from HEAD.
2116 pub commit_sha: std::string::String,
2117
2118 /// Required. Full file path to read including filename, from repository root.
2119 pub path: std::string::String,
2120
2121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2122}
2123
2124impl ReadRepositoryFileRequest {
2125 /// Creates a new default instance.
2126 pub fn new() -> Self {
2127 std::default::Default::default()
2128 }
2129
2130 /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
2131 ///
2132 /// # Example
2133 /// ```ignore,no_run
2134 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2135 /// # let project_id = "project_id";
2136 /// # let location_id = "location_id";
2137 /// # let repository_id = "repository_id";
2138 /// let x = ReadRepositoryFileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2139 /// ```
2140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2141 self.name = v.into();
2142 self
2143 }
2144
2145 /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
2146 ///
2147 /// # Example
2148 /// ```ignore,no_run
2149 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2150 /// let x = ReadRepositoryFileRequest::new().set_commit_sha("example");
2151 /// ```
2152 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2153 self.commit_sha = v.into();
2154 self
2155 }
2156
2157 /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
2158 ///
2159 /// # Example
2160 /// ```ignore,no_run
2161 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
2162 /// let x = ReadRepositoryFileRequest::new().set_path("example");
2163 /// ```
2164 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.path = v.into();
2166 self
2167 }
2168}
2169
2170impl wkt::message::Message for ReadRepositoryFileRequest {
2171 fn typename() -> &'static str {
2172 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileRequest"
2173 }
2174}
2175
2176/// `ReadRepositoryFile` response message.
2177#[derive(Clone, Default, PartialEq)]
2178#[non_exhaustive]
2179pub struct ReadRepositoryFileResponse {
2180 /// The file's contents.
2181 pub contents: ::bytes::Bytes,
2182
2183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2184}
2185
2186impl ReadRepositoryFileResponse {
2187 /// Creates a new default instance.
2188 pub fn new() -> Self {
2189 std::default::Default::default()
2190 }
2191
2192 /// Sets the value of [contents][crate::model::ReadRepositoryFileResponse::contents].
2193 ///
2194 /// # Example
2195 /// ```ignore,no_run
2196 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileResponse;
2197 /// let x = ReadRepositoryFileResponse::new().set_contents(bytes::Bytes::from_static(b"example"));
2198 /// ```
2199 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2200 self.contents = v.into();
2201 self
2202 }
2203}
2204
2205impl wkt::message::Message for ReadRepositoryFileResponse {
2206 fn typename() -> &'static str {
2207 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileResponse"
2208 }
2209}
2210
2211/// `QueryRepositoryDirectoryContents` request message.
2212#[derive(Clone, Default, PartialEq)]
2213#[non_exhaustive]
2214pub struct QueryRepositoryDirectoryContentsRequest {
2215 /// Required. The repository's name.
2216 pub name: std::string::String,
2217
2218 /// Optional. The Commit SHA for the commit to query from. If unset, the
2219 /// directory will be queried from HEAD.
2220 pub commit_sha: std::string::String,
2221
2222 /// Optional. The directory's full path including directory name, relative to
2223 /// root. If left unset, the root is used.
2224 pub path: std::string::String,
2225
2226 /// Optional. Maximum number of paths to return. The server may return fewer
2227 /// items than requested. If unspecified, the server will pick an appropriate
2228 /// default.
2229 pub page_size: i32,
2230
2231 /// Optional. Page token received from a previous
2232 /// `QueryRepositoryDirectoryContents` call. Provide this to retrieve the
2233 /// subsequent page.
2234 ///
2235 /// When paginating, all other parameters provided to
2236 /// `QueryRepositoryDirectoryContents`, with the exception of `page_size`, must
2237 /// match the call that provided the page token.
2238 pub page_token: std::string::String,
2239
2240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2241}
2242
2243impl QueryRepositoryDirectoryContentsRequest {
2244 /// Creates a new default instance.
2245 pub fn new() -> Self {
2246 std::default::Default::default()
2247 }
2248
2249 /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
2250 ///
2251 /// # Example
2252 /// ```ignore,no_run
2253 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2254 /// # let project_id = "project_id";
2255 /// # let location_id = "location_id";
2256 /// # let repository_id = "repository_id";
2257 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2258 /// ```
2259 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2260 self.name = v.into();
2261 self
2262 }
2263
2264 /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
2265 ///
2266 /// # Example
2267 /// ```ignore,no_run
2268 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2269 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_commit_sha("example");
2270 /// ```
2271 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2272 self.commit_sha = v.into();
2273 self
2274 }
2275
2276 /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
2277 ///
2278 /// # Example
2279 /// ```ignore,no_run
2280 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2281 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_path("example");
2282 /// ```
2283 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2284 self.path = v.into();
2285 self
2286 }
2287
2288 /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
2289 ///
2290 /// # Example
2291 /// ```ignore,no_run
2292 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2293 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_size(42);
2294 /// ```
2295 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2296 self.page_size = v.into();
2297 self
2298 }
2299
2300 /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
2301 ///
2302 /// # Example
2303 /// ```ignore,no_run
2304 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2305 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_token("example");
2306 /// ```
2307 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2308 self.page_token = v.into();
2309 self
2310 }
2311}
2312
2313impl wkt::message::Message for QueryRepositoryDirectoryContentsRequest {
2314 fn typename() -> &'static str {
2315 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest"
2316 }
2317}
2318
2319/// `QueryRepositoryDirectoryContents` response message.
2320#[derive(Clone, Default, PartialEq)]
2321#[non_exhaustive]
2322pub struct QueryRepositoryDirectoryContentsResponse {
2323 /// List of entries in the directory.
2324 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
2325
2326 /// A token, which can be sent as `page_token` to retrieve the next page.
2327 /// If this field is omitted, there are no subsequent pages.
2328 pub next_page_token: std::string::String,
2329
2330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2331}
2332
2333impl QueryRepositoryDirectoryContentsResponse {
2334 /// Creates a new default instance.
2335 pub fn new() -> Self {
2336 std::default::Default::default()
2337 }
2338
2339 /// Sets the value of [directory_entries][crate::model::QueryRepositoryDirectoryContentsResponse::directory_entries].
2340 ///
2341 /// # Example
2342 /// ```ignore,no_run
2343 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2344 /// use google_cloud_dataform_v1::model::DirectoryEntry;
2345 /// let x = QueryRepositoryDirectoryContentsResponse::new()
2346 /// .set_directory_entries([
2347 /// DirectoryEntry::default()/* use setters */,
2348 /// DirectoryEntry::default()/* use (different) setters */,
2349 /// ]);
2350 /// ```
2351 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
2352 where
2353 T: std::iter::IntoIterator<Item = V>,
2354 V: std::convert::Into<crate::model::DirectoryEntry>,
2355 {
2356 use std::iter::Iterator;
2357 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
2358 self
2359 }
2360
2361 /// Sets the value of [next_page_token][crate::model::QueryRepositoryDirectoryContentsResponse::next_page_token].
2362 ///
2363 /// # Example
2364 /// ```ignore,no_run
2365 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2366 /// let x = QueryRepositoryDirectoryContentsResponse::new().set_next_page_token("example");
2367 /// ```
2368 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2369 self.next_page_token = v.into();
2370 self
2371 }
2372}
2373
2374impl wkt::message::Message for QueryRepositoryDirectoryContentsResponse {
2375 fn typename() -> &'static str {
2376 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsResponse"
2377 }
2378}
2379
2380#[doc(hidden)]
2381impl google_cloud_gax::paginator::internal::PageableResponse
2382 for QueryRepositoryDirectoryContentsResponse
2383{
2384 type PageItem = crate::model::DirectoryEntry;
2385
2386 fn items(self) -> std::vec::Vec<Self::PageItem> {
2387 self.directory_entries
2388 }
2389
2390 fn next_page_token(&self) -> std::string::String {
2391 use std::clone::Clone;
2392 self.next_page_token.clone()
2393 }
2394}
2395
2396/// `FetchRepositoryHistory` request message.
2397#[derive(Clone, Default, PartialEq)]
2398#[non_exhaustive]
2399pub struct FetchRepositoryHistoryRequest {
2400 /// Required. The repository's name.
2401 pub name: std::string::String,
2402
2403 /// Optional. Maximum number of commits to return. The server may return fewer
2404 /// items than requested. If unspecified, the server will pick an appropriate
2405 /// default.
2406 pub page_size: i32,
2407
2408 /// Optional. Page token received from a previous `FetchRepositoryHistory`
2409 /// call. Provide this to retrieve the subsequent page.
2410 ///
2411 /// When paginating, all other parameters provided to `FetchRepositoryHistory`,
2412 /// with the exception of `page_size`, must match the call that provided the
2413 /// page token.
2414 pub page_token: std::string::String,
2415
2416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2417}
2418
2419impl FetchRepositoryHistoryRequest {
2420 /// Creates a new default instance.
2421 pub fn new() -> Self {
2422 std::default::Default::default()
2423 }
2424
2425 /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
2426 ///
2427 /// # Example
2428 /// ```ignore,no_run
2429 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2430 /// # let project_id = "project_id";
2431 /// # let location_id = "location_id";
2432 /// # let repository_id = "repository_id";
2433 /// let x = FetchRepositoryHistoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2434 /// ```
2435 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2436 self.name = v.into();
2437 self
2438 }
2439
2440 /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
2441 ///
2442 /// # Example
2443 /// ```ignore,no_run
2444 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2445 /// let x = FetchRepositoryHistoryRequest::new().set_page_size(42);
2446 /// ```
2447 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2448 self.page_size = v.into();
2449 self
2450 }
2451
2452 /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
2453 ///
2454 /// # Example
2455 /// ```ignore,no_run
2456 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2457 /// let x = FetchRepositoryHistoryRequest::new().set_page_token("example");
2458 /// ```
2459 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2460 self.page_token = v.into();
2461 self
2462 }
2463}
2464
2465impl wkt::message::Message for FetchRepositoryHistoryRequest {
2466 fn typename() -> &'static str {
2467 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryRequest"
2468 }
2469}
2470
2471/// `FetchRepositoryHistory` response message.
2472#[derive(Clone, Default, PartialEq)]
2473#[non_exhaustive]
2474pub struct FetchRepositoryHistoryResponse {
2475 /// A list of commit logs, ordered by 'git log' default order.
2476 pub commits: std::vec::Vec<crate::model::CommitLogEntry>,
2477
2478 /// A token, which can be sent as `page_token` to retrieve the next page.
2479 /// If this field is omitted, there are no subsequent pages.
2480 pub next_page_token: std::string::String,
2481
2482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2483}
2484
2485impl FetchRepositoryHistoryResponse {
2486 /// Creates a new default instance.
2487 pub fn new() -> Self {
2488 std::default::Default::default()
2489 }
2490
2491 /// Sets the value of [commits][crate::model::FetchRepositoryHistoryResponse::commits].
2492 ///
2493 /// # Example
2494 /// ```ignore,no_run
2495 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2496 /// use google_cloud_dataform_v1::model::CommitLogEntry;
2497 /// let x = FetchRepositoryHistoryResponse::new()
2498 /// .set_commits([
2499 /// CommitLogEntry::default()/* use setters */,
2500 /// CommitLogEntry::default()/* use (different) setters */,
2501 /// ]);
2502 /// ```
2503 pub fn set_commits<T, V>(mut self, v: T) -> Self
2504 where
2505 T: std::iter::IntoIterator<Item = V>,
2506 V: std::convert::Into<crate::model::CommitLogEntry>,
2507 {
2508 use std::iter::Iterator;
2509 self.commits = v.into_iter().map(|i| i.into()).collect();
2510 self
2511 }
2512
2513 /// Sets the value of [next_page_token][crate::model::FetchRepositoryHistoryResponse::next_page_token].
2514 ///
2515 /// # Example
2516 /// ```ignore,no_run
2517 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2518 /// let x = FetchRepositoryHistoryResponse::new().set_next_page_token("example");
2519 /// ```
2520 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.next_page_token = v.into();
2522 self
2523 }
2524}
2525
2526impl wkt::message::Message for FetchRepositoryHistoryResponse {
2527 fn typename() -> &'static str {
2528 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryResponse"
2529 }
2530}
2531
2532#[doc(hidden)]
2533impl google_cloud_gax::paginator::internal::PageableResponse for FetchRepositoryHistoryResponse {
2534 type PageItem = crate::model::CommitLogEntry;
2535
2536 fn items(self) -> std::vec::Vec<Self::PageItem> {
2537 self.commits
2538 }
2539
2540 fn next_page_token(&self) -> std::string::String {
2541 use std::clone::Clone;
2542 self.next_page_token.clone()
2543 }
2544}
2545
2546/// Represents a single commit log.
2547#[derive(Clone, Default, PartialEq)]
2548#[non_exhaustive]
2549pub struct CommitLogEntry {
2550 /// Commit timestamp.
2551 pub commit_time: std::option::Option<wkt::Timestamp>,
2552
2553 /// The commit SHA for this commit log entry.
2554 pub commit_sha: std::string::String,
2555
2556 /// The commit author for this commit log entry.
2557 pub author: std::option::Option<crate::model::CommitAuthor>,
2558
2559 /// The commit message for this commit log entry.
2560 pub commit_message: std::string::String,
2561
2562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2563}
2564
2565impl CommitLogEntry {
2566 /// Creates a new default instance.
2567 pub fn new() -> Self {
2568 std::default::Default::default()
2569 }
2570
2571 /// Sets the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2572 ///
2573 /// # Example
2574 /// ```ignore,no_run
2575 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2576 /// use wkt::Timestamp;
2577 /// let x = CommitLogEntry::new().set_commit_time(Timestamp::default()/* use setters */);
2578 /// ```
2579 pub fn set_commit_time<T>(mut self, v: T) -> Self
2580 where
2581 T: std::convert::Into<wkt::Timestamp>,
2582 {
2583 self.commit_time = std::option::Option::Some(v.into());
2584 self
2585 }
2586
2587 /// Sets or clears the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2588 ///
2589 /// # Example
2590 /// ```ignore,no_run
2591 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2592 /// use wkt::Timestamp;
2593 /// let x = CommitLogEntry::new().set_or_clear_commit_time(Some(Timestamp::default()/* use setters */));
2594 /// let x = CommitLogEntry::new().set_or_clear_commit_time(None::<Timestamp>);
2595 /// ```
2596 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
2597 where
2598 T: std::convert::Into<wkt::Timestamp>,
2599 {
2600 self.commit_time = v.map(|x| x.into());
2601 self
2602 }
2603
2604 /// Sets the value of [commit_sha][crate::model::CommitLogEntry::commit_sha].
2605 ///
2606 /// # Example
2607 /// ```ignore,no_run
2608 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2609 /// let x = CommitLogEntry::new().set_commit_sha("example");
2610 /// ```
2611 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612 self.commit_sha = v.into();
2613 self
2614 }
2615
2616 /// Sets the value of [author][crate::model::CommitLogEntry::author].
2617 ///
2618 /// # Example
2619 /// ```ignore,no_run
2620 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2621 /// use google_cloud_dataform_v1::model::CommitAuthor;
2622 /// let x = CommitLogEntry::new().set_author(CommitAuthor::default()/* use setters */);
2623 /// ```
2624 pub fn set_author<T>(mut self, v: T) -> Self
2625 where
2626 T: std::convert::Into<crate::model::CommitAuthor>,
2627 {
2628 self.author = std::option::Option::Some(v.into());
2629 self
2630 }
2631
2632 /// Sets or clears the value of [author][crate::model::CommitLogEntry::author].
2633 ///
2634 /// # Example
2635 /// ```ignore,no_run
2636 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2637 /// use google_cloud_dataform_v1::model::CommitAuthor;
2638 /// let x = CommitLogEntry::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2639 /// let x = CommitLogEntry::new().set_or_clear_author(None::<CommitAuthor>);
2640 /// ```
2641 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2642 where
2643 T: std::convert::Into<crate::model::CommitAuthor>,
2644 {
2645 self.author = v.map(|x| x.into());
2646 self
2647 }
2648
2649 /// Sets the value of [commit_message][crate::model::CommitLogEntry::commit_message].
2650 ///
2651 /// # Example
2652 /// ```ignore,no_run
2653 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2654 /// let x = CommitLogEntry::new().set_commit_message("example");
2655 /// ```
2656 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.commit_message = v.into();
2658 self
2659 }
2660}
2661
2662impl wkt::message::Message for CommitLogEntry {
2663 fn typename() -> &'static str {
2664 "type.googleapis.com/google.cloud.dataform.v1.CommitLogEntry"
2665 }
2666}
2667
2668/// Represents a Dataform Git commit.
2669#[derive(Clone, Default, PartialEq)]
2670#[non_exhaustive]
2671pub struct CommitMetadata {
2672 /// Required. The commit's author.
2673 pub author: std::option::Option<crate::model::CommitAuthor>,
2674
2675 /// Optional. The commit's message.
2676 pub commit_message: std::string::String,
2677
2678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2679}
2680
2681impl CommitMetadata {
2682 /// Creates a new default instance.
2683 pub fn new() -> Self {
2684 std::default::Default::default()
2685 }
2686
2687 /// Sets the value of [author][crate::model::CommitMetadata::author].
2688 ///
2689 /// # Example
2690 /// ```ignore,no_run
2691 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2692 /// use google_cloud_dataform_v1::model::CommitAuthor;
2693 /// let x = CommitMetadata::new().set_author(CommitAuthor::default()/* use setters */);
2694 /// ```
2695 pub fn set_author<T>(mut self, v: T) -> Self
2696 where
2697 T: std::convert::Into<crate::model::CommitAuthor>,
2698 {
2699 self.author = std::option::Option::Some(v.into());
2700 self
2701 }
2702
2703 /// Sets or clears the value of [author][crate::model::CommitMetadata::author].
2704 ///
2705 /// # Example
2706 /// ```ignore,no_run
2707 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2708 /// use google_cloud_dataform_v1::model::CommitAuthor;
2709 /// let x = CommitMetadata::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2710 /// let x = CommitMetadata::new().set_or_clear_author(None::<CommitAuthor>);
2711 /// ```
2712 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2713 where
2714 T: std::convert::Into<crate::model::CommitAuthor>,
2715 {
2716 self.author = v.map(|x| x.into());
2717 self
2718 }
2719
2720 /// Sets the value of [commit_message][crate::model::CommitMetadata::commit_message].
2721 ///
2722 /// # Example
2723 /// ```ignore,no_run
2724 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2725 /// let x = CommitMetadata::new().set_commit_message("example");
2726 /// ```
2727 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2728 self.commit_message = v.into();
2729 self
2730 }
2731}
2732
2733impl wkt::message::Message for CommitMetadata {
2734 fn typename() -> &'static str {
2735 "type.googleapis.com/google.cloud.dataform.v1.CommitMetadata"
2736 }
2737}
2738
2739/// `ComputeRepositoryAccessTokenStatus` request message.
2740#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct ComputeRepositoryAccessTokenStatusRequest {
2743 /// Required. The repository's name.
2744 pub name: std::string::String,
2745
2746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2747}
2748
2749impl ComputeRepositoryAccessTokenStatusRequest {
2750 /// Creates a new default instance.
2751 pub fn new() -> Self {
2752 std::default::Default::default()
2753 }
2754
2755 /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
2756 ///
2757 /// # Example
2758 /// ```ignore,no_run
2759 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusRequest;
2760 /// # let project_id = "project_id";
2761 /// # let location_id = "location_id";
2762 /// # let repository_id = "repository_id";
2763 /// let x = ComputeRepositoryAccessTokenStatusRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
2764 /// ```
2765 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2766 self.name = v.into();
2767 self
2768 }
2769}
2770
2771impl wkt::message::Message for ComputeRepositoryAccessTokenStatusRequest {
2772 fn typename() -> &'static str {
2773 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusRequest"
2774 }
2775}
2776
2777/// `ComputeRepositoryAccessTokenStatus` response message.
2778#[derive(Clone, Default, PartialEq)]
2779#[non_exhaustive]
2780pub struct ComputeRepositoryAccessTokenStatusResponse {
2781 /// Indicates the status of the Git access token.
2782 pub token_status: crate::model::compute_repository_access_token_status_response::TokenStatus,
2783
2784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2785}
2786
2787impl ComputeRepositoryAccessTokenStatusResponse {
2788 /// Creates a new default instance.
2789 pub fn new() -> Self {
2790 std::default::Default::default()
2791 }
2792
2793 /// Sets the value of [token_status][crate::model::ComputeRepositoryAccessTokenStatusResponse::token_status].
2794 ///
2795 /// # Example
2796 /// ```ignore,no_run
2797 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusResponse;
2798 /// use google_cloud_dataform_v1::model::compute_repository_access_token_status_response::TokenStatus;
2799 /// let x0 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::NotFound);
2800 /// let x1 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Invalid);
2801 /// let x2 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Valid);
2802 /// ```
2803 pub fn set_token_status<
2804 T: std::convert::Into<
2805 crate::model::compute_repository_access_token_status_response::TokenStatus,
2806 >,
2807 >(
2808 mut self,
2809 v: T,
2810 ) -> Self {
2811 self.token_status = v.into();
2812 self
2813 }
2814}
2815
2816impl wkt::message::Message for ComputeRepositoryAccessTokenStatusResponse {
2817 fn typename() -> &'static str {
2818 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse"
2819 }
2820}
2821
2822/// Defines additional types related to [ComputeRepositoryAccessTokenStatusResponse].
2823pub mod compute_repository_access_token_status_response {
2824 #[allow(unused_imports)]
2825 use super::*;
2826
2827 /// Indicates the status of a Git authentication token.
2828 ///
2829 /// # Working with unknown values
2830 ///
2831 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2832 /// additional enum variants at any time. Adding new variants is not considered
2833 /// a breaking change. Applications should write their code in anticipation of:
2834 ///
2835 /// - New values appearing in future releases of the client library, **and**
2836 /// - New values received dynamically, without application changes.
2837 ///
2838 /// Please consult the [Working with enums] section in the user guide for some
2839 /// guidelines.
2840 ///
2841 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2842 #[derive(Clone, Debug, PartialEq)]
2843 #[non_exhaustive]
2844 pub enum TokenStatus {
2845 /// Default value. This value is unused.
2846 Unspecified,
2847 /// The token could not be found in Secret Manager (or the Dataform
2848 /// Service Account did not have permission to access it).
2849 NotFound,
2850 /// The token could not be used to authenticate against the Git remote.
2851 Invalid,
2852 /// The token was used successfully to authenticate against the Git remote.
2853 Valid,
2854 /// The token is not accessible due to permission issues.
2855 PermissionDenied,
2856 /// If set, the enum was initialized with an unknown value.
2857 ///
2858 /// Applications can examine the value using [TokenStatus::value] or
2859 /// [TokenStatus::name].
2860 UnknownValue(token_status::UnknownValue),
2861 }
2862
2863 #[doc(hidden)]
2864 pub mod token_status {
2865 #[allow(unused_imports)]
2866 use super::*;
2867 #[derive(Clone, Debug, PartialEq)]
2868 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2869 }
2870
2871 impl TokenStatus {
2872 /// Gets the enum value.
2873 ///
2874 /// Returns `None` if the enum contains an unknown value deserialized from
2875 /// the string representation of enums.
2876 pub fn value(&self) -> std::option::Option<i32> {
2877 match self {
2878 Self::Unspecified => std::option::Option::Some(0),
2879 Self::NotFound => std::option::Option::Some(1),
2880 Self::Invalid => std::option::Option::Some(2),
2881 Self::Valid => std::option::Option::Some(3),
2882 Self::PermissionDenied => std::option::Option::Some(4),
2883 Self::UnknownValue(u) => u.0.value(),
2884 }
2885 }
2886
2887 /// Gets the enum value as a string.
2888 ///
2889 /// Returns `None` if the enum contains an unknown value deserialized from
2890 /// the integer representation of enums.
2891 pub fn name(&self) -> std::option::Option<&str> {
2892 match self {
2893 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
2894 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
2895 Self::Invalid => std::option::Option::Some("INVALID"),
2896 Self::Valid => std::option::Option::Some("VALID"),
2897 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2898 Self::UnknownValue(u) => u.0.name(),
2899 }
2900 }
2901 }
2902
2903 impl std::default::Default for TokenStatus {
2904 fn default() -> Self {
2905 use std::convert::From;
2906 Self::from(0)
2907 }
2908 }
2909
2910 impl std::fmt::Display for TokenStatus {
2911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2912 wkt::internal::display_enum(f, self.name(), self.value())
2913 }
2914 }
2915
2916 impl std::convert::From<i32> for TokenStatus {
2917 fn from(value: i32) -> Self {
2918 match value {
2919 0 => Self::Unspecified,
2920 1 => Self::NotFound,
2921 2 => Self::Invalid,
2922 3 => Self::Valid,
2923 4 => Self::PermissionDenied,
2924 _ => Self::UnknownValue(token_status::UnknownValue(
2925 wkt::internal::UnknownEnumValue::Integer(value),
2926 )),
2927 }
2928 }
2929 }
2930
2931 impl std::convert::From<&str> for TokenStatus {
2932 fn from(value: &str) -> Self {
2933 use std::string::ToString;
2934 match value {
2935 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
2936 "NOT_FOUND" => Self::NotFound,
2937 "INVALID" => Self::Invalid,
2938 "VALID" => Self::Valid,
2939 "PERMISSION_DENIED" => Self::PermissionDenied,
2940 _ => Self::UnknownValue(token_status::UnknownValue(
2941 wkt::internal::UnknownEnumValue::String(value.to_string()),
2942 )),
2943 }
2944 }
2945 }
2946
2947 impl serde::ser::Serialize for TokenStatus {
2948 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2949 where
2950 S: serde::Serializer,
2951 {
2952 match self {
2953 Self::Unspecified => serializer.serialize_i32(0),
2954 Self::NotFound => serializer.serialize_i32(1),
2955 Self::Invalid => serializer.serialize_i32(2),
2956 Self::Valid => serializer.serialize_i32(3),
2957 Self::PermissionDenied => serializer.serialize_i32(4),
2958 Self::UnknownValue(u) => u.0.serialize(serializer),
2959 }
2960 }
2961 }
2962
2963 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
2964 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2965 where
2966 D: serde::Deserializer<'de>,
2967 {
2968 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
2969 ".google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse.TokenStatus",
2970 ))
2971 }
2972 }
2973}
2974
2975/// `FetchRemoteBranches` request message.
2976#[derive(Clone, Default, PartialEq)]
2977#[non_exhaustive]
2978pub struct FetchRemoteBranchesRequest {
2979 /// Required. The repository's name.
2980 pub name: std::string::String,
2981
2982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2983}
2984
2985impl FetchRemoteBranchesRequest {
2986 /// Creates a new default instance.
2987 pub fn new() -> Self {
2988 std::default::Default::default()
2989 }
2990
2991 /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
2992 ///
2993 /// # Example
2994 /// ```ignore,no_run
2995 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesRequest;
2996 /// # let project_id = "project_id";
2997 /// # let location_id = "location_id";
2998 /// # let repository_id = "repository_id";
2999 /// let x = FetchRemoteBranchesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
3000 /// ```
3001 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3002 self.name = v.into();
3003 self
3004 }
3005}
3006
3007impl wkt::message::Message for FetchRemoteBranchesRequest {
3008 fn typename() -> &'static str {
3009 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesRequest"
3010 }
3011}
3012
3013/// `FetchRemoteBranches` response message.
3014#[derive(Clone, Default, PartialEq)]
3015#[non_exhaustive]
3016pub struct FetchRemoteBranchesResponse {
3017 /// The remote repository's branch names.
3018 pub branches: std::vec::Vec<std::string::String>,
3019
3020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3021}
3022
3023impl FetchRemoteBranchesResponse {
3024 /// Creates a new default instance.
3025 pub fn new() -> Self {
3026 std::default::Default::default()
3027 }
3028
3029 /// Sets the value of [branches][crate::model::FetchRemoteBranchesResponse::branches].
3030 ///
3031 /// # Example
3032 /// ```ignore,no_run
3033 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesResponse;
3034 /// let x = FetchRemoteBranchesResponse::new().set_branches(["a", "b", "c"]);
3035 /// ```
3036 pub fn set_branches<T, V>(mut self, v: T) -> Self
3037 where
3038 T: std::iter::IntoIterator<Item = V>,
3039 V: std::convert::Into<std::string::String>,
3040 {
3041 use std::iter::Iterator;
3042 self.branches = v.into_iter().map(|i| i.into()).collect();
3043 self
3044 }
3045}
3046
3047impl wkt::message::Message for FetchRemoteBranchesResponse {
3048 fn typename() -> &'static str {
3049 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesResponse"
3050 }
3051}
3052
3053/// Represents a Dataform Git workspace.
3054#[derive(Clone, Default, PartialEq)]
3055#[non_exhaustive]
3056pub struct Workspace {
3057 /// Identifier. The workspace's name.
3058 pub name: std::string::String,
3059
3060 /// Output only. The timestamp of when the workspace was created.
3061 pub create_time: std::option::Option<wkt::Timestamp>,
3062
3063 /// Output only. A data encryption state of a Git repository if this Workspace
3064 /// is protected by a KMS key.
3065 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
3066
3067 /// Output only. All the metadata information that is used internally to serve
3068 /// the resource. For example: timestamps, flags, status fields, etc. The
3069 /// format of this field is a JSON string.
3070 pub internal_metadata: std::option::Option<std::string::String>,
3071
3072 /// Optional. If set to true, workspaces will not be moved if its linked
3073 /// Repository is moved. Instead, it will be deleted.
3074 pub disable_moves: std::option::Option<bool>,
3075
3076 /// Output only. Metadata indicating whether this resource is user-scoped. For
3077 /// `Workspace` resources, the `user_scoped` field is always `true`.
3078 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
3079
3080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3081}
3082
3083impl Workspace {
3084 /// Creates a new default instance.
3085 pub fn new() -> Self {
3086 std::default::Default::default()
3087 }
3088
3089 /// Sets the value of [name][crate::model::Workspace::name].
3090 ///
3091 /// # Example
3092 /// ```ignore,no_run
3093 /// # use google_cloud_dataform_v1::model::Workspace;
3094 /// # let project_id = "project_id";
3095 /// # let location_id = "location_id";
3096 /// # let repository_id = "repository_id";
3097 /// # let workspace_id = "workspace_id";
3098 /// let x = Workspace::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3099 /// ```
3100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3101 self.name = v.into();
3102 self
3103 }
3104
3105 /// Sets the value of [create_time][crate::model::Workspace::create_time].
3106 ///
3107 /// # Example
3108 /// ```ignore,no_run
3109 /// # use google_cloud_dataform_v1::model::Workspace;
3110 /// use wkt::Timestamp;
3111 /// let x = Workspace::new().set_create_time(Timestamp::default()/* use setters */);
3112 /// ```
3113 pub fn set_create_time<T>(mut self, v: T) -> Self
3114 where
3115 T: std::convert::Into<wkt::Timestamp>,
3116 {
3117 self.create_time = std::option::Option::Some(v.into());
3118 self
3119 }
3120
3121 /// Sets or clears the value of [create_time][crate::model::Workspace::create_time].
3122 ///
3123 /// # Example
3124 /// ```ignore,no_run
3125 /// # use google_cloud_dataform_v1::model::Workspace;
3126 /// use wkt::Timestamp;
3127 /// let x = Workspace::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3128 /// let x = Workspace::new().set_or_clear_create_time(None::<Timestamp>);
3129 /// ```
3130 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3131 where
3132 T: std::convert::Into<wkt::Timestamp>,
3133 {
3134 self.create_time = v.map(|x| x.into());
3135 self
3136 }
3137
3138 /// Sets the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
3139 ///
3140 /// # Example
3141 /// ```ignore,no_run
3142 /// # use google_cloud_dataform_v1::model::Workspace;
3143 /// use google_cloud_dataform_v1::model::DataEncryptionState;
3144 /// let x = Workspace::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
3145 /// ```
3146 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
3147 where
3148 T: std::convert::Into<crate::model::DataEncryptionState>,
3149 {
3150 self.data_encryption_state = std::option::Option::Some(v.into());
3151 self
3152 }
3153
3154 /// Sets or clears the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
3155 ///
3156 /// # Example
3157 /// ```ignore,no_run
3158 /// # use google_cloud_dataform_v1::model::Workspace;
3159 /// use google_cloud_dataform_v1::model::DataEncryptionState;
3160 /// let x = Workspace::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
3161 /// let x = Workspace::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
3162 /// ```
3163 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
3164 where
3165 T: std::convert::Into<crate::model::DataEncryptionState>,
3166 {
3167 self.data_encryption_state = v.map(|x| x.into());
3168 self
3169 }
3170
3171 /// Sets the value of [internal_metadata][crate::model::Workspace::internal_metadata].
3172 ///
3173 /// # Example
3174 /// ```ignore,no_run
3175 /// # use google_cloud_dataform_v1::model::Workspace;
3176 /// let x = Workspace::new().set_internal_metadata("example");
3177 /// ```
3178 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
3179 where
3180 T: std::convert::Into<std::string::String>,
3181 {
3182 self.internal_metadata = std::option::Option::Some(v.into());
3183 self
3184 }
3185
3186 /// Sets or clears the value of [internal_metadata][crate::model::Workspace::internal_metadata].
3187 ///
3188 /// # Example
3189 /// ```ignore,no_run
3190 /// # use google_cloud_dataform_v1::model::Workspace;
3191 /// let x = Workspace::new().set_or_clear_internal_metadata(Some("example"));
3192 /// let x = Workspace::new().set_or_clear_internal_metadata(None::<String>);
3193 /// ```
3194 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3195 where
3196 T: std::convert::Into<std::string::String>,
3197 {
3198 self.internal_metadata = v.map(|x| x.into());
3199 self
3200 }
3201
3202 /// Sets the value of [disable_moves][crate::model::Workspace::disable_moves].
3203 ///
3204 /// # Example
3205 /// ```ignore,no_run
3206 /// # use google_cloud_dataform_v1::model::Workspace;
3207 /// let x = Workspace::new().set_disable_moves(true);
3208 /// ```
3209 pub fn set_disable_moves<T>(mut self, v: T) -> Self
3210 where
3211 T: std::convert::Into<bool>,
3212 {
3213 self.disable_moves = std::option::Option::Some(v.into());
3214 self
3215 }
3216
3217 /// Sets or clears the value of [disable_moves][crate::model::Workspace::disable_moves].
3218 ///
3219 /// # Example
3220 /// ```ignore,no_run
3221 /// # use google_cloud_dataform_v1::model::Workspace;
3222 /// let x = Workspace::new().set_or_clear_disable_moves(Some(false));
3223 /// let x = Workspace::new().set_or_clear_disable_moves(None::<bool>);
3224 /// ```
3225 pub fn set_or_clear_disable_moves<T>(mut self, v: std::option::Option<T>) -> Self
3226 where
3227 T: std::convert::Into<bool>,
3228 {
3229 self.disable_moves = v.map(|x| x.into());
3230 self
3231 }
3232
3233 /// Sets the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
3234 ///
3235 /// # Example
3236 /// ```ignore,no_run
3237 /// # use google_cloud_dataform_v1::model::Workspace;
3238 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
3239 /// let x = Workspace::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
3240 /// ```
3241 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
3242 where
3243 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
3244 {
3245 self.private_resource_metadata = std::option::Option::Some(v.into());
3246 self
3247 }
3248
3249 /// Sets or clears the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
3250 ///
3251 /// # Example
3252 /// ```ignore,no_run
3253 /// # use google_cloud_dataform_v1::model::Workspace;
3254 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
3255 /// let x = Workspace::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
3256 /// let x = Workspace::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
3257 /// ```
3258 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3259 where
3260 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
3261 {
3262 self.private_resource_metadata = v.map(|x| x.into());
3263 self
3264 }
3265}
3266
3267impl wkt::message::Message for Workspace {
3268 fn typename() -> &'static str {
3269 "type.googleapis.com/google.cloud.dataform.v1.Workspace"
3270 }
3271}
3272
3273/// `ListWorkspaces` request message.
3274#[derive(Clone, Default, PartialEq)]
3275#[non_exhaustive]
3276pub struct ListWorkspacesRequest {
3277 /// Required. The repository in which to list workspaces. Must be in the
3278 /// format `projects/*/locations/*/repositories/*`.
3279 pub parent: std::string::String,
3280
3281 /// Optional. Maximum number of workspaces to return. The server may return
3282 /// fewer items than requested. If unspecified, the server will pick an
3283 /// appropriate default.
3284 pub page_size: i32,
3285
3286 /// Optional. Page token received from a previous `ListWorkspaces` call.
3287 /// Provide this to retrieve the subsequent page.
3288 ///
3289 /// When paginating, all other parameters provided to `ListWorkspaces`, with
3290 /// the exception of `page_size`, must match the call that provided the page
3291 /// token.
3292 pub page_token: std::string::String,
3293
3294 /// Optional. This field only supports ordering by `name`. If unspecified, the
3295 /// server will choose the ordering. If specified, the default order is
3296 /// ascending for the `name` field.
3297 pub order_by: std::string::String,
3298
3299 /// Optional. Filter for the returned list.
3300 pub filter: std::string::String,
3301
3302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3303}
3304
3305impl ListWorkspacesRequest {
3306 /// Creates a new default instance.
3307 pub fn new() -> Self {
3308 std::default::Default::default()
3309 }
3310
3311 /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
3312 ///
3313 /// # Example
3314 /// ```ignore,no_run
3315 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3316 /// # let project_id = "project_id";
3317 /// # let location_id = "location_id";
3318 /// # let repository_id = "repository_id";
3319 /// let x = ListWorkspacesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
3320 /// ```
3321 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3322 self.parent = v.into();
3323 self
3324 }
3325
3326 /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
3327 ///
3328 /// # Example
3329 /// ```ignore,no_run
3330 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3331 /// let x = ListWorkspacesRequest::new().set_page_size(42);
3332 /// ```
3333 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3334 self.page_size = v.into();
3335 self
3336 }
3337
3338 /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
3339 ///
3340 /// # Example
3341 /// ```ignore,no_run
3342 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3343 /// let x = ListWorkspacesRequest::new().set_page_token("example");
3344 /// ```
3345 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.page_token = v.into();
3347 self
3348 }
3349
3350 /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
3351 ///
3352 /// # Example
3353 /// ```ignore,no_run
3354 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3355 /// let x = ListWorkspacesRequest::new().set_order_by("example");
3356 /// ```
3357 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3358 self.order_by = v.into();
3359 self
3360 }
3361
3362 /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
3363 ///
3364 /// # Example
3365 /// ```ignore,no_run
3366 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3367 /// let x = ListWorkspacesRequest::new().set_filter("example");
3368 /// ```
3369 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3370 self.filter = v.into();
3371 self
3372 }
3373}
3374
3375impl wkt::message::Message for ListWorkspacesRequest {
3376 fn typename() -> &'static str {
3377 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesRequest"
3378 }
3379}
3380
3381/// `ListWorkspaces` response message.
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct ListWorkspacesResponse {
3385 /// List of workspaces.
3386 pub workspaces: std::vec::Vec<crate::model::Workspace>,
3387
3388 /// A token, which can be sent as `page_token` to retrieve the next page.
3389 /// If this field is omitted, there are no subsequent pages.
3390 pub next_page_token: std::string::String,
3391
3392 /// Locations which could not be reached.
3393 pub unreachable: std::vec::Vec<std::string::String>,
3394
3395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3396}
3397
3398impl ListWorkspacesResponse {
3399 /// Creates a new default instance.
3400 pub fn new() -> Self {
3401 std::default::Default::default()
3402 }
3403
3404 /// Sets the value of [workspaces][crate::model::ListWorkspacesResponse::workspaces].
3405 ///
3406 /// # Example
3407 /// ```ignore,no_run
3408 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3409 /// use google_cloud_dataform_v1::model::Workspace;
3410 /// let x = ListWorkspacesResponse::new()
3411 /// .set_workspaces([
3412 /// Workspace::default()/* use setters */,
3413 /// Workspace::default()/* use (different) setters */,
3414 /// ]);
3415 /// ```
3416 pub fn set_workspaces<T, V>(mut self, v: T) -> Self
3417 where
3418 T: std::iter::IntoIterator<Item = V>,
3419 V: std::convert::Into<crate::model::Workspace>,
3420 {
3421 use std::iter::Iterator;
3422 self.workspaces = v.into_iter().map(|i| i.into()).collect();
3423 self
3424 }
3425
3426 /// Sets the value of [next_page_token][crate::model::ListWorkspacesResponse::next_page_token].
3427 ///
3428 /// # Example
3429 /// ```ignore,no_run
3430 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3431 /// let x = ListWorkspacesResponse::new().set_next_page_token("example");
3432 /// ```
3433 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3434 self.next_page_token = v.into();
3435 self
3436 }
3437
3438 /// Sets the value of [unreachable][crate::model::ListWorkspacesResponse::unreachable].
3439 ///
3440 /// # Example
3441 /// ```ignore,no_run
3442 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3443 /// let x = ListWorkspacesResponse::new().set_unreachable(["a", "b", "c"]);
3444 /// ```
3445 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3446 where
3447 T: std::iter::IntoIterator<Item = V>,
3448 V: std::convert::Into<std::string::String>,
3449 {
3450 use std::iter::Iterator;
3451 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3452 self
3453 }
3454}
3455
3456impl wkt::message::Message for ListWorkspacesResponse {
3457 fn typename() -> &'static str {
3458 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesResponse"
3459 }
3460}
3461
3462#[doc(hidden)]
3463impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkspacesResponse {
3464 type PageItem = crate::model::Workspace;
3465
3466 fn items(self) -> std::vec::Vec<Self::PageItem> {
3467 self.workspaces
3468 }
3469
3470 fn next_page_token(&self) -> std::string::String {
3471 use std::clone::Clone;
3472 self.next_page_token.clone()
3473 }
3474}
3475
3476/// `GetWorkspace` request message.
3477#[derive(Clone, Default, PartialEq)]
3478#[non_exhaustive]
3479pub struct GetWorkspaceRequest {
3480 /// Required. The workspace's name.
3481 pub name: std::string::String,
3482
3483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3484}
3485
3486impl GetWorkspaceRequest {
3487 /// Creates a new default instance.
3488 pub fn new() -> Self {
3489 std::default::Default::default()
3490 }
3491
3492 /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
3493 ///
3494 /// # Example
3495 /// ```ignore,no_run
3496 /// # use google_cloud_dataform_v1::model::GetWorkspaceRequest;
3497 /// # let project_id = "project_id";
3498 /// # let location_id = "location_id";
3499 /// # let repository_id = "repository_id";
3500 /// # let workspace_id = "workspace_id";
3501 /// let x = GetWorkspaceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3502 /// ```
3503 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3504 self.name = v.into();
3505 self
3506 }
3507}
3508
3509impl wkt::message::Message for GetWorkspaceRequest {
3510 fn typename() -> &'static str {
3511 "type.googleapis.com/google.cloud.dataform.v1.GetWorkspaceRequest"
3512 }
3513}
3514
3515/// `CreateWorkspace` request message.
3516#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct CreateWorkspaceRequest {
3519 /// Required. The repository in which to create the workspace. Must be in the
3520 /// format `projects/*/locations/*/repositories/*`.
3521 pub parent: std::string::String,
3522
3523 /// Required. The workspace to create.
3524 pub workspace: std::option::Option<crate::model::Workspace>,
3525
3526 /// Required. The ID to use for the workspace, which will become the final
3527 /// component of the workspace's resource name.
3528 pub workspace_id: std::string::String,
3529
3530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3531}
3532
3533impl CreateWorkspaceRequest {
3534 /// Creates a new default instance.
3535 pub fn new() -> Self {
3536 std::default::Default::default()
3537 }
3538
3539 /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
3540 ///
3541 /// # Example
3542 /// ```ignore,no_run
3543 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3544 /// # let project_id = "project_id";
3545 /// # let location_id = "location_id";
3546 /// # let repository_id = "repository_id";
3547 /// let x = CreateWorkspaceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
3548 /// ```
3549 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3550 self.parent = v.into();
3551 self
3552 }
3553
3554 /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3559 /// use google_cloud_dataform_v1::model::Workspace;
3560 /// let x = CreateWorkspaceRequest::new().set_workspace(Workspace::default()/* use setters */);
3561 /// ```
3562 pub fn set_workspace<T>(mut self, v: T) -> Self
3563 where
3564 T: std::convert::Into<crate::model::Workspace>,
3565 {
3566 self.workspace = std::option::Option::Some(v.into());
3567 self
3568 }
3569
3570 /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3571 ///
3572 /// # Example
3573 /// ```ignore,no_run
3574 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3575 /// use google_cloud_dataform_v1::model::Workspace;
3576 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(Some(Workspace::default()/* use setters */));
3577 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(None::<Workspace>);
3578 /// ```
3579 pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3580 where
3581 T: std::convert::Into<crate::model::Workspace>,
3582 {
3583 self.workspace = v.map(|x| x.into());
3584 self
3585 }
3586
3587 /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
3588 ///
3589 /// # Example
3590 /// ```ignore,no_run
3591 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3592 /// let x = CreateWorkspaceRequest::new().set_workspace_id("example");
3593 /// ```
3594 pub fn set_workspace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3595 self.workspace_id = v.into();
3596 self
3597 }
3598}
3599
3600impl wkt::message::Message for CreateWorkspaceRequest {
3601 fn typename() -> &'static str {
3602 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkspaceRequest"
3603 }
3604}
3605
3606/// `DeleteWorkspace` request message.
3607#[derive(Clone, Default, PartialEq)]
3608#[non_exhaustive]
3609pub struct DeleteWorkspaceRequest {
3610 /// Required. The workspace resource's name.
3611 pub name: std::string::String,
3612
3613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3614}
3615
3616impl DeleteWorkspaceRequest {
3617 /// Creates a new default instance.
3618 pub fn new() -> Self {
3619 std::default::Default::default()
3620 }
3621
3622 /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
3623 ///
3624 /// # Example
3625 /// ```ignore,no_run
3626 /// # use google_cloud_dataform_v1::model::DeleteWorkspaceRequest;
3627 /// # let project_id = "project_id";
3628 /// # let location_id = "location_id";
3629 /// # let repository_id = "repository_id";
3630 /// # let workspace_id = "workspace_id";
3631 /// let x = DeleteWorkspaceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3632 /// ```
3633 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634 self.name = v.into();
3635 self
3636 }
3637}
3638
3639impl wkt::message::Message for DeleteWorkspaceRequest {
3640 fn typename() -> &'static str {
3641 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkspaceRequest"
3642 }
3643}
3644
3645/// Represents the author of a Git commit.
3646#[derive(Clone, Default, PartialEq)]
3647#[non_exhaustive]
3648pub struct CommitAuthor {
3649 /// Required. The commit author's name.
3650 pub name: std::string::String,
3651
3652 /// Required. The commit author's email address.
3653 pub email_address: std::string::String,
3654
3655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3656}
3657
3658impl CommitAuthor {
3659 /// Creates a new default instance.
3660 pub fn new() -> Self {
3661 std::default::Default::default()
3662 }
3663
3664 /// Sets the value of [name][crate::model::CommitAuthor::name].
3665 ///
3666 /// # Example
3667 /// ```ignore,no_run
3668 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3669 /// let x = CommitAuthor::new().set_name("example");
3670 /// ```
3671 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3672 self.name = v.into();
3673 self
3674 }
3675
3676 /// Sets the value of [email_address][crate::model::CommitAuthor::email_address].
3677 ///
3678 /// # Example
3679 /// ```ignore,no_run
3680 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3681 /// let x = CommitAuthor::new().set_email_address("example");
3682 /// ```
3683 pub fn set_email_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684 self.email_address = v.into();
3685 self
3686 }
3687}
3688
3689impl wkt::message::Message for CommitAuthor {
3690 fn typename() -> &'static str {
3691 "type.googleapis.com/google.cloud.dataform.v1.CommitAuthor"
3692 }
3693}
3694
3695/// `PullGitCommits` request message.
3696#[derive(Clone, Default, PartialEq)]
3697#[non_exhaustive]
3698pub struct PullGitCommitsRequest {
3699 /// Required. The workspace's name.
3700 pub name: std::string::String,
3701
3702 /// Optional. The name of the branch in the Git remote from which to pull
3703 /// commits. If left unset, the repository's default branch name will be used.
3704 pub remote_branch: std::string::String,
3705
3706 /// Required. The author of any merge commit which may be created as a result
3707 /// of merging fetched Git commits into this workspace.
3708 pub author: std::option::Option<crate::model::CommitAuthor>,
3709
3710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3711}
3712
3713impl PullGitCommitsRequest {
3714 /// Creates a new default instance.
3715 pub fn new() -> Self {
3716 std::default::Default::default()
3717 }
3718
3719 /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
3720 ///
3721 /// # Example
3722 /// ```ignore,no_run
3723 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3724 /// # let project_id = "project_id";
3725 /// # let location_id = "location_id";
3726 /// # let repository_id = "repository_id";
3727 /// # let workspace_id = "workspace_id";
3728 /// let x = PullGitCommitsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3729 /// ```
3730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.name = v.into();
3732 self
3733 }
3734
3735 /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3740 /// let x = PullGitCommitsRequest::new().set_remote_branch("example");
3741 /// ```
3742 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.remote_branch = v.into();
3744 self
3745 }
3746
3747 /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
3748 ///
3749 /// # Example
3750 /// ```ignore,no_run
3751 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3752 /// use google_cloud_dataform_v1::model::CommitAuthor;
3753 /// let x = PullGitCommitsRequest::new().set_author(CommitAuthor::default()/* use setters */);
3754 /// ```
3755 pub fn set_author<T>(mut self, v: T) -> Self
3756 where
3757 T: std::convert::Into<crate::model::CommitAuthor>,
3758 {
3759 self.author = std::option::Option::Some(v.into());
3760 self
3761 }
3762
3763 /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
3764 ///
3765 /// # Example
3766 /// ```ignore,no_run
3767 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3768 /// use google_cloud_dataform_v1::model::CommitAuthor;
3769 /// let x = PullGitCommitsRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
3770 /// let x = PullGitCommitsRequest::new().set_or_clear_author(None::<CommitAuthor>);
3771 /// ```
3772 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
3773 where
3774 T: std::convert::Into<crate::model::CommitAuthor>,
3775 {
3776 self.author = v.map(|x| x.into());
3777 self
3778 }
3779}
3780
3781impl wkt::message::Message for PullGitCommitsRequest {
3782 fn typename() -> &'static str {
3783 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsRequest"
3784 }
3785}
3786
3787/// `PullGitCommits` response message.
3788#[derive(Clone, Default, PartialEq)]
3789#[non_exhaustive]
3790pub struct PullGitCommitsResponse {
3791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3792}
3793
3794impl PullGitCommitsResponse {
3795 /// Creates a new default instance.
3796 pub fn new() -> Self {
3797 std::default::Default::default()
3798 }
3799}
3800
3801impl wkt::message::Message for PullGitCommitsResponse {
3802 fn typename() -> &'static str {
3803 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsResponse"
3804 }
3805}
3806
3807/// `PushGitCommits` request message.
3808#[derive(Clone, Default, PartialEq)]
3809#[non_exhaustive]
3810pub struct PushGitCommitsRequest {
3811 /// Required. The workspace's name.
3812 pub name: std::string::String,
3813
3814 /// Optional. The name of the branch in the Git remote to which commits should
3815 /// be pushed. If left unset, the repository's default branch name will be
3816 /// used.
3817 pub remote_branch: std::string::String,
3818
3819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3820}
3821
3822impl PushGitCommitsRequest {
3823 /// Creates a new default instance.
3824 pub fn new() -> Self {
3825 std::default::Default::default()
3826 }
3827
3828 /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
3829 ///
3830 /// # Example
3831 /// ```ignore,no_run
3832 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3833 /// # let project_id = "project_id";
3834 /// # let location_id = "location_id";
3835 /// # let repository_id = "repository_id";
3836 /// # let workspace_id = "workspace_id";
3837 /// let x = PushGitCommitsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3838 /// ```
3839 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3840 self.name = v.into();
3841 self
3842 }
3843
3844 /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
3845 ///
3846 /// # Example
3847 /// ```ignore,no_run
3848 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3849 /// let x = PushGitCommitsRequest::new().set_remote_branch("example");
3850 /// ```
3851 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3852 self.remote_branch = v.into();
3853 self
3854 }
3855}
3856
3857impl wkt::message::Message for PushGitCommitsRequest {
3858 fn typename() -> &'static str {
3859 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsRequest"
3860 }
3861}
3862
3863/// `PushGitCommits` response message.
3864#[derive(Clone, Default, PartialEq)]
3865#[non_exhaustive]
3866pub struct PushGitCommitsResponse {
3867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3868}
3869
3870impl PushGitCommitsResponse {
3871 /// Creates a new default instance.
3872 pub fn new() -> Self {
3873 std::default::Default::default()
3874 }
3875}
3876
3877impl wkt::message::Message for PushGitCommitsResponse {
3878 fn typename() -> &'static str {
3879 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsResponse"
3880 }
3881}
3882
3883/// `FetchFileGitStatuses` request message.
3884#[derive(Clone, Default, PartialEq)]
3885#[non_exhaustive]
3886pub struct FetchFileGitStatusesRequest {
3887 /// Required. The workspace's name.
3888 pub name: std::string::String,
3889
3890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3891}
3892
3893impl FetchFileGitStatusesRequest {
3894 /// Creates a new default instance.
3895 pub fn new() -> Self {
3896 std::default::Default::default()
3897 }
3898
3899 /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
3900 ///
3901 /// # Example
3902 /// ```ignore,no_run
3903 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesRequest;
3904 /// # let project_id = "project_id";
3905 /// # let location_id = "location_id";
3906 /// # let repository_id = "repository_id";
3907 /// # let workspace_id = "workspace_id";
3908 /// let x = FetchFileGitStatusesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
3909 /// ```
3910 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911 self.name = v.into();
3912 self
3913 }
3914}
3915
3916impl wkt::message::Message for FetchFileGitStatusesRequest {
3917 fn typename() -> &'static str {
3918 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesRequest"
3919 }
3920}
3921
3922/// `FetchFileGitStatuses` response message.
3923#[derive(Clone, Default, PartialEq)]
3924#[non_exhaustive]
3925pub struct FetchFileGitStatusesResponse {
3926 /// A list of all files which have uncommitted Git changes. There will only be
3927 /// a single entry for any given file.
3928 pub uncommitted_file_changes:
3929 std::vec::Vec<crate::model::fetch_file_git_statuses_response::UncommittedFileChange>,
3930
3931 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3932}
3933
3934impl FetchFileGitStatusesResponse {
3935 /// Creates a new default instance.
3936 pub fn new() -> Self {
3937 std::default::Default::default()
3938 }
3939
3940 /// Sets the value of [uncommitted_file_changes][crate::model::FetchFileGitStatusesResponse::uncommitted_file_changes].
3941 ///
3942 /// # Example
3943 /// ```ignore,no_run
3944 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesResponse;
3945 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3946 /// let x = FetchFileGitStatusesResponse::new()
3947 /// .set_uncommitted_file_changes([
3948 /// UncommittedFileChange::default()/* use setters */,
3949 /// UncommittedFileChange::default()/* use (different) setters */,
3950 /// ]);
3951 /// ```
3952 pub fn set_uncommitted_file_changes<T, V>(mut self, v: T) -> Self
3953 where
3954 T: std::iter::IntoIterator<Item = V>,
3955 V: std::convert::Into<
3956 crate::model::fetch_file_git_statuses_response::UncommittedFileChange,
3957 >,
3958 {
3959 use std::iter::Iterator;
3960 self.uncommitted_file_changes = v.into_iter().map(|i| i.into()).collect();
3961 self
3962 }
3963}
3964
3965impl wkt::message::Message for FetchFileGitStatusesResponse {
3966 fn typename() -> &'static str {
3967 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse"
3968 }
3969}
3970
3971/// Defines additional types related to [FetchFileGitStatusesResponse].
3972pub mod fetch_file_git_statuses_response {
3973 #[allow(unused_imports)]
3974 use super::*;
3975
3976 /// Represents the Git state of a file with uncommitted changes.
3977 #[derive(Clone, Default, PartialEq)]
3978 #[non_exhaustive]
3979 pub struct UncommittedFileChange {
3980 /// The file's full path including filename, relative to the workspace root.
3981 pub path: std::string::String,
3982
3983 /// Output only. Indicates the status of the file.
3984 pub state: crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
3985
3986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3987 }
3988
3989 impl UncommittedFileChange {
3990 /// Creates a new default instance.
3991 pub fn new() -> Self {
3992 std::default::Default::default()
3993 }
3994
3995 /// Sets the value of [path][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::path].
3996 ///
3997 /// # Example
3998 /// ```ignore,no_run
3999 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
4000 /// let x = UncommittedFileChange::new().set_path("example");
4001 /// ```
4002 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4003 self.path = v.into();
4004 self
4005 }
4006
4007 /// Sets the value of [state][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::state].
4008 ///
4009 /// # Example
4010 /// ```ignore,no_run
4011 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
4012 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::uncommitted_file_change::State;
4013 /// let x0 = UncommittedFileChange::new().set_state(State::Added);
4014 /// let x1 = UncommittedFileChange::new().set_state(State::Deleted);
4015 /// let x2 = UncommittedFileChange::new().set_state(State::Modified);
4016 /// ```
4017 pub fn set_state<
4018 T: std::convert::Into<
4019 crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
4020 >,
4021 >(
4022 mut self,
4023 v: T,
4024 ) -> Self {
4025 self.state = v.into();
4026 self
4027 }
4028 }
4029
4030 impl wkt::message::Message for UncommittedFileChange {
4031 fn typename() -> &'static str {
4032 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange"
4033 }
4034 }
4035
4036 /// Defines additional types related to [UncommittedFileChange].
4037 pub mod uncommitted_file_change {
4038 #[allow(unused_imports)]
4039 use super::*;
4040
4041 /// Indicates the status of an uncommitted file change.
4042 ///
4043 /// # Working with unknown values
4044 ///
4045 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4046 /// additional enum variants at any time. Adding new variants is not considered
4047 /// a breaking change. Applications should write their code in anticipation of:
4048 ///
4049 /// - New values appearing in future releases of the client library, **and**
4050 /// - New values received dynamically, without application changes.
4051 ///
4052 /// Please consult the [Working with enums] section in the user guide for some
4053 /// guidelines.
4054 ///
4055 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4056 #[derive(Clone, Debug, PartialEq)]
4057 #[non_exhaustive]
4058 pub enum State {
4059 /// Default value. This value is unused.
4060 Unspecified,
4061 /// The file has been newly added.
4062 Added,
4063 /// The file has been deleted.
4064 Deleted,
4065 /// The file has been modified.
4066 Modified,
4067 /// The file contains merge conflicts.
4068 HasConflicts,
4069 /// If set, the enum was initialized with an unknown value.
4070 ///
4071 /// Applications can examine the value using [State::value] or
4072 /// [State::name].
4073 UnknownValue(state::UnknownValue),
4074 }
4075
4076 #[doc(hidden)]
4077 pub mod state {
4078 #[allow(unused_imports)]
4079 use super::*;
4080 #[derive(Clone, Debug, PartialEq)]
4081 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4082 }
4083
4084 impl State {
4085 /// Gets the enum value.
4086 ///
4087 /// Returns `None` if the enum contains an unknown value deserialized from
4088 /// the string representation of enums.
4089 pub fn value(&self) -> std::option::Option<i32> {
4090 match self {
4091 Self::Unspecified => std::option::Option::Some(0),
4092 Self::Added => std::option::Option::Some(1),
4093 Self::Deleted => std::option::Option::Some(2),
4094 Self::Modified => std::option::Option::Some(3),
4095 Self::HasConflicts => std::option::Option::Some(4),
4096 Self::UnknownValue(u) => u.0.value(),
4097 }
4098 }
4099
4100 /// Gets the enum value as a string.
4101 ///
4102 /// Returns `None` if the enum contains an unknown value deserialized from
4103 /// the integer representation of enums.
4104 pub fn name(&self) -> std::option::Option<&str> {
4105 match self {
4106 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4107 Self::Added => std::option::Option::Some("ADDED"),
4108 Self::Deleted => std::option::Option::Some("DELETED"),
4109 Self::Modified => std::option::Option::Some("MODIFIED"),
4110 Self::HasConflicts => std::option::Option::Some("HAS_CONFLICTS"),
4111 Self::UnknownValue(u) => u.0.name(),
4112 }
4113 }
4114 }
4115
4116 impl std::default::Default for State {
4117 fn default() -> Self {
4118 use std::convert::From;
4119 Self::from(0)
4120 }
4121 }
4122
4123 impl std::fmt::Display for State {
4124 fn fmt(
4125 &self,
4126 f: &mut std::fmt::Formatter<'_>,
4127 ) -> std::result::Result<(), std::fmt::Error> {
4128 wkt::internal::display_enum(f, self.name(), self.value())
4129 }
4130 }
4131
4132 impl std::convert::From<i32> for State {
4133 fn from(value: i32) -> Self {
4134 match value {
4135 0 => Self::Unspecified,
4136 1 => Self::Added,
4137 2 => Self::Deleted,
4138 3 => Self::Modified,
4139 4 => Self::HasConflicts,
4140 _ => Self::UnknownValue(state::UnknownValue(
4141 wkt::internal::UnknownEnumValue::Integer(value),
4142 )),
4143 }
4144 }
4145 }
4146
4147 impl std::convert::From<&str> for State {
4148 fn from(value: &str) -> Self {
4149 use std::string::ToString;
4150 match value {
4151 "STATE_UNSPECIFIED" => Self::Unspecified,
4152 "ADDED" => Self::Added,
4153 "DELETED" => Self::Deleted,
4154 "MODIFIED" => Self::Modified,
4155 "HAS_CONFLICTS" => Self::HasConflicts,
4156 _ => Self::UnknownValue(state::UnknownValue(
4157 wkt::internal::UnknownEnumValue::String(value.to_string()),
4158 )),
4159 }
4160 }
4161 }
4162
4163 impl serde::ser::Serialize for State {
4164 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4165 where
4166 S: serde::Serializer,
4167 {
4168 match self {
4169 Self::Unspecified => serializer.serialize_i32(0),
4170 Self::Added => serializer.serialize_i32(1),
4171 Self::Deleted => serializer.serialize_i32(2),
4172 Self::Modified => serializer.serialize_i32(3),
4173 Self::HasConflicts => serializer.serialize_i32(4),
4174 Self::UnknownValue(u) => u.0.serialize(serializer),
4175 }
4176 }
4177 }
4178
4179 impl<'de> serde::de::Deserialize<'de> for State {
4180 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4181 where
4182 D: serde::Deserializer<'de>,
4183 {
4184 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4185 ".google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange.State"))
4186 }
4187 }
4188 }
4189}
4190
4191/// `FetchGitAheadBehind` request message.
4192#[derive(Clone, Default, PartialEq)]
4193#[non_exhaustive]
4194pub struct FetchGitAheadBehindRequest {
4195 /// Required. The workspace's name.
4196 pub name: std::string::String,
4197
4198 /// Optional. The name of the branch in the Git remote against which this
4199 /// workspace should be compared. If left unset, the repository's default
4200 /// branch name will be used.
4201 pub remote_branch: std::string::String,
4202
4203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4204}
4205
4206impl FetchGitAheadBehindRequest {
4207 /// Creates a new default instance.
4208 pub fn new() -> Self {
4209 std::default::Default::default()
4210 }
4211
4212 /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
4213 ///
4214 /// # Example
4215 /// ```ignore,no_run
4216 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
4217 /// # let project_id = "project_id";
4218 /// # let location_id = "location_id";
4219 /// # let repository_id = "repository_id";
4220 /// # let workspace_id = "workspace_id";
4221 /// let x = FetchGitAheadBehindRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4222 /// ```
4223 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4224 self.name = v.into();
4225 self
4226 }
4227
4228 /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
4229 ///
4230 /// # Example
4231 /// ```ignore,no_run
4232 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
4233 /// let x = FetchGitAheadBehindRequest::new().set_remote_branch("example");
4234 /// ```
4235 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4236 self.remote_branch = v.into();
4237 self
4238 }
4239}
4240
4241impl wkt::message::Message for FetchGitAheadBehindRequest {
4242 fn typename() -> &'static str {
4243 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindRequest"
4244 }
4245}
4246
4247/// `FetchGitAheadBehind` response message.
4248#[derive(Clone, Default, PartialEq)]
4249#[non_exhaustive]
4250pub struct FetchGitAheadBehindResponse {
4251 /// The number of commits in the remote branch that are not in the workspace.
4252 pub commits_ahead: i32,
4253
4254 /// The number of commits in the workspace that are not in the remote branch.
4255 pub commits_behind: i32,
4256
4257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4258}
4259
4260impl FetchGitAheadBehindResponse {
4261 /// Creates a new default instance.
4262 pub fn new() -> Self {
4263 std::default::Default::default()
4264 }
4265
4266 /// Sets the value of [commits_ahead][crate::model::FetchGitAheadBehindResponse::commits_ahead].
4267 ///
4268 /// # Example
4269 /// ```ignore,no_run
4270 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
4271 /// let x = FetchGitAheadBehindResponse::new().set_commits_ahead(42);
4272 /// ```
4273 pub fn set_commits_ahead<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4274 self.commits_ahead = v.into();
4275 self
4276 }
4277
4278 /// Sets the value of [commits_behind][crate::model::FetchGitAheadBehindResponse::commits_behind].
4279 ///
4280 /// # Example
4281 /// ```ignore,no_run
4282 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
4283 /// let x = FetchGitAheadBehindResponse::new().set_commits_behind(42);
4284 /// ```
4285 pub fn set_commits_behind<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4286 self.commits_behind = v.into();
4287 self
4288 }
4289}
4290
4291impl wkt::message::Message for FetchGitAheadBehindResponse {
4292 fn typename() -> &'static str {
4293 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindResponse"
4294 }
4295}
4296
4297/// `CommitWorkspaceChanges` request message.
4298#[derive(Clone, Default, PartialEq)]
4299#[non_exhaustive]
4300pub struct CommitWorkspaceChangesRequest {
4301 /// Required. The workspace's name.
4302 pub name: std::string::String,
4303
4304 /// Required. The commit's author.
4305 pub author: std::option::Option<crate::model::CommitAuthor>,
4306
4307 /// Optional. The commit's message.
4308 pub commit_message: std::string::String,
4309
4310 /// Optional. Full file paths to commit including filename, rooted at workspace
4311 /// root. If left empty, all files will be committed.
4312 pub paths: std::vec::Vec<std::string::String>,
4313
4314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4315}
4316
4317impl CommitWorkspaceChangesRequest {
4318 /// Creates a new default instance.
4319 pub fn new() -> Self {
4320 std::default::Default::default()
4321 }
4322
4323 /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
4324 ///
4325 /// # Example
4326 /// ```ignore,no_run
4327 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4328 /// # let project_id = "project_id";
4329 /// # let location_id = "location_id";
4330 /// # let repository_id = "repository_id";
4331 /// # let workspace_id = "workspace_id";
4332 /// let x = CommitWorkspaceChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4333 /// ```
4334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4335 self.name = v.into();
4336 self
4337 }
4338
4339 /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4340 ///
4341 /// # Example
4342 /// ```ignore,no_run
4343 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4344 /// use google_cloud_dataform_v1::model::CommitAuthor;
4345 /// let x = CommitWorkspaceChangesRequest::new().set_author(CommitAuthor::default()/* use setters */);
4346 /// ```
4347 pub fn set_author<T>(mut self, v: T) -> Self
4348 where
4349 T: std::convert::Into<crate::model::CommitAuthor>,
4350 {
4351 self.author = std::option::Option::Some(v.into());
4352 self
4353 }
4354
4355 /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4356 ///
4357 /// # Example
4358 /// ```ignore,no_run
4359 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4360 /// use google_cloud_dataform_v1::model::CommitAuthor;
4361 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
4362 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(None::<CommitAuthor>);
4363 /// ```
4364 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
4365 where
4366 T: std::convert::Into<crate::model::CommitAuthor>,
4367 {
4368 self.author = v.map(|x| x.into());
4369 self
4370 }
4371
4372 /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
4373 ///
4374 /// # Example
4375 /// ```ignore,no_run
4376 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4377 /// let x = CommitWorkspaceChangesRequest::new().set_commit_message("example");
4378 /// ```
4379 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4380 self.commit_message = v.into();
4381 self
4382 }
4383
4384 /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
4385 ///
4386 /// # Example
4387 /// ```ignore,no_run
4388 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4389 /// let x = CommitWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4390 /// ```
4391 pub fn set_paths<T, V>(mut self, v: T) -> Self
4392 where
4393 T: std::iter::IntoIterator<Item = V>,
4394 V: std::convert::Into<std::string::String>,
4395 {
4396 use std::iter::Iterator;
4397 self.paths = v.into_iter().map(|i| i.into()).collect();
4398 self
4399 }
4400}
4401
4402impl wkt::message::Message for CommitWorkspaceChangesRequest {
4403 fn typename() -> &'static str {
4404 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesRequest"
4405 }
4406}
4407
4408/// `CommitWorkspaceChanges` response message.
4409#[derive(Clone, Default, PartialEq)]
4410#[non_exhaustive]
4411pub struct CommitWorkspaceChangesResponse {
4412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4413}
4414
4415impl CommitWorkspaceChangesResponse {
4416 /// Creates a new default instance.
4417 pub fn new() -> Self {
4418 std::default::Default::default()
4419 }
4420}
4421
4422impl wkt::message::Message for CommitWorkspaceChangesResponse {
4423 fn typename() -> &'static str {
4424 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesResponse"
4425 }
4426}
4427
4428/// `ResetWorkspaceChanges` request message.
4429#[derive(Clone, Default, PartialEq)]
4430#[non_exhaustive]
4431pub struct ResetWorkspaceChangesRequest {
4432 /// Required. The workspace's name.
4433 pub name: std::string::String,
4434
4435 /// Optional. Full file paths to reset back to their committed state including
4436 /// filename, rooted at workspace root. If left empty, all files will be reset.
4437 pub paths: std::vec::Vec<std::string::String>,
4438
4439 /// Optional. If set to true, untracked files will be deleted.
4440 pub clean: bool,
4441
4442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4443}
4444
4445impl ResetWorkspaceChangesRequest {
4446 /// Creates a new default instance.
4447 pub fn new() -> Self {
4448 std::default::Default::default()
4449 }
4450
4451 /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4456 /// # let project_id = "project_id";
4457 /// # let location_id = "location_id";
4458 /// # let repository_id = "repository_id";
4459 /// # let workspace_id = "workspace_id";
4460 /// let x = ResetWorkspaceChangesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4461 /// ```
4462 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4463 self.name = v.into();
4464 self
4465 }
4466
4467 /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
4468 ///
4469 /// # Example
4470 /// ```ignore,no_run
4471 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4472 /// let x = ResetWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4473 /// ```
4474 pub fn set_paths<T, V>(mut self, v: T) -> Self
4475 where
4476 T: std::iter::IntoIterator<Item = V>,
4477 V: std::convert::Into<std::string::String>,
4478 {
4479 use std::iter::Iterator;
4480 self.paths = v.into_iter().map(|i| i.into()).collect();
4481 self
4482 }
4483
4484 /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
4485 ///
4486 /// # Example
4487 /// ```ignore,no_run
4488 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4489 /// let x = ResetWorkspaceChangesRequest::new().set_clean(true);
4490 /// ```
4491 pub fn set_clean<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4492 self.clean = v.into();
4493 self
4494 }
4495}
4496
4497impl wkt::message::Message for ResetWorkspaceChangesRequest {
4498 fn typename() -> &'static str {
4499 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesRequest"
4500 }
4501}
4502
4503/// `ResetWorkspaceChanges` response message.
4504#[derive(Clone, Default, PartialEq)]
4505#[non_exhaustive]
4506pub struct ResetWorkspaceChangesResponse {
4507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4508}
4509
4510impl ResetWorkspaceChangesResponse {
4511 /// Creates a new default instance.
4512 pub fn new() -> Self {
4513 std::default::Default::default()
4514 }
4515}
4516
4517impl wkt::message::Message for ResetWorkspaceChangesResponse {
4518 fn typename() -> &'static str {
4519 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesResponse"
4520 }
4521}
4522
4523/// `FetchFileDiff` request message.
4524#[derive(Clone, Default, PartialEq)]
4525#[non_exhaustive]
4526pub struct FetchFileDiffRequest {
4527 /// Required. The workspace's name.
4528 pub workspace: std::string::String,
4529
4530 /// Required. The file's full path including filename, relative to the
4531 /// workspace root.
4532 pub path: std::string::String,
4533
4534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4535}
4536
4537impl FetchFileDiffRequest {
4538 /// Creates a new default instance.
4539 pub fn new() -> Self {
4540 std::default::Default::default()
4541 }
4542
4543 /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
4544 ///
4545 /// # Example
4546 /// ```ignore,no_run
4547 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4548 /// # let project_id = "project_id";
4549 /// # let location_id = "location_id";
4550 /// # let repository_id = "repository_id";
4551 /// # let workspace_id = "workspace_id";
4552 /// let x = FetchFileDiffRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4553 /// ```
4554 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4555 self.workspace = v.into();
4556 self
4557 }
4558
4559 /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
4560 ///
4561 /// # Example
4562 /// ```ignore,no_run
4563 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4564 /// let x = FetchFileDiffRequest::new().set_path("example");
4565 /// ```
4566 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4567 self.path = v.into();
4568 self
4569 }
4570}
4571
4572impl wkt::message::Message for FetchFileDiffRequest {
4573 fn typename() -> &'static str {
4574 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffRequest"
4575 }
4576}
4577
4578/// `FetchFileDiff` response message.
4579#[derive(Clone, Default, PartialEq)]
4580#[non_exhaustive]
4581pub struct FetchFileDiffResponse {
4582 /// The raw formatted Git diff for the file.
4583 pub formatted_diff: std::string::String,
4584
4585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4586}
4587
4588impl FetchFileDiffResponse {
4589 /// Creates a new default instance.
4590 pub fn new() -> Self {
4591 std::default::Default::default()
4592 }
4593
4594 /// Sets the value of [formatted_diff][crate::model::FetchFileDiffResponse::formatted_diff].
4595 ///
4596 /// # Example
4597 /// ```ignore,no_run
4598 /// # use google_cloud_dataform_v1::model::FetchFileDiffResponse;
4599 /// let x = FetchFileDiffResponse::new().set_formatted_diff("example");
4600 /// ```
4601 pub fn set_formatted_diff<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.formatted_diff = v.into();
4603 self
4604 }
4605}
4606
4607impl wkt::message::Message for FetchFileDiffResponse {
4608 fn typename() -> &'static str {
4609 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffResponse"
4610 }
4611}
4612
4613/// `QueryDirectoryContents` request message.
4614#[derive(Clone, Default, PartialEq)]
4615#[non_exhaustive]
4616pub struct QueryDirectoryContentsRequest {
4617 /// Required. The workspace's name.
4618 pub workspace: std::string::String,
4619
4620 /// Optional. The directory's full path including directory name, relative to
4621 /// the workspace root. If left unset, the workspace root is used.
4622 pub path: std::string::String,
4623
4624 /// Optional. Maximum number of paths to return. The server may return fewer
4625 /// items than requested. If unspecified, the server will pick an appropriate
4626 /// default.
4627 pub page_size: i32,
4628
4629 /// Optional. Page token received from a previous `QueryDirectoryContents`
4630 /// call. Provide this to retrieve the subsequent page.
4631 ///
4632 /// When paginating, all other parameters provided to
4633 /// `QueryDirectoryContents`, with the exception of `page_size`, must match the
4634 /// call that provided the page token.
4635 pub page_token: std::string::String,
4636
4637 /// Optional. Specifies the metadata to return for each directory entry.
4638 /// If unspecified, the default is `DIRECTORY_CONTENTS_VIEW_BASIC`.
4639 /// Currently the `DIRECTORY_CONTENTS_VIEW_METADATA` view is not supported by
4640 /// CMEK-protected workspaces.
4641 pub view: crate::model::DirectoryContentsView,
4642
4643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4644}
4645
4646impl QueryDirectoryContentsRequest {
4647 /// Creates a new default instance.
4648 pub fn new() -> Self {
4649 std::default::Default::default()
4650 }
4651
4652 /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
4653 ///
4654 /// # Example
4655 /// ```ignore,no_run
4656 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4657 /// # let project_id = "project_id";
4658 /// # let location_id = "location_id";
4659 /// # let repository_id = "repository_id";
4660 /// # let workspace_id = "workspace_id";
4661 /// let x = QueryDirectoryContentsRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
4662 /// ```
4663 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4664 self.workspace = v.into();
4665 self
4666 }
4667
4668 /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
4669 ///
4670 /// # Example
4671 /// ```ignore,no_run
4672 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4673 /// let x = QueryDirectoryContentsRequest::new().set_path("example");
4674 /// ```
4675 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4676 self.path = v.into();
4677 self
4678 }
4679
4680 /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
4681 ///
4682 /// # Example
4683 /// ```ignore,no_run
4684 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4685 /// let x = QueryDirectoryContentsRequest::new().set_page_size(42);
4686 /// ```
4687 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4688 self.page_size = v.into();
4689 self
4690 }
4691
4692 /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
4693 ///
4694 /// # Example
4695 /// ```ignore,no_run
4696 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4697 /// let x = QueryDirectoryContentsRequest::new().set_page_token("example");
4698 /// ```
4699 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.page_token = v.into();
4701 self
4702 }
4703
4704 /// Sets the value of [view][crate::model::QueryDirectoryContentsRequest::view].
4705 ///
4706 /// # Example
4707 /// ```ignore,no_run
4708 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4709 /// use google_cloud_dataform_v1::model::DirectoryContentsView;
4710 /// let x0 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Basic);
4711 /// let x1 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Metadata);
4712 /// ```
4713 pub fn set_view<T: std::convert::Into<crate::model::DirectoryContentsView>>(
4714 mut self,
4715 v: T,
4716 ) -> Self {
4717 self.view = v.into();
4718 self
4719 }
4720}
4721
4722impl wkt::message::Message for QueryDirectoryContentsRequest {
4723 fn typename() -> &'static str {
4724 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsRequest"
4725 }
4726}
4727
4728/// `QueryDirectoryContents` response message.
4729#[derive(Clone, Default, PartialEq)]
4730#[non_exhaustive]
4731pub struct QueryDirectoryContentsResponse {
4732 /// List of entries in the directory.
4733 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
4734
4735 /// A token, which can be sent as `page_token` to retrieve the next page.
4736 /// If this field is omitted, there are no subsequent pages.
4737 pub next_page_token: std::string::String,
4738
4739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4740}
4741
4742impl QueryDirectoryContentsResponse {
4743 /// Creates a new default instance.
4744 pub fn new() -> Self {
4745 std::default::Default::default()
4746 }
4747
4748 /// Sets the value of [directory_entries][crate::model::QueryDirectoryContentsResponse::directory_entries].
4749 ///
4750 /// # Example
4751 /// ```ignore,no_run
4752 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4753 /// use google_cloud_dataform_v1::model::DirectoryEntry;
4754 /// let x = QueryDirectoryContentsResponse::new()
4755 /// .set_directory_entries([
4756 /// DirectoryEntry::default()/* use setters */,
4757 /// DirectoryEntry::default()/* use (different) setters */,
4758 /// ]);
4759 /// ```
4760 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
4761 where
4762 T: std::iter::IntoIterator<Item = V>,
4763 V: std::convert::Into<crate::model::DirectoryEntry>,
4764 {
4765 use std::iter::Iterator;
4766 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
4767 self
4768 }
4769
4770 /// Sets the value of [next_page_token][crate::model::QueryDirectoryContentsResponse::next_page_token].
4771 ///
4772 /// # Example
4773 /// ```ignore,no_run
4774 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4775 /// let x = QueryDirectoryContentsResponse::new().set_next_page_token("example");
4776 /// ```
4777 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4778 self.next_page_token = v.into();
4779 self
4780 }
4781}
4782
4783impl wkt::message::Message for QueryDirectoryContentsResponse {
4784 fn typename() -> &'static str {
4785 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsResponse"
4786 }
4787}
4788
4789#[doc(hidden)]
4790impl google_cloud_gax::paginator::internal::PageableResponse for QueryDirectoryContentsResponse {
4791 type PageItem = crate::model::DirectoryEntry;
4792
4793 fn items(self) -> std::vec::Vec<Self::PageItem> {
4794 self.directory_entries
4795 }
4796
4797 fn next_page_token(&self) -> std::string::String {
4798 use std::clone::Clone;
4799 self.next_page_token.clone()
4800 }
4801}
4802
4803/// Represents a single entry in a directory.
4804#[derive(Clone, Default, PartialEq)]
4805#[non_exhaustive]
4806pub struct DirectoryEntry {
4807 /// Entry with metadata.
4808 pub metadata: std::option::Option<crate::model::FilesystemEntryMetadata>,
4809
4810 /// The entry's contents.
4811 pub entry: std::option::Option<crate::model::directory_entry::Entry>,
4812
4813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4814}
4815
4816impl DirectoryEntry {
4817 /// Creates a new default instance.
4818 pub fn new() -> Self {
4819 std::default::Default::default()
4820 }
4821
4822 /// Sets the value of [metadata][crate::model::DirectoryEntry::metadata].
4823 ///
4824 /// # Example
4825 /// ```ignore,no_run
4826 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4827 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4828 /// let x = DirectoryEntry::new().set_metadata(FilesystemEntryMetadata::default()/* use setters */);
4829 /// ```
4830 pub fn set_metadata<T>(mut self, v: T) -> Self
4831 where
4832 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4833 {
4834 self.metadata = std::option::Option::Some(v.into());
4835 self
4836 }
4837
4838 /// Sets or clears the value of [metadata][crate::model::DirectoryEntry::metadata].
4839 ///
4840 /// # Example
4841 /// ```ignore,no_run
4842 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4843 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4844 /// let x = DirectoryEntry::new().set_or_clear_metadata(Some(FilesystemEntryMetadata::default()/* use setters */));
4845 /// let x = DirectoryEntry::new().set_or_clear_metadata(None::<FilesystemEntryMetadata>);
4846 /// ```
4847 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4848 where
4849 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4850 {
4851 self.metadata = v.map(|x| x.into());
4852 self
4853 }
4854
4855 /// Sets the value of [entry][crate::model::DirectoryEntry::entry].
4856 ///
4857 /// Note that all the setters affecting `entry` are mutually
4858 /// exclusive.
4859 ///
4860 /// # Example
4861 /// ```ignore,no_run
4862 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4863 /// use google_cloud_dataform_v1::model::directory_entry::Entry;
4864 /// let x = DirectoryEntry::new().set_entry(Some(Entry::File("example".to_string())));
4865 /// ```
4866 pub fn set_entry<
4867 T: std::convert::Into<std::option::Option<crate::model::directory_entry::Entry>>,
4868 >(
4869 mut self,
4870 v: T,
4871 ) -> Self {
4872 self.entry = v.into();
4873 self
4874 }
4875
4876 /// The value of [entry][crate::model::DirectoryEntry::entry]
4877 /// if it holds a `File`, `None` if the field is not set or
4878 /// holds a different branch.
4879 pub fn file(&self) -> std::option::Option<&std::string::String> {
4880 #[allow(unreachable_patterns)]
4881 self.entry.as_ref().and_then(|v| match v {
4882 crate::model::directory_entry::Entry::File(v) => std::option::Option::Some(v),
4883 _ => std::option::Option::None,
4884 })
4885 }
4886
4887 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4888 /// to hold a `File`.
4889 ///
4890 /// Note that all the setters affecting `entry` are
4891 /// mutually exclusive.
4892 ///
4893 /// # Example
4894 /// ```ignore,no_run
4895 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4896 /// let x = DirectoryEntry::new().set_file("example");
4897 /// assert!(x.file().is_some());
4898 /// assert!(x.directory().is_none());
4899 /// ```
4900 pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4901 self.entry =
4902 std::option::Option::Some(crate::model::directory_entry::Entry::File(v.into()));
4903 self
4904 }
4905
4906 /// The value of [entry][crate::model::DirectoryEntry::entry]
4907 /// if it holds a `Directory`, `None` if the field is not set or
4908 /// holds a different branch.
4909 pub fn directory(&self) -> std::option::Option<&std::string::String> {
4910 #[allow(unreachable_patterns)]
4911 self.entry.as_ref().and_then(|v| match v {
4912 crate::model::directory_entry::Entry::Directory(v) => std::option::Option::Some(v),
4913 _ => std::option::Option::None,
4914 })
4915 }
4916
4917 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4918 /// to hold a `Directory`.
4919 ///
4920 /// Note that all the setters affecting `entry` are
4921 /// mutually exclusive.
4922 ///
4923 /// # Example
4924 /// ```ignore,no_run
4925 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4926 /// let x = DirectoryEntry::new().set_directory("example");
4927 /// assert!(x.directory().is_some());
4928 /// assert!(x.file().is_none());
4929 /// ```
4930 pub fn set_directory<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4931 self.entry =
4932 std::option::Option::Some(crate::model::directory_entry::Entry::Directory(v.into()));
4933 self
4934 }
4935}
4936
4937impl wkt::message::Message for DirectoryEntry {
4938 fn typename() -> &'static str {
4939 "type.googleapis.com/google.cloud.dataform.v1.DirectoryEntry"
4940 }
4941}
4942
4943/// Defines additional types related to [DirectoryEntry].
4944pub mod directory_entry {
4945 #[allow(unused_imports)]
4946 use super::*;
4947
4948 /// The entry's contents.
4949 #[derive(Clone, Debug, PartialEq)]
4950 #[non_exhaustive]
4951 pub enum Entry {
4952 /// A file in the directory. The path is returned including the full
4953 /// folder structure from the root.
4954 File(std::string::String),
4955 /// A child directory in the directory. The path is returned including
4956 /// the full folder structure from the root.
4957 Directory(std::string::String),
4958 }
4959}
4960
4961/// Represents metadata for a single entry in a filesystem.
4962#[derive(Clone, Default, PartialEq)]
4963#[non_exhaustive]
4964pub struct FilesystemEntryMetadata {
4965 /// Output only. Provides the size of the entry in bytes. For directories, this
4966 /// will be 0.
4967 pub size_bytes: i64,
4968
4969 /// Output only. Represents the time of the last modification of the entry.
4970 pub update_time: std::option::Option<wkt::Timestamp>,
4971
4972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4973}
4974
4975impl FilesystemEntryMetadata {
4976 /// Creates a new default instance.
4977 pub fn new() -> Self {
4978 std::default::Default::default()
4979 }
4980
4981 /// Sets the value of [size_bytes][crate::model::FilesystemEntryMetadata::size_bytes].
4982 ///
4983 /// # Example
4984 /// ```ignore,no_run
4985 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4986 /// let x = FilesystemEntryMetadata::new().set_size_bytes(42);
4987 /// ```
4988 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4989 self.size_bytes = v.into();
4990 self
4991 }
4992
4993 /// Sets the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
4994 ///
4995 /// # Example
4996 /// ```ignore,no_run
4997 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4998 /// use wkt::Timestamp;
4999 /// let x = FilesystemEntryMetadata::new().set_update_time(Timestamp::default()/* use setters */);
5000 /// ```
5001 pub fn set_update_time<T>(mut self, v: T) -> Self
5002 where
5003 T: std::convert::Into<wkt::Timestamp>,
5004 {
5005 self.update_time = std::option::Option::Some(v.into());
5006 self
5007 }
5008
5009 /// Sets or clears the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
5010 ///
5011 /// # Example
5012 /// ```ignore,no_run
5013 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
5014 /// use wkt::Timestamp;
5015 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5016 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(None::<Timestamp>);
5017 /// ```
5018 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5019 where
5020 T: std::convert::Into<wkt::Timestamp>,
5021 {
5022 self.update_time = v.map(|x| x.into());
5023 self
5024 }
5025}
5026
5027impl wkt::message::Message for FilesystemEntryMetadata {
5028 fn typename() -> &'static str {
5029 "type.googleapis.com/google.cloud.dataform.v1.FilesystemEntryMetadata"
5030 }
5031}
5032
5033/// Configuration containing file search request parameters.
5034#[derive(Clone, Default, PartialEq)]
5035#[non_exhaustive]
5036pub struct SearchFilesRequest {
5037 /// Required. The workspace's name.
5038 pub workspace: std::string::String,
5039
5040 /// Optional. Maximum number of search results to return. The server may return
5041 /// fewer items than requested. If unspecified, the server will pick an
5042 /// appropriate default.
5043 pub page_size: i32,
5044
5045 /// Optional. Page token received from a previous `SearchFilesRequest`
5046 /// call. Provide this to retrieve the subsequent page.
5047 ///
5048 /// When paginating, all other parameters provided to `SearchFilesRequest`,
5049 /// with the exception of `page_size`, must match the call that provided the
5050 /// page token.
5051 pub page_token: std::string::String,
5052
5053 /// Optional. Optional filter for the returned list in filtering format.
5054 /// Filtering is only currently supported on the `path` field.
5055 /// See <https://google.aip.dev/160> for details.
5056 pub filter: std::string::String,
5057
5058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5059}
5060
5061impl SearchFilesRequest {
5062 /// Creates a new default instance.
5063 pub fn new() -> Self {
5064 std::default::Default::default()
5065 }
5066
5067 /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
5068 ///
5069 /// # Example
5070 /// ```ignore,no_run
5071 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
5072 /// # let project_id = "project_id";
5073 /// # let location_id = "location_id";
5074 /// # let repository_id = "repository_id";
5075 /// # let workspace_id = "workspace_id";
5076 /// let x = SearchFilesRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5077 /// ```
5078 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5079 self.workspace = v.into();
5080 self
5081 }
5082
5083 /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
5084 ///
5085 /// # Example
5086 /// ```ignore,no_run
5087 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
5088 /// let x = SearchFilesRequest::new().set_page_size(42);
5089 /// ```
5090 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5091 self.page_size = v.into();
5092 self
5093 }
5094
5095 /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
5096 ///
5097 /// # Example
5098 /// ```ignore,no_run
5099 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
5100 /// let x = SearchFilesRequest::new().set_page_token("example");
5101 /// ```
5102 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5103 self.page_token = v.into();
5104 self
5105 }
5106
5107 /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
5108 ///
5109 /// # Example
5110 /// ```ignore,no_run
5111 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
5112 /// let x = SearchFilesRequest::new().set_filter("example");
5113 /// ```
5114 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.filter = v.into();
5116 self
5117 }
5118}
5119
5120impl wkt::message::Message for SearchFilesRequest {
5121 fn typename() -> &'static str {
5122 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesRequest"
5123 }
5124}
5125
5126/// Client-facing representation of a file search response.
5127#[derive(Clone, Default, PartialEq)]
5128#[non_exhaustive]
5129pub struct SearchFilesResponse {
5130 /// List of matched results.
5131 pub search_results: std::vec::Vec<crate::model::SearchResult>,
5132
5133 /// Optional. A token, which can be sent as `page_token` to retrieve the next
5134 /// page. If this field is omitted, there are no subsequent pages.
5135 pub next_page_token: std::string::String,
5136
5137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5138}
5139
5140impl SearchFilesResponse {
5141 /// Creates a new default instance.
5142 pub fn new() -> Self {
5143 std::default::Default::default()
5144 }
5145
5146 /// Sets the value of [search_results][crate::model::SearchFilesResponse::search_results].
5147 ///
5148 /// # Example
5149 /// ```ignore,no_run
5150 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
5151 /// use google_cloud_dataform_v1::model::SearchResult;
5152 /// let x = SearchFilesResponse::new()
5153 /// .set_search_results([
5154 /// SearchResult::default()/* use setters */,
5155 /// SearchResult::default()/* use (different) setters */,
5156 /// ]);
5157 /// ```
5158 pub fn set_search_results<T, V>(mut self, v: T) -> Self
5159 where
5160 T: std::iter::IntoIterator<Item = V>,
5161 V: std::convert::Into<crate::model::SearchResult>,
5162 {
5163 use std::iter::Iterator;
5164 self.search_results = v.into_iter().map(|i| i.into()).collect();
5165 self
5166 }
5167
5168 /// Sets the value of [next_page_token][crate::model::SearchFilesResponse::next_page_token].
5169 ///
5170 /// # Example
5171 /// ```ignore,no_run
5172 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
5173 /// let x = SearchFilesResponse::new().set_next_page_token("example");
5174 /// ```
5175 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5176 self.next_page_token = v.into();
5177 self
5178 }
5179}
5180
5181impl wkt::message::Message for SearchFilesResponse {
5182 fn typename() -> &'static str {
5183 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesResponse"
5184 }
5185}
5186
5187#[doc(hidden)]
5188impl google_cloud_gax::paginator::internal::PageableResponse for SearchFilesResponse {
5189 type PageItem = crate::model::SearchResult;
5190
5191 fn items(self) -> std::vec::Vec<Self::PageItem> {
5192 self.search_results
5193 }
5194
5195 fn next_page_token(&self) -> std::string::String {
5196 use std::clone::Clone;
5197 self.next_page_token.clone()
5198 }
5199}
5200
5201/// Client-facing representation of a search result entry.
5202#[derive(Clone, Default, PartialEq)]
5203#[non_exhaustive]
5204pub struct SearchResult {
5205 /// The entry's contents.
5206 pub entry: std::option::Option<crate::model::search_result::Entry>,
5207
5208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5209}
5210
5211impl SearchResult {
5212 /// Creates a new default instance.
5213 pub fn new() -> Self {
5214 std::default::Default::default()
5215 }
5216
5217 /// Sets the value of [entry][crate::model::SearchResult::entry].
5218 ///
5219 /// Note that all the setters affecting `entry` are mutually
5220 /// exclusive.
5221 ///
5222 /// # Example
5223 /// ```ignore,no_run
5224 /// # use google_cloud_dataform_v1::model::SearchResult;
5225 /// use google_cloud_dataform_v1::model::FileSearchResult;
5226 /// let x = SearchResult::new().set_entry(Some(
5227 /// google_cloud_dataform_v1::model::search_result::Entry::File(FileSearchResult::default().into())));
5228 /// ```
5229 pub fn set_entry<
5230 T: std::convert::Into<std::option::Option<crate::model::search_result::Entry>>,
5231 >(
5232 mut self,
5233 v: T,
5234 ) -> Self {
5235 self.entry = v.into();
5236 self
5237 }
5238
5239 /// The value of [entry][crate::model::SearchResult::entry]
5240 /// if it holds a `File`, `None` if the field is not set or
5241 /// holds a different branch.
5242 pub fn file(&self) -> std::option::Option<&std::boxed::Box<crate::model::FileSearchResult>> {
5243 #[allow(unreachable_patterns)]
5244 self.entry.as_ref().and_then(|v| match v {
5245 crate::model::search_result::Entry::File(v) => std::option::Option::Some(v),
5246 _ => std::option::Option::None,
5247 })
5248 }
5249
5250 /// Sets the value of [entry][crate::model::SearchResult::entry]
5251 /// to hold a `File`.
5252 ///
5253 /// Note that all the setters affecting `entry` are
5254 /// mutually exclusive.
5255 ///
5256 /// # Example
5257 /// ```ignore,no_run
5258 /// # use google_cloud_dataform_v1::model::SearchResult;
5259 /// use google_cloud_dataform_v1::model::FileSearchResult;
5260 /// let x = SearchResult::new().set_file(FileSearchResult::default()/* use setters */);
5261 /// assert!(x.file().is_some());
5262 /// assert!(x.directory().is_none());
5263 /// ```
5264 pub fn set_file<T: std::convert::Into<std::boxed::Box<crate::model::FileSearchResult>>>(
5265 mut self,
5266 v: T,
5267 ) -> Self {
5268 self.entry = std::option::Option::Some(crate::model::search_result::Entry::File(v.into()));
5269 self
5270 }
5271
5272 /// The value of [entry][crate::model::SearchResult::entry]
5273 /// if it holds a `Directory`, `None` if the field is not set or
5274 /// holds a different branch.
5275 pub fn directory(
5276 &self,
5277 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectorySearchResult>> {
5278 #[allow(unreachable_patterns)]
5279 self.entry.as_ref().and_then(|v| match v {
5280 crate::model::search_result::Entry::Directory(v) => std::option::Option::Some(v),
5281 _ => std::option::Option::None,
5282 })
5283 }
5284
5285 /// Sets the value of [entry][crate::model::SearchResult::entry]
5286 /// to hold a `Directory`.
5287 ///
5288 /// Note that all the setters affecting `entry` are
5289 /// mutually exclusive.
5290 ///
5291 /// # Example
5292 /// ```ignore,no_run
5293 /// # use google_cloud_dataform_v1::model::SearchResult;
5294 /// use google_cloud_dataform_v1::model::DirectorySearchResult;
5295 /// let x = SearchResult::new().set_directory(DirectorySearchResult::default()/* use setters */);
5296 /// assert!(x.directory().is_some());
5297 /// assert!(x.file().is_none());
5298 /// ```
5299 pub fn set_directory<
5300 T: std::convert::Into<std::boxed::Box<crate::model::DirectorySearchResult>>,
5301 >(
5302 mut self,
5303 v: T,
5304 ) -> Self {
5305 self.entry =
5306 std::option::Option::Some(crate::model::search_result::Entry::Directory(v.into()));
5307 self
5308 }
5309}
5310
5311impl wkt::message::Message for SearchResult {
5312 fn typename() -> &'static str {
5313 "type.googleapis.com/google.cloud.dataform.v1.SearchResult"
5314 }
5315}
5316
5317/// Defines additional types related to [SearchResult].
5318pub mod search_result {
5319 #[allow(unused_imports)]
5320 use super::*;
5321
5322 /// The entry's contents.
5323 #[derive(Clone, Debug, PartialEq)]
5324 #[non_exhaustive]
5325 pub enum Entry {
5326 /// Details when search result is a file.
5327 File(std::boxed::Box<crate::model::FileSearchResult>),
5328 /// Details when search result is a directory.
5329 Directory(std::boxed::Box<crate::model::DirectorySearchResult>),
5330 }
5331}
5332
5333/// Client-facing representation of a file entry in search results.
5334#[derive(Clone, Default, PartialEq)]
5335#[non_exhaustive]
5336pub struct FileSearchResult {
5337 /// File system path relative to the workspace root.
5338 pub path: std::string::String,
5339
5340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5341}
5342
5343impl FileSearchResult {
5344 /// Creates a new default instance.
5345 pub fn new() -> Self {
5346 std::default::Default::default()
5347 }
5348
5349 /// Sets the value of [path][crate::model::FileSearchResult::path].
5350 ///
5351 /// # Example
5352 /// ```ignore,no_run
5353 /// # use google_cloud_dataform_v1::model::FileSearchResult;
5354 /// let x = FileSearchResult::new().set_path("example");
5355 /// ```
5356 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5357 self.path = v.into();
5358 self
5359 }
5360}
5361
5362impl wkt::message::Message for FileSearchResult {
5363 fn typename() -> &'static str {
5364 "type.googleapis.com/google.cloud.dataform.v1.FileSearchResult"
5365 }
5366}
5367
5368/// Client-facing representation of a directory entry in search results.
5369#[derive(Clone, Default, PartialEq)]
5370#[non_exhaustive]
5371pub struct DirectorySearchResult {
5372 /// File system path relative to the workspace root.
5373 pub path: std::string::String,
5374
5375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5376}
5377
5378impl DirectorySearchResult {
5379 /// Creates a new default instance.
5380 pub fn new() -> Self {
5381 std::default::Default::default()
5382 }
5383
5384 /// Sets the value of [path][crate::model::DirectorySearchResult::path].
5385 ///
5386 /// # Example
5387 /// ```ignore,no_run
5388 /// # use google_cloud_dataform_v1::model::DirectorySearchResult;
5389 /// let x = DirectorySearchResult::new().set_path("example");
5390 /// ```
5391 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5392 self.path = v.into();
5393 self
5394 }
5395}
5396
5397impl wkt::message::Message for DirectorySearchResult {
5398 fn typename() -> &'static str {
5399 "type.googleapis.com/google.cloud.dataform.v1.DirectorySearchResult"
5400 }
5401}
5402
5403/// `MakeDirectory` request message.
5404#[derive(Clone, Default, PartialEq)]
5405#[non_exhaustive]
5406pub struct MakeDirectoryRequest {
5407 /// Required. The workspace's name.
5408 pub workspace: std::string::String,
5409
5410 /// Required. The directory's full path including directory name, relative to
5411 /// the workspace root.
5412 pub path: std::string::String,
5413
5414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5415}
5416
5417impl MakeDirectoryRequest {
5418 /// Creates a new default instance.
5419 pub fn new() -> Self {
5420 std::default::Default::default()
5421 }
5422
5423 /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
5424 ///
5425 /// # Example
5426 /// ```ignore,no_run
5427 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5428 /// # let project_id = "project_id";
5429 /// # let location_id = "location_id";
5430 /// # let repository_id = "repository_id";
5431 /// # let workspace_id = "workspace_id";
5432 /// let x = MakeDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5433 /// ```
5434 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5435 self.workspace = v.into();
5436 self
5437 }
5438
5439 /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
5440 ///
5441 /// # Example
5442 /// ```ignore,no_run
5443 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5444 /// let x = MakeDirectoryRequest::new().set_path("example");
5445 /// ```
5446 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5447 self.path = v.into();
5448 self
5449 }
5450}
5451
5452impl wkt::message::Message for MakeDirectoryRequest {
5453 fn typename() -> &'static str {
5454 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryRequest"
5455 }
5456}
5457
5458/// `MakeDirectory` response message.
5459#[derive(Clone, Default, PartialEq)]
5460#[non_exhaustive]
5461pub struct MakeDirectoryResponse {
5462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5463}
5464
5465impl MakeDirectoryResponse {
5466 /// Creates a new default instance.
5467 pub fn new() -> Self {
5468 std::default::Default::default()
5469 }
5470}
5471
5472impl wkt::message::Message for MakeDirectoryResponse {
5473 fn typename() -> &'static str {
5474 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryResponse"
5475 }
5476}
5477
5478/// `RemoveDirectory` request message.
5479#[derive(Clone, Default, PartialEq)]
5480#[non_exhaustive]
5481pub struct RemoveDirectoryRequest {
5482 /// Required. The workspace's name.
5483 pub workspace: std::string::String,
5484
5485 /// Required. The directory's full path including directory name, relative to
5486 /// the workspace root.
5487 pub path: std::string::String,
5488
5489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5490}
5491
5492impl RemoveDirectoryRequest {
5493 /// Creates a new default instance.
5494 pub fn new() -> Self {
5495 std::default::Default::default()
5496 }
5497
5498 /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
5499 ///
5500 /// # Example
5501 /// ```ignore,no_run
5502 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5503 /// # let project_id = "project_id";
5504 /// # let location_id = "location_id";
5505 /// # let repository_id = "repository_id";
5506 /// # let workspace_id = "workspace_id";
5507 /// let x = RemoveDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5508 /// ```
5509 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5510 self.workspace = v.into();
5511 self
5512 }
5513
5514 /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
5515 ///
5516 /// # Example
5517 /// ```ignore,no_run
5518 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5519 /// let x = RemoveDirectoryRequest::new().set_path("example");
5520 /// ```
5521 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5522 self.path = v.into();
5523 self
5524 }
5525}
5526
5527impl wkt::message::Message for RemoveDirectoryRequest {
5528 fn typename() -> &'static str {
5529 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryRequest"
5530 }
5531}
5532
5533/// `RemoveDirectory` response message.
5534#[derive(Clone, Default, PartialEq)]
5535#[non_exhaustive]
5536pub struct RemoveDirectoryResponse {
5537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5538}
5539
5540impl RemoveDirectoryResponse {
5541 /// Creates a new default instance.
5542 pub fn new() -> Self {
5543 std::default::Default::default()
5544 }
5545}
5546
5547impl wkt::message::Message for RemoveDirectoryResponse {
5548 fn typename() -> &'static str {
5549 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryResponse"
5550 }
5551}
5552
5553/// `MoveDirectory` request message.
5554#[derive(Clone, Default, PartialEq)]
5555#[non_exhaustive]
5556pub struct MoveDirectoryRequest {
5557 /// Required. The workspace's name.
5558 pub workspace: std::string::String,
5559
5560 /// Required. The directory's full path including directory name, relative to
5561 /// the workspace root.
5562 pub path: std::string::String,
5563
5564 /// Required. The new path for the directory including directory name, rooted
5565 /// at workspace root.
5566 pub new_path: std::string::String,
5567
5568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5569}
5570
5571impl MoveDirectoryRequest {
5572 /// Creates a new default instance.
5573 pub fn new() -> Self {
5574 std::default::Default::default()
5575 }
5576
5577 /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
5578 ///
5579 /// # Example
5580 /// ```ignore,no_run
5581 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5582 /// # let project_id = "project_id";
5583 /// # let location_id = "location_id";
5584 /// # let repository_id = "repository_id";
5585 /// # let workspace_id = "workspace_id";
5586 /// let x = MoveDirectoryRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5587 /// ```
5588 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5589 self.workspace = v.into();
5590 self
5591 }
5592
5593 /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
5594 ///
5595 /// # Example
5596 /// ```ignore,no_run
5597 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5598 /// let x = MoveDirectoryRequest::new().set_path("example");
5599 /// ```
5600 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5601 self.path = v.into();
5602 self
5603 }
5604
5605 /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
5606 ///
5607 /// # Example
5608 /// ```ignore,no_run
5609 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5610 /// let x = MoveDirectoryRequest::new().set_new_path("example");
5611 /// ```
5612 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5613 self.new_path = v.into();
5614 self
5615 }
5616}
5617
5618impl wkt::message::Message for MoveDirectoryRequest {
5619 fn typename() -> &'static str {
5620 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryRequest"
5621 }
5622}
5623
5624/// `MoveDirectory` response message.
5625#[derive(Clone, Default, PartialEq)]
5626#[non_exhaustive]
5627pub struct MoveDirectoryResponse {
5628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5629}
5630
5631impl MoveDirectoryResponse {
5632 /// Creates a new default instance.
5633 pub fn new() -> Self {
5634 std::default::Default::default()
5635 }
5636}
5637
5638impl wkt::message::Message for MoveDirectoryResponse {
5639 fn typename() -> &'static str {
5640 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryResponse"
5641 }
5642}
5643
5644/// `ReadFile` request message.
5645#[derive(Clone, Default, PartialEq)]
5646#[non_exhaustive]
5647pub struct ReadFileRequest {
5648 /// Required. The workspace's name.
5649 pub workspace: std::string::String,
5650
5651 /// Required. The file's full path including filename, relative to the
5652 /// workspace root.
5653 pub path: std::string::String,
5654
5655 /// Optional. The Git revision of the file to return. If left empty, the
5656 /// current contents of `path` will be returned.
5657 pub revision: std::string::String,
5658
5659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5660}
5661
5662impl ReadFileRequest {
5663 /// Creates a new default instance.
5664 pub fn new() -> Self {
5665 std::default::Default::default()
5666 }
5667
5668 /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
5669 ///
5670 /// # Example
5671 /// ```ignore,no_run
5672 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5673 /// # let project_id = "project_id";
5674 /// # let location_id = "location_id";
5675 /// # let repository_id = "repository_id";
5676 /// # let workspace_id = "workspace_id";
5677 /// let x = ReadFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5678 /// ```
5679 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5680 self.workspace = v.into();
5681 self
5682 }
5683
5684 /// Sets the value of [path][crate::model::ReadFileRequest::path].
5685 ///
5686 /// # Example
5687 /// ```ignore,no_run
5688 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5689 /// let x = ReadFileRequest::new().set_path("example");
5690 /// ```
5691 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5692 self.path = v.into();
5693 self
5694 }
5695
5696 /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
5697 ///
5698 /// # Example
5699 /// ```ignore,no_run
5700 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5701 /// let x = ReadFileRequest::new().set_revision("example");
5702 /// ```
5703 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5704 self.revision = v.into();
5705 self
5706 }
5707}
5708
5709impl wkt::message::Message for ReadFileRequest {
5710 fn typename() -> &'static str {
5711 "type.googleapis.com/google.cloud.dataform.v1.ReadFileRequest"
5712 }
5713}
5714
5715/// `ReadFile` response message.
5716#[derive(Clone, Default, PartialEq)]
5717#[non_exhaustive]
5718pub struct ReadFileResponse {
5719 /// The file's contents.
5720 pub file_contents: ::bytes::Bytes,
5721
5722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5723}
5724
5725impl ReadFileResponse {
5726 /// Creates a new default instance.
5727 pub fn new() -> Self {
5728 std::default::Default::default()
5729 }
5730
5731 /// Sets the value of [file_contents][crate::model::ReadFileResponse::file_contents].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_dataform_v1::model::ReadFileResponse;
5736 /// let x = ReadFileResponse::new().set_file_contents(bytes::Bytes::from_static(b"example"));
5737 /// ```
5738 pub fn set_file_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5739 self.file_contents = v.into();
5740 self
5741 }
5742}
5743
5744impl wkt::message::Message for ReadFileResponse {
5745 fn typename() -> &'static str {
5746 "type.googleapis.com/google.cloud.dataform.v1.ReadFileResponse"
5747 }
5748}
5749
5750/// `RemoveFile` request message.
5751#[derive(Clone, Default, PartialEq)]
5752#[non_exhaustive]
5753pub struct RemoveFileRequest {
5754 /// Required. The workspace's name.
5755 pub workspace: std::string::String,
5756
5757 /// Required. The file's full path including filename, relative to the
5758 /// workspace root.
5759 pub path: std::string::String,
5760
5761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5762}
5763
5764impl RemoveFileRequest {
5765 /// Creates a new default instance.
5766 pub fn new() -> Self {
5767 std::default::Default::default()
5768 }
5769
5770 /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
5771 ///
5772 /// # Example
5773 /// ```ignore,no_run
5774 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5775 /// # let project_id = "project_id";
5776 /// # let location_id = "location_id";
5777 /// # let repository_id = "repository_id";
5778 /// # let workspace_id = "workspace_id";
5779 /// let x = RemoveFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5780 /// ```
5781 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5782 self.workspace = v.into();
5783 self
5784 }
5785
5786 /// Sets the value of [path][crate::model::RemoveFileRequest::path].
5787 ///
5788 /// # Example
5789 /// ```ignore,no_run
5790 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5791 /// let x = RemoveFileRequest::new().set_path("example");
5792 /// ```
5793 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5794 self.path = v.into();
5795 self
5796 }
5797}
5798
5799impl wkt::message::Message for RemoveFileRequest {
5800 fn typename() -> &'static str {
5801 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileRequest"
5802 }
5803}
5804
5805/// `RemoveFile` response message.
5806#[derive(Clone, Default, PartialEq)]
5807#[non_exhaustive]
5808pub struct RemoveFileResponse {
5809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5810}
5811
5812impl RemoveFileResponse {
5813 /// Creates a new default instance.
5814 pub fn new() -> Self {
5815 std::default::Default::default()
5816 }
5817}
5818
5819impl wkt::message::Message for RemoveFileResponse {
5820 fn typename() -> &'static str {
5821 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileResponse"
5822 }
5823}
5824
5825/// `MoveFile` request message.
5826#[derive(Clone, Default, PartialEq)]
5827#[non_exhaustive]
5828pub struct MoveFileRequest {
5829 /// Required. The workspace's name.
5830 pub workspace: std::string::String,
5831
5832 /// Required. The file's full path including filename, relative to the
5833 /// workspace root.
5834 pub path: std::string::String,
5835
5836 /// Required. The file's new path including filename, relative to the workspace
5837 /// root.
5838 pub new_path: std::string::String,
5839
5840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5841}
5842
5843impl MoveFileRequest {
5844 /// Creates a new default instance.
5845 pub fn new() -> Self {
5846 std::default::Default::default()
5847 }
5848
5849 /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
5850 ///
5851 /// # Example
5852 /// ```ignore,no_run
5853 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5854 /// # let project_id = "project_id";
5855 /// # let location_id = "location_id";
5856 /// # let repository_id = "repository_id";
5857 /// # let workspace_id = "workspace_id";
5858 /// let x = MoveFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5859 /// ```
5860 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5861 self.workspace = v.into();
5862 self
5863 }
5864
5865 /// Sets the value of [path][crate::model::MoveFileRequest::path].
5866 ///
5867 /// # Example
5868 /// ```ignore,no_run
5869 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5870 /// let x = MoveFileRequest::new().set_path("example");
5871 /// ```
5872 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5873 self.path = v.into();
5874 self
5875 }
5876
5877 /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
5878 ///
5879 /// # Example
5880 /// ```ignore,no_run
5881 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5882 /// let x = MoveFileRequest::new().set_new_path("example");
5883 /// ```
5884 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5885 self.new_path = v.into();
5886 self
5887 }
5888}
5889
5890impl wkt::message::Message for MoveFileRequest {
5891 fn typename() -> &'static str {
5892 "type.googleapis.com/google.cloud.dataform.v1.MoveFileRequest"
5893 }
5894}
5895
5896/// `MoveFile` response message.
5897#[derive(Clone, Default, PartialEq)]
5898#[non_exhaustive]
5899pub struct MoveFileResponse {
5900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5901}
5902
5903impl MoveFileResponse {
5904 /// Creates a new default instance.
5905 pub fn new() -> Self {
5906 std::default::Default::default()
5907 }
5908}
5909
5910impl wkt::message::Message for MoveFileResponse {
5911 fn typename() -> &'static str {
5912 "type.googleapis.com/google.cloud.dataform.v1.MoveFileResponse"
5913 }
5914}
5915
5916/// `WriteFile` request message.
5917#[derive(Clone, Default, PartialEq)]
5918#[non_exhaustive]
5919pub struct WriteFileRequest {
5920 /// Required. The workspace's name.
5921 pub workspace: std::string::String,
5922
5923 /// Required. The file.
5924 pub path: std::string::String,
5925
5926 /// Required. The file's contents.
5927 pub contents: ::bytes::Bytes,
5928
5929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930}
5931
5932impl WriteFileRequest {
5933 /// Creates a new default instance.
5934 pub fn new() -> Self {
5935 std::default::Default::default()
5936 }
5937
5938 /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
5939 ///
5940 /// # Example
5941 /// ```ignore,no_run
5942 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5943 /// # let project_id = "project_id";
5944 /// # let location_id = "location_id";
5945 /// # let repository_id = "repository_id";
5946 /// # let workspace_id = "workspace_id";
5947 /// let x = WriteFileRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
5948 /// ```
5949 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5950 self.workspace = v.into();
5951 self
5952 }
5953
5954 /// Sets the value of [path][crate::model::WriteFileRequest::path].
5955 ///
5956 /// # Example
5957 /// ```ignore,no_run
5958 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5959 /// let x = WriteFileRequest::new().set_path("example");
5960 /// ```
5961 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5962 self.path = v.into();
5963 self
5964 }
5965
5966 /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
5967 ///
5968 /// # Example
5969 /// ```ignore,no_run
5970 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5971 /// let x = WriteFileRequest::new().set_contents(bytes::Bytes::from_static(b"example"));
5972 /// ```
5973 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5974 self.contents = v.into();
5975 self
5976 }
5977}
5978
5979impl wkt::message::Message for WriteFileRequest {
5980 fn typename() -> &'static str {
5981 "type.googleapis.com/google.cloud.dataform.v1.WriteFileRequest"
5982 }
5983}
5984
5985/// `WriteFile` response message.
5986#[derive(Clone, Default, PartialEq)]
5987#[non_exhaustive]
5988pub struct WriteFileResponse {
5989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5990}
5991
5992impl WriteFileResponse {
5993 /// Creates a new default instance.
5994 pub fn new() -> Self {
5995 std::default::Default::default()
5996 }
5997}
5998
5999impl wkt::message::Message for WriteFileResponse {
6000 fn typename() -> &'static str {
6001 "type.googleapis.com/google.cloud.dataform.v1.WriteFileResponse"
6002 }
6003}
6004
6005/// `InstallNpmPackages` request message.
6006#[derive(Clone, Default, PartialEq)]
6007#[non_exhaustive]
6008pub struct InstallNpmPackagesRequest {
6009 /// Required. The workspace's name.
6010 pub workspace: std::string::String,
6011
6012 /// Optional. The pipeline options which defines the pipeline type and path
6013 /// within the Git repository.
6014 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
6015
6016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6017}
6018
6019impl InstallNpmPackagesRequest {
6020 /// Creates a new default instance.
6021 pub fn new() -> Self {
6022 std::default::Default::default()
6023 }
6024
6025 /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
6026 ///
6027 /// # Example
6028 /// ```ignore,no_run
6029 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
6030 /// # let project_id = "project_id";
6031 /// # let location_id = "location_id";
6032 /// # let repository_id = "repository_id";
6033 /// # let workspace_id = "workspace_id";
6034 /// let x = InstallNpmPackagesRequest::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
6035 /// ```
6036 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6037 self.workspace = v.into();
6038 self
6039 }
6040
6041 /// Sets the value of [pipeline_config][crate::model::InstallNpmPackagesRequest::pipeline_config].
6042 ///
6043 /// # Example
6044 /// ```ignore,no_run
6045 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
6046 /// use google_cloud_dataform_v1::model::PipelineConfig;
6047 /// let x = InstallNpmPackagesRequest::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
6048 /// ```
6049 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
6050 where
6051 T: std::convert::Into<crate::model::PipelineConfig>,
6052 {
6053 self.pipeline_config = std::option::Option::Some(v.into());
6054 self
6055 }
6056
6057 /// Sets or clears the value of [pipeline_config][crate::model::InstallNpmPackagesRequest::pipeline_config].
6058 ///
6059 /// # Example
6060 /// ```ignore,no_run
6061 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
6062 /// use google_cloud_dataform_v1::model::PipelineConfig;
6063 /// let x = InstallNpmPackagesRequest::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
6064 /// let x = InstallNpmPackagesRequest::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
6065 /// ```
6066 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
6067 where
6068 T: std::convert::Into<crate::model::PipelineConfig>,
6069 {
6070 self.pipeline_config = v.map(|x| x.into());
6071 self
6072 }
6073}
6074
6075impl wkt::message::Message for InstallNpmPackagesRequest {
6076 fn typename() -> &'static str {
6077 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesRequest"
6078 }
6079}
6080
6081/// `InstallNpmPackages` response message.
6082#[derive(Clone, Default, PartialEq)]
6083#[non_exhaustive]
6084pub struct InstallNpmPackagesResponse {
6085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6086}
6087
6088impl InstallNpmPackagesResponse {
6089 /// Creates a new default instance.
6090 pub fn new() -> Self {
6091 std::default::Default::default()
6092 }
6093}
6094
6095impl wkt::message::Message for InstallNpmPackagesResponse {
6096 fn typename() -> &'static str {
6097 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesResponse"
6098 }
6099}
6100
6101/// Represents a Dataform release configuration.
6102#[derive(Clone, Default, PartialEq)]
6103#[non_exhaustive]
6104pub struct ReleaseConfig {
6105 /// Identifier. The release config's name.
6106 pub name: std::string::String,
6107
6108 /// Required. Git commit/tag/branch name at which the repository should be
6109 /// compiled. Must exist in the remote repository. Examples:
6110 ///
6111 /// - a commit SHA: `12ade345`
6112 /// - a tag: `tag1`
6113 /// - a branch name: `branch1`
6114 pub git_commitish: std::string::String,
6115
6116 /// Optional. If set, fields of `code_compilation_config` override the default
6117 /// compilation settings that are specified in dataform.json.
6118 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
6119
6120 /// Optional. Optional schedule (in cron format) for automatic creation of
6121 /// compilation results.
6122 pub cron_schedule: std::string::String,
6123
6124 /// Optional. Specifies the time zone to be used when interpreting
6125 /// cron_schedule. Must be a time zone name from the [time zone
6126 /// database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If
6127 /// left unspecified, the default is `UTC`.
6128 pub time_zone: std::string::String,
6129
6130 /// Output only. Records of the 10 most recent scheduled release attempts,
6131 /// ordered in descending order of `release_time`. Updated whenever automatic
6132 /// creation of a compilation result is triggered by cron_schedule.
6133 pub recent_scheduled_release_records:
6134 std::vec::Vec<crate::model::release_config::ScheduledReleaseRecord>,
6135
6136 /// Optional. The name of the currently released compilation result for this
6137 /// release config. This value is updated when a compilation result is
6138 /// automatically created from this release config (using cron_schedule), or
6139 /// when this resource is updated by API call (perhaps to roll back to an
6140 /// earlier release). The compilation result must have been created using this
6141 /// release config. Must be in the format
6142 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
6143 pub release_compilation_result: std::string::String,
6144
6145 /// Optional. Disables automatic creation of compilation results.
6146 pub disabled: bool,
6147
6148 /// Output only. All the metadata information that is used internally to serve
6149 /// the resource. For example: timestamps, flags, status fields, etc. The
6150 /// format of this field is a JSON string.
6151 pub internal_metadata: std::option::Option<std::string::String>,
6152
6153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6154}
6155
6156impl ReleaseConfig {
6157 /// Creates a new default instance.
6158 pub fn new() -> Self {
6159 std::default::Default::default()
6160 }
6161
6162 /// Sets the value of [name][crate::model::ReleaseConfig::name].
6163 ///
6164 /// # Example
6165 /// ```ignore,no_run
6166 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6167 /// # let project_id = "project_id";
6168 /// # let location_id = "location_id";
6169 /// # let repository_id = "repository_id";
6170 /// # let release_config_id = "release_config_id";
6171 /// let x = ReleaseConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6172 /// ```
6173 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6174 self.name = v.into();
6175 self
6176 }
6177
6178 /// Sets the value of [git_commitish][crate::model::ReleaseConfig::git_commitish].
6179 ///
6180 /// # Example
6181 /// ```ignore,no_run
6182 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6183 /// let x = ReleaseConfig::new().set_git_commitish("example");
6184 /// ```
6185 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6186 self.git_commitish = v.into();
6187 self
6188 }
6189
6190 /// Sets the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
6191 ///
6192 /// # Example
6193 /// ```ignore,no_run
6194 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6195 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6196 /// let x = ReleaseConfig::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
6197 /// ```
6198 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
6199 where
6200 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6201 {
6202 self.code_compilation_config = std::option::Option::Some(v.into());
6203 self
6204 }
6205
6206 /// Sets or clears the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
6207 ///
6208 /// # Example
6209 /// ```ignore,no_run
6210 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6211 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6212 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
6213 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
6214 /// ```
6215 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
6216 where
6217 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6218 {
6219 self.code_compilation_config = v.map(|x| x.into());
6220 self
6221 }
6222
6223 /// Sets the value of [cron_schedule][crate::model::ReleaseConfig::cron_schedule].
6224 ///
6225 /// # Example
6226 /// ```ignore,no_run
6227 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6228 /// let x = ReleaseConfig::new().set_cron_schedule("example");
6229 /// ```
6230 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6231 self.cron_schedule = v.into();
6232 self
6233 }
6234
6235 /// Sets the value of [time_zone][crate::model::ReleaseConfig::time_zone].
6236 ///
6237 /// # Example
6238 /// ```ignore,no_run
6239 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6240 /// let x = ReleaseConfig::new().set_time_zone("example");
6241 /// ```
6242 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6243 self.time_zone = v.into();
6244 self
6245 }
6246
6247 /// Sets the value of [recent_scheduled_release_records][crate::model::ReleaseConfig::recent_scheduled_release_records].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6252 /// use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6253 /// let x = ReleaseConfig::new()
6254 /// .set_recent_scheduled_release_records([
6255 /// ScheduledReleaseRecord::default()/* use setters */,
6256 /// ScheduledReleaseRecord::default()/* use (different) setters */,
6257 /// ]);
6258 /// ```
6259 pub fn set_recent_scheduled_release_records<T, V>(mut self, v: T) -> Self
6260 where
6261 T: std::iter::IntoIterator<Item = V>,
6262 V: std::convert::Into<crate::model::release_config::ScheduledReleaseRecord>,
6263 {
6264 use std::iter::Iterator;
6265 self.recent_scheduled_release_records = v.into_iter().map(|i| i.into()).collect();
6266 self
6267 }
6268
6269 /// Sets the value of [release_compilation_result][crate::model::ReleaseConfig::release_compilation_result].
6270 ///
6271 /// # Example
6272 /// ```ignore,no_run
6273 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6274 /// # let project_id = "project_id";
6275 /// # let location_id = "location_id";
6276 /// # let repository_id = "repository_id";
6277 /// # let compilation_result_id = "compilation_result_id";
6278 /// let x = ReleaseConfig::new().set_release_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
6279 /// ```
6280 pub fn set_release_compilation_result<T: std::convert::Into<std::string::String>>(
6281 mut self,
6282 v: T,
6283 ) -> Self {
6284 self.release_compilation_result = v.into();
6285 self
6286 }
6287
6288 /// Sets the value of [disabled][crate::model::ReleaseConfig::disabled].
6289 ///
6290 /// # Example
6291 /// ```ignore,no_run
6292 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6293 /// let x = ReleaseConfig::new().set_disabled(true);
6294 /// ```
6295 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6296 self.disabled = v.into();
6297 self
6298 }
6299
6300 /// Sets the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
6301 ///
6302 /// # Example
6303 /// ```ignore,no_run
6304 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6305 /// let x = ReleaseConfig::new().set_internal_metadata("example");
6306 /// ```
6307 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
6308 where
6309 T: std::convert::Into<std::string::String>,
6310 {
6311 self.internal_metadata = std::option::Option::Some(v.into());
6312 self
6313 }
6314
6315 /// Sets or clears the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
6316 ///
6317 /// # Example
6318 /// ```ignore,no_run
6319 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
6320 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(Some("example"));
6321 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(None::<String>);
6322 /// ```
6323 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6324 where
6325 T: std::convert::Into<std::string::String>,
6326 {
6327 self.internal_metadata = v.map(|x| x.into());
6328 self
6329 }
6330}
6331
6332impl wkt::message::Message for ReleaseConfig {
6333 fn typename() -> &'static str {
6334 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig"
6335 }
6336}
6337
6338/// Defines additional types related to [ReleaseConfig].
6339pub mod release_config {
6340 #[allow(unused_imports)]
6341 use super::*;
6342
6343 /// A record of an attempt to create a compilation result for this release
6344 /// config.
6345 #[derive(Clone, Default, PartialEq)]
6346 #[non_exhaustive]
6347 pub struct ScheduledReleaseRecord {
6348 /// Output only. The timestamp of this release attempt.
6349 pub release_time: std::option::Option<wkt::Timestamp>,
6350
6351 /// The result of this release attempt.
6352 pub result:
6353 std::option::Option<crate::model::release_config::scheduled_release_record::Result>,
6354
6355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6356 }
6357
6358 impl ScheduledReleaseRecord {
6359 /// Creates a new default instance.
6360 pub fn new() -> Self {
6361 std::default::Default::default()
6362 }
6363
6364 /// Sets the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
6365 ///
6366 /// # Example
6367 /// ```ignore,no_run
6368 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6369 /// use wkt::Timestamp;
6370 /// let x = ScheduledReleaseRecord::new().set_release_time(Timestamp::default()/* use setters */);
6371 /// ```
6372 pub fn set_release_time<T>(mut self, v: T) -> Self
6373 where
6374 T: std::convert::Into<wkt::Timestamp>,
6375 {
6376 self.release_time = std::option::Option::Some(v.into());
6377 self
6378 }
6379
6380 /// Sets or clears the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
6381 ///
6382 /// # Example
6383 /// ```ignore,no_run
6384 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6385 /// use wkt::Timestamp;
6386 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(Some(Timestamp::default()/* use setters */));
6387 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(None::<Timestamp>);
6388 /// ```
6389 pub fn set_or_clear_release_time<T>(mut self, v: std::option::Option<T>) -> Self
6390 where
6391 T: std::convert::Into<wkt::Timestamp>,
6392 {
6393 self.release_time = v.map(|x| x.into());
6394 self
6395 }
6396
6397 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result].
6398 ///
6399 /// Note that all the setters affecting `result` are mutually
6400 /// exclusive.
6401 ///
6402 /// # Example
6403 /// ```ignore,no_run
6404 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6405 /// use google_cloud_dataform_v1::model::release_config::scheduled_release_record::Result;
6406 /// let x = ScheduledReleaseRecord::new().set_result(Some(Result::CompilationResult("example".to_string())));
6407 /// ```
6408 pub fn set_result<
6409 T: std::convert::Into<
6410 std::option::Option<
6411 crate::model::release_config::scheduled_release_record::Result,
6412 >,
6413 >,
6414 >(
6415 mut self,
6416 v: T,
6417 ) -> Self {
6418 self.result = v.into();
6419 self
6420 }
6421
6422 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6423 /// if it holds a `CompilationResult`, `None` if the field is not set or
6424 /// holds a different branch.
6425 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
6426 #[allow(unreachable_patterns)]
6427 self.result.as_ref().and_then(|v| match v {
6428 crate::model::release_config::scheduled_release_record::Result::CompilationResult(v) => std::option::Option::Some(v),
6429 _ => std::option::Option::None,
6430 })
6431 }
6432
6433 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6434 /// to hold a `CompilationResult`.
6435 ///
6436 /// Note that all the setters affecting `result` are
6437 /// mutually exclusive.
6438 ///
6439 /// # Example
6440 /// ```ignore,no_run
6441 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6442 /// # let project_id = "project_id";
6443 /// # let location_id = "location_id";
6444 /// # let repository_id = "repository_id";
6445 /// # let compilation_result_id = "compilation_result_id";
6446 /// let x = ScheduledReleaseRecord::new().set_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
6447 /// assert!(x.compilation_result().is_some());
6448 /// assert!(x.error_status().is_none());
6449 /// ```
6450 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
6451 mut self,
6452 v: T,
6453 ) -> Self {
6454 self.result = std::option::Option::Some(
6455 crate::model::release_config::scheduled_release_record::Result::CompilationResult(
6456 v.into(),
6457 ),
6458 );
6459 self
6460 }
6461
6462 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6463 /// if it holds a `ErrorStatus`, `None` if the field is not set or
6464 /// holds a different branch.
6465 pub fn error_status(
6466 &self,
6467 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
6468 #[allow(unreachable_patterns)]
6469 self.result.as_ref().and_then(|v| match v {
6470 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(v) => {
6471 std::option::Option::Some(v)
6472 }
6473 _ => std::option::Option::None,
6474 })
6475 }
6476
6477 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6478 /// to hold a `ErrorStatus`.
6479 ///
6480 /// Note that all the setters affecting `result` are
6481 /// mutually exclusive.
6482 ///
6483 /// # Example
6484 /// ```ignore,no_run
6485 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6486 /// use google_cloud_rpc::model::Status;
6487 /// let x = ScheduledReleaseRecord::new().set_error_status(Status::default()/* use setters */);
6488 /// assert!(x.error_status().is_some());
6489 /// assert!(x.compilation_result().is_none());
6490 /// ```
6491 pub fn set_error_status<
6492 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6493 >(
6494 mut self,
6495 v: T,
6496 ) -> Self {
6497 self.result = std::option::Option::Some(
6498 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(
6499 v.into(),
6500 ),
6501 );
6502 self
6503 }
6504 }
6505
6506 impl wkt::message::Message for ScheduledReleaseRecord {
6507 fn typename() -> &'static str {
6508 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig.ScheduledReleaseRecord"
6509 }
6510 }
6511
6512 /// Defines additional types related to [ScheduledReleaseRecord].
6513 pub mod scheduled_release_record {
6514 #[allow(unused_imports)]
6515 use super::*;
6516
6517 /// The result of this release attempt.
6518 #[derive(Clone, Debug, PartialEq)]
6519 #[non_exhaustive]
6520 pub enum Result {
6521 /// The name of the created compilation result, if one was successfully
6522 /// created. Must be in the format
6523 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
6524 CompilationResult(std::string::String),
6525 /// The error status encountered upon this attempt to create the
6526 /// compilation result, if the attempt was unsuccessful.
6527 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
6528 }
6529 }
6530}
6531
6532/// `ListReleaseConfigs` request message.
6533#[derive(Clone, Default, PartialEq)]
6534#[non_exhaustive]
6535pub struct ListReleaseConfigsRequest {
6536 /// Required. The repository in which to list release configs. Must be in the
6537 /// format `projects/*/locations/*/repositories/*`.
6538 pub parent: std::string::String,
6539
6540 /// Optional. Maximum number of release configs to return. The server may
6541 /// return fewer items than requested. If unspecified, the server will pick an
6542 /// appropriate default.
6543 pub page_size: i32,
6544
6545 /// Optional. Page token received from a previous `ListReleaseConfigs` call.
6546 /// Provide this to retrieve the subsequent page.
6547 ///
6548 /// When paginating, all other parameters provided to `ListReleaseConfigs`,
6549 /// with the exception of `page_size`, must match the call that provided the
6550 /// page token.
6551 pub page_token: std::string::String,
6552
6553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6554}
6555
6556impl ListReleaseConfigsRequest {
6557 /// Creates a new default instance.
6558 pub fn new() -> Self {
6559 std::default::Default::default()
6560 }
6561
6562 /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
6563 ///
6564 /// # Example
6565 /// ```ignore,no_run
6566 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6567 /// # let project_id = "project_id";
6568 /// # let location_id = "location_id";
6569 /// # let repository_id = "repository_id";
6570 /// let x = ListReleaseConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6571 /// ```
6572 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6573 self.parent = v.into();
6574 self
6575 }
6576
6577 /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
6578 ///
6579 /// # Example
6580 /// ```ignore,no_run
6581 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6582 /// let x = ListReleaseConfigsRequest::new().set_page_size(42);
6583 /// ```
6584 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6585 self.page_size = v.into();
6586 self
6587 }
6588
6589 /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
6590 ///
6591 /// # Example
6592 /// ```ignore,no_run
6593 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6594 /// let x = ListReleaseConfigsRequest::new().set_page_token("example");
6595 /// ```
6596 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6597 self.page_token = v.into();
6598 self
6599 }
6600}
6601
6602impl wkt::message::Message for ListReleaseConfigsRequest {
6603 fn typename() -> &'static str {
6604 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsRequest"
6605 }
6606}
6607
6608/// `ListReleaseConfigs` response message.
6609#[derive(Clone, Default, PartialEq)]
6610#[non_exhaustive]
6611pub struct ListReleaseConfigsResponse {
6612 /// List of release configs.
6613 pub release_configs: std::vec::Vec<crate::model::ReleaseConfig>,
6614
6615 /// A token, which can be sent as `page_token` to retrieve the next page.
6616 /// If this field is omitted, there are no subsequent pages.
6617 pub next_page_token: std::string::String,
6618
6619 /// Locations which could not be reached.
6620 pub unreachable: std::vec::Vec<std::string::String>,
6621
6622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6623}
6624
6625impl ListReleaseConfigsResponse {
6626 /// Creates a new default instance.
6627 pub fn new() -> Self {
6628 std::default::Default::default()
6629 }
6630
6631 /// Sets the value of [release_configs][crate::model::ListReleaseConfigsResponse::release_configs].
6632 ///
6633 /// # Example
6634 /// ```ignore,no_run
6635 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6636 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6637 /// let x = ListReleaseConfigsResponse::new()
6638 /// .set_release_configs([
6639 /// ReleaseConfig::default()/* use setters */,
6640 /// ReleaseConfig::default()/* use (different) setters */,
6641 /// ]);
6642 /// ```
6643 pub fn set_release_configs<T, V>(mut self, v: T) -> Self
6644 where
6645 T: std::iter::IntoIterator<Item = V>,
6646 V: std::convert::Into<crate::model::ReleaseConfig>,
6647 {
6648 use std::iter::Iterator;
6649 self.release_configs = v.into_iter().map(|i| i.into()).collect();
6650 self
6651 }
6652
6653 /// Sets the value of [next_page_token][crate::model::ListReleaseConfigsResponse::next_page_token].
6654 ///
6655 /// # Example
6656 /// ```ignore,no_run
6657 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6658 /// let x = ListReleaseConfigsResponse::new().set_next_page_token("example");
6659 /// ```
6660 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6661 self.next_page_token = v.into();
6662 self
6663 }
6664
6665 /// Sets the value of [unreachable][crate::model::ListReleaseConfigsResponse::unreachable].
6666 ///
6667 /// # Example
6668 /// ```ignore,no_run
6669 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6670 /// let x = ListReleaseConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6671 /// ```
6672 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6673 where
6674 T: std::iter::IntoIterator<Item = V>,
6675 V: std::convert::Into<std::string::String>,
6676 {
6677 use std::iter::Iterator;
6678 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6679 self
6680 }
6681}
6682
6683impl wkt::message::Message for ListReleaseConfigsResponse {
6684 fn typename() -> &'static str {
6685 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsResponse"
6686 }
6687}
6688
6689#[doc(hidden)]
6690impl google_cloud_gax::paginator::internal::PageableResponse for ListReleaseConfigsResponse {
6691 type PageItem = crate::model::ReleaseConfig;
6692
6693 fn items(self) -> std::vec::Vec<Self::PageItem> {
6694 self.release_configs
6695 }
6696
6697 fn next_page_token(&self) -> std::string::String {
6698 use std::clone::Clone;
6699 self.next_page_token.clone()
6700 }
6701}
6702
6703/// `GetReleaseConfig` request message.
6704#[derive(Clone, Default, PartialEq)]
6705#[non_exhaustive]
6706pub struct GetReleaseConfigRequest {
6707 /// Required. The release config's name.
6708 pub name: std::string::String,
6709
6710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6711}
6712
6713impl GetReleaseConfigRequest {
6714 /// Creates a new default instance.
6715 pub fn new() -> Self {
6716 std::default::Default::default()
6717 }
6718
6719 /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
6720 ///
6721 /// # Example
6722 /// ```ignore,no_run
6723 /// # use google_cloud_dataform_v1::model::GetReleaseConfigRequest;
6724 /// # let project_id = "project_id";
6725 /// # let location_id = "location_id";
6726 /// # let repository_id = "repository_id";
6727 /// # let release_config_id = "release_config_id";
6728 /// let x = GetReleaseConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6729 /// ```
6730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6731 self.name = v.into();
6732 self
6733 }
6734}
6735
6736impl wkt::message::Message for GetReleaseConfigRequest {
6737 fn typename() -> &'static str {
6738 "type.googleapis.com/google.cloud.dataform.v1.GetReleaseConfigRequest"
6739 }
6740}
6741
6742/// `CreateReleaseConfig` request message.
6743#[derive(Clone, Default, PartialEq)]
6744#[non_exhaustive]
6745pub struct CreateReleaseConfigRequest {
6746 /// Required. The repository in which to create the release config. Must be in
6747 /// the format `projects/*/locations/*/repositories/*`.
6748 pub parent: std::string::String,
6749
6750 /// Required. The release config to create.
6751 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6752
6753 /// Required. The ID to use for the release config, which will become the final
6754 /// component of the release config's resource name.
6755 pub release_config_id: std::string::String,
6756
6757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6758}
6759
6760impl CreateReleaseConfigRequest {
6761 /// Creates a new default instance.
6762 pub fn new() -> Self {
6763 std::default::Default::default()
6764 }
6765
6766 /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
6767 ///
6768 /// # Example
6769 /// ```ignore,no_run
6770 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6771 /// # let project_id = "project_id";
6772 /// # let location_id = "location_id";
6773 /// # let repository_id = "repository_id";
6774 /// let x = CreateReleaseConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6775 /// ```
6776 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6777 self.parent = v.into();
6778 self
6779 }
6780
6781 /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6782 ///
6783 /// # Example
6784 /// ```ignore,no_run
6785 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6786 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6787 /// let x = CreateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6788 /// ```
6789 pub fn set_release_config<T>(mut self, v: T) -> Self
6790 where
6791 T: std::convert::Into<crate::model::ReleaseConfig>,
6792 {
6793 self.release_config = std::option::Option::Some(v.into());
6794 self
6795 }
6796
6797 /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6798 ///
6799 /// # Example
6800 /// ```ignore,no_run
6801 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6802 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6803 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6804 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6805 /// ```
6806 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6807 where
6808 T: std::convert::Into<crate::model::ReleaseConfig>,
6809 {
6810 self.release_config = v.map(|x| x.into());
6811 self
6812 }
6813
6814 /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
6815 ///
6816 /// # Example
6817 /// ```ignore,no_run
6818 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6819 /// let x = CreateReleaseConfigRequest::new().set_release_config_id("example");
6820 /// ```
6821 pub fn set_release_config_id<T: std::convert::Into<std::string::String>>(
6822 mut self,
6823 v: T,
6824 ) -> Self {
6825 self.release_config_id = v.into();
6826 self
6827 }
6828}
6829
6830impl wkt::message::Message for CreateReleaseConfigRequest {
6831 fn typename() -> &'static str {
6832 "type.googleapis.com/google.cloud.dataform.v1.CreateReleaseConfigRequest"
6833 }
6834}
6835
6836/// `UpdateReleaseConfig` request message.
6837#[derive(Clone, Default, PartialEq)]
6838#[non_exhaustive]
6839pub struct UpdateReleaseConfigRequest {
6840 /// Optional. Specifies the fields to be updated in the release config. If left
6841 /// unset, all fields will be updated.
6842 pub update_mask: std::option::Option<wkt::FieldMask>,
6843
6844 /// Required. The release config to update.
6845 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6846
6847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6848}
6849
6850impl UpdateReleaseConfigRequest {
6851 /// Creates a new default instance.
6852 pub fn new() -> Self {
6853 std::default::Default::default()
6854 }
6855
6856 /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6857 ///
6858 /// # Example
6859 /// ```ignore,no_run
6860 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6861 /// use wkt::FieldMask;
6862 /// let x = UpdateReleaseConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6863 /// ```
6864 pub fn set_update_mask<T>(mut self, v: T) -> Self
6865 where
6866 T: std::convert::Into<wkt::FieldMask>,
6867 {
6868 self.update_mask = std::option::Option::Some(v.into());
6869 self
6870 }
6871
6872 /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6873 ///
6874 /// # Example
6875 /// ```ignore,no_run
6876 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6877 /// use wkt::FieldMask;
6878 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6879 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6880 /// ```
6881 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6882 where
6883 T: std::convert::Into<wkt::FieldMask>,
6884 {
6885 self.update_mask = v.map(|x| x.into());
6886 self
6887 }
6888
6889 /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6890 ///
6891 /// # Example
6892 /// ```ignore,no_run
6893 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6894 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6895 /// let x = UpdateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6896 /// ```
6897 pub fn set_release_config<T>(mut self, v: T) -> Self
6898 where
6899 T: std::convert::Into<crate::model::ReleaseConfig>,
6900 {
6901 self.release_config = std::option::Option::Some(v.into());
6902 self
6903 }
6904
6905 /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6906 ///
6907 /// # Example
6908 /// ```ignore,no_run
6909 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6910 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6911 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6912 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6913 /// ```
6914 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6915 where
6916 T: std::convert::Into<crate::model::ReleaseConfig>,
6917 {
6918 self.release_config = v.map(|x| x.into());
6919 self
6920 }
6921}
6922
6923impl wkt::message::Message for UpdateReleaseConfigRequest {
6924 fn typename() -> &'static str {
6925 "type.googleapis.com/google.cloud.dataform.v1.UpdateReleaseConfigRequest"
6926 }
6927}
6928
6929/// `DeleteReleaseConfig` request message.
6930#[derive(Clone, Default, PartialEq)]
6931#[non_exhaustive]
6932pub struct DeleteReleaseConfigRequest {
6933 /// Required. The release config's name.
6934 pub name: std::string::String,
6935
6936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6937}
6938
6939impl DeleteReleaseConfigRequest {
6940 /// Creates a new default instance.
6941 pub fn new() -> Self {
6942 std::default::Default::default()
6943 }
6944
6945 /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
6946 ///
6947 /// # Example
6948 /// ```ignore,no_run
6949 /// # use google_cloud_dataform_v1::model::DeleteReleaseConfigRequest;
6950 /// # let project_id = "project_id";
6951 /// # let location_id = "location_id";
6952 /// # let repository_id = "repository_id";
6953 /// # let release_config_id = "release_config_id";
6954 /// let x = DeleteReleaseConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
6955 /// ```
6956 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6957 self.name = v.into();
6958 self
6959 }
6960}
6961
6962impl wkt::message::Message for DeleteReleaseConfigRequest {
6963 fn typename() -> &'static str {
6964 "type.googleapis.com/google.cloud.dataform.v1.DeleteReleaseConfigRequest"
6965 }
6966}
6967
6968/// Represents the result of compiling a Dataform project.
6969#[derive(Clone, Default, PartialEq)]
6970#[non_exhaustive]
6971pub struct CompilationResult {
6972 /// Output only. The compilation result's name.
6973 pub name: std::string::String,
6974
6975 /// Immutable. If set, fields of `code_compilation_config` override the default
6976 /// compilation settings that are specified in dataform.json.
6977 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
6978
6979 /// Output only. The fully resolved Git commit SHA of the code that was
6980 /// compiled. Not set for compilation results whose source is a workspace.
6981 pub resolved_git_commit_sha: std::string::String,
6982
6983 /// Output only. The version of `@dataform/core` that was used for compilation.
6984 pub dataform_core_version: std::string::String,
6985
6986 /// Output only. Errors encountered during project compilation.
6987 pub compilation_errors: std::vec::Vec<crate::model::compilation_result::CompilationError>,
6988
6989 /// Output only. Only set if the repository has a KMS Key.
6990 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
6991
6992 /// Output only. The timestamp of when the compilation result was created.
6993 pub create_time: std::option::Option<wkt::Timestamp>,
6994
6995 /// Output only. All the metadata information that is used internally to serve
6996 /// the resource. For example: timestamps, flags, status fields, etc. The
6997 /// format of this field is a JSON string.
6998 pub internal_metadata: std::option::Option<std::string::String>,
6999
7000 /// Output only. Metadata indicating whether this resource is user-scoped.
7001 /// `CompilationResult` resource is `user_scoped` only if it is sourced
7002 /// from a workspace.
7003 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
7004
7005 /// Output only. Metadata about the repository snapshot used by scheduled
7006 /// notebooks.
7007 pub gcs_repository_snapshot_metadata:
7008 std::option::Option<crate::model::GcsRepositorySnapshotMetadata>,
7009
7010 /// The source of the compilation result.
7011 pub source: std::option::Option<crate::model::compilation_result::Source>,
7012
7013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7014}
7015
7016impl CompilationResult {
7017 /// Creates a new default instance.
7018 pub fn new() -> Self {
7019 std::default::Default::default()
7020 }
7021
7022 /// Sets the value of [name][crate::model::CompilationResult::name].
7023 ///
7024 /// # Example
7025 /// ```ignore,no_run
7026 /// # use google_cloud_dataform_v1::model::CompilationResult;
7027 /// # let project_id = "project_id";
7028 /// # let location_id = "location_id";
7029 /// # let repository_id = "repository_id";
7030 /// # let compilation_result_id = "compilation_result_id";
7031 /// let x = CompilationResult::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
7032 /// ```
7033 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7034 self.name = v.into();
7035 self
7036 }
7037
7038 /// Sets the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
7039 ///
7040 /// # Example
7041 /// ```ignore,no_run
7042 /// # use google_cloud_dataform_v1::model::CompilationResult;
7043 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
7044 /// let x = CompilationResult::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
7045 /// ```
7046 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
7047 where
7048 T: std::convert::Into<crate::model::CodeCompilationConfig>,
7049 {
7050 self.code_compilation_config = std::option::Option::Some(v.into());
7051 self
7052 }
7053
7054 /// Sets or clears the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
7055 ///
7056 /// # Example
7057 /// ```ignore,no_run
7058 /// # use google_cloud_dataform_v1::model::CompilationResult;
7059 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
7060 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
7061 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
7062 /// ```
7063 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
7064 where
7065 T: std::convert::Into<crate::model::CodeCompilationConfig>,
7066 {
7067 self.code_compilation_config = v.map(|x| x.into());
7068 self
7069 }
7070
7071 /// Sets the value of [resolved_git_commit_sha][crate::model::CompilationResult::resolved_git_commit_sha].
7072 ///
7073 /// # Example
7074 /// ```ignore,no_run
7075 /// # use google_cloud_dataform_v1::model::CompilationResult;
7076 /// let x = CompilationResult::new().set_resolved_git_commit_sha("example");
7077 /// ```
7078 pub fn set_resolved_git_commit_sha<T: std::convert::Into<std::string::String>>(
7079 mut self,
7080 v: T,
7081 ) -> Self {
7082 self.resolved_git_commit_sha = v.into();
7083 self
7084 }
7085
7086 /// Sets the value of [dataform_core_version][crate::model::CompilationResult::dataform_core_version].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_dataform_v1::model::CompilationResult;
7091 /// let x = CompilationResult::new().set_dataform_core_version("example");
7092 /// ```
7093 pub fn set_dataform_core_version<T: std::convert::Into<std::string::String>>(
7094 mut self,
7095 v: T,
7096 ) -> Self {
7097 self.dataform_core_version = v.into();
7098 self
7099 }
7100
7101 /// Sets the value of [compilation_errors][crate::model::CompilationResult::compilation_errors].
7102 ///
7103 /// # Example
7104 /// ```ignore,no_run
7105 /// # use google_cloud_dataform_v1::model::CompilationResult;
7106 /// use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7107 /// let x = CompilationResult::new()
7108 /// .set_compilation_errors([
7109 /// CompilationError::default()/* use setters */,
7110 /// CompilationError::default()/* use (different) setters */,
7111 /// ]);
7112 /// ```
7113 pub fn set_compilation_errors<T, V>(mut self, v: T) -> Self
7114 where
7115 T: std::iter::IntoIterator<Item = V>,
7116 V: std::convert::Into<crate::model::compilation_result::CompilationError>,
7117 {
7118 use std::iter::Iterator;
7119 self.compilation_errors = v.into_iter().map(|i| i.into()).collect();
7120 self
7121 }
7122
7123 /// Sets the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
7124 ///
7125 /// # Example
7126 /// ```ignore,no_run
7127 /// # use google_cloud_dataform_v1::model::CompilationResult;
7128 /// use google_cloud_dataform_v1::model::DataEncryptionState;
7129 /// let x = CompilationResult::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
7130 /// ```
7131 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
7132 where
7133 T: std::convert::Into<crate::model::DataEncryptionState>,
7134 {
7135 self.data_encryption_state = std::option::Option::Some(v.into());
7136 self
7137 }
7138
7139 /// Sets or clears the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
7140 ///
7141 /// # Example
7142 /// ```ignore,no_run
7143 /// # use google_cloud_dataform_v1::model::CompilationResult;
7144 /// use google_cloud_dataform_v1::model::DataEncryptionState;
7145 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
7146 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
7147 /// ```
7148 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
7149 where
7150 T: std::convert::Into<crate::model::DataEncryptionState>,
7151 {
7152 self.data_encryption_state = v.map(|x| x.into());
7153 self
7154 }
7155
7156 /// Sets the value of [create_time][crate::model::CompilationResult::create_time].
7157 ///
7158 /// # Example
7159 /// ```ignore,no_run
7160 /// # use google_cloud_dataform_v1::model::CompilationResult;
7161 /// use wkt::Timestamp;
7162 /// let x = CompilationResult::new().set_create_time(Timestamp::default()/* use setters */);
7163 /// ```
7164 pub fn set_create_time<T>(mut self, v: T) -> Self
7165 where
7166 T: std::convert::Into<wkt::Timestamp>,
7167 {
7168 self.create_time = std::option::Option::Some(v.into());
7169 self
7170 }
7171
7172 /// Sets or clears the value of [create_time][crate::model::CompilationResult::create_time].
7173 ///
7174 /// # Example
7175 /// ```ignore,no_run
7176 /// # use google_cloud_dataform_v1::model::CompilationResult;
7177 /// use wkt::Timestamp;
7178 /// let x = CompilationResult::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7179 /// let x = CompilationResult::new().set_or_clear_create_time(None::<Timestamp>);
7180 /// ```
7181 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7182 where
7183 T: std::convert::Into<wkt::Timestamp>,
7184 {
7185 self.create_time = v.map(|x| x.into());
7186 self
7187 }
7188
7189 /// Sets the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
7190 ///
7191 /// # Example
7192 /// ```ignore,no_run
7193 /// # use google_cloud_dataform_v1::model::CompilationResult;
7194 /// let x = CompilationResult::new().set_internal_metadata("example");
7195 /// ```
7196 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
7197 where
7198 T: std::convert::Into<std::string::String>,
7199 {
7200 self.internal_metadata = std::option::Option::Some(v.into());
7201 self
7202 }
7203
7204 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
7205 ///
7206 /// # Example
7207 /// ```ignore,no_run
7208 /// # use google_cloud_dataform_v1::model::CompilationResult;
7209 /// let x = CompilationResult::new().set_or_clear_internal_metadata(Some("example"));
7210 /// let x = CompilationResult::new().set_or_clear_internal_metadata(None::<String>);
7211 /// ```
7212 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
7213 where
7214 T: std::convert::Into<std::string::String>,
7215 {
7216 self.internal_metadata = v.map(|x| x.into());
7217 self
7218 }
7219
7220 /// Sets the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
7221 ///
7222 /// # Example
7223 /// ```ignore,no_run
7224 /// # use google_cloud_dataform_v1::model::CompilationResult;
7225 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
7226 /// let x = CompilationResult::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
7227 /// ```
7228 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
7229 where
7230 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
7231 {
7232 self.private_resource_metadata = std::option::Option::Some(v.into());
7233 self
7234 }
7235
7236 /// Sets or clears the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
7237 ///
7238 /// # Example
7239 /// ```ignore,no_run
7240 /// # use google_cloud_dataform_v1::model::CompilationResult;
7241 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
7242 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
7243 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
7244 /// ```
7245 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
7246 where
7247 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
7248 {
7249 self.private_resource_metadata = v.map(|x| x.into());
7250 self
7251 }
7252
7253 /// Sets the value of [gcs_repository_snapshot_metadata][crate::model::CompilationResult::gcs_repository_snapshot_metadata].
7254 ///
7255 /// # Example
7256 /// ```ignore,no_run
7257 /// # use google_cloud_dataform_v1::model::CompilationResult;
7258 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7259 /// let x = CompilationResult::new().set_gcs_repository_snapshot_metadata(GcsRepositorySnapshotMetadata::default()/* use setters */);
7260 /// ```
7261 pub fn set_gcs_repository_snapshot_metadata<T>(mut self, v: T) -> Self
7262 where
7263 T: std::convert::Into<crate::model::GcsRepositorySnapshotMetadata>,
7264 {
7265 self.gcs_repository_snapshot_metadata = std::option::Option::Some(v.into());
7266 self
7267 }
7268
7269 /// Sets or clears the value of [gcs_repository_snapshot_metadata][crate::model::CompilationResult::gcs_repository_snapshot_metadata].
7270 ///
7271 /// # Example
7272 /// ```ignore,no_run
7273 /// # use google_cloud_dataform_v1::model::CompilationResult;
7274 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7275 /// let x = CompilationResult::new().set_or_clear_gcs_repository_snapshot_metadata(Some(GcsRepositorySnapshotMetadata::default()/* use setters */));
7276 /// let x = CompilationResult::new().set_or_clear_gcs_repository_snapshot_metadata(None::<GcsRepositorySnapshotMetadata>);
7277 /// ```
7278 pub fn set_or_clear_gcs_repository_snapshot_metadata<T>(
7279 mut self,
7280 v: std::option::Option<T>,
7281 ) -> Self
7282 where
7283 T: std::convert::Into<crate::model::GcsRepositorySnapshotMetadata>,
7284 {
7285 self.gcs_repository_snapshot_metadata = v.map(|x| x.into());
7286 self
7287 }
7288
7289 /// Sets the value of [source][crate::model::CompilationResult::source].
7290 ///
7291 /// Note that all the setters affecting `source` are mutually
7292 /// exclusive.
7293 ///
7294 /// # Example
7295 /// ```ignore,no_run
7296 /// # use google_cloud_dataform_v1::model::CompilationResult;
7297 /// use google_cloud_dataform_v1::model::compilation_result::Source;
7298 /// let x = CompilationResult::new().set_source(Some(Source::GitCommitish("example".to_string())));
7299 /// ```
7300 pub fn set_source<
7301 T: std::convert::Into<std::option::Option<crate::model::compilation_result::Source>>,
7302 >(
7303 mut self,
7304 v: T,
7305 ) -> Self {
7306 self.source = v.into();
7307 self
7308 }
7309
7310 /// The value of [source][crate::model::CompilationResult::source]
7311 /// if it holds a `GitCommitish`, `None` if the field is not set or
7312 /// holds a different branch.
7313 pub fn git_commitish(&self) -> std::option::Option<&std::string::String> {
7314 #[allow(unreachable_patterns)]
7315 self.source.as_ref().and_then(|v| match v {
7316 crate::model::compilation_result::Source::GitCommitish(v) => {
7317 std::option::Option::Some(v)
7318 }
7319 _ => std::option::Option::None,
7320 })
7321 }
7322
7323 /// Sets the value of [source][crate::model::CompilationResult::source]
7324 /// to hold a `GitCommitish`.
7325 ///
7326 /// Note that all the setters affecting `source` are
7327 /// mutually exclusive.
7328 ///
7329 /// # Example
7330 /// ```ignore,no_run
7331 /// # use google_cloud_dataform_v1::model::CompilationResult;
7332 /// let x = CompilationResult::new().set_git_commitish("example");
7333 /// assert!(x.git_commitish().is_some());
7334 /// assert!(x.workspace().is_none());
7335 /// assert!(x.release_config().is_none());
7336 /// ```
7337 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7338 self.source = std::option::Option::Some(
7339 crate::model::compilation_result::Source::GitCommitish(v.into()),
7340 );
7341 self
7342 }
7343
7344 /// The value of [source][crate::model::CompilationResult::source]
7345 /// if it holds a `Workspace`, `None` if the field is not set or
7346 /// holds a different branch.
7347 pub fn workspace(&self) -> std::option::Option<&std::string::String> {
7348 #[allow(unreachable_patterns)]
7349 self.source.as_ref().and_then(|v| match v {
7350 crate::model::compilation_result::Source::Workspace(v) => std::option::Option::Some(v),
7351 _ => std::option::Option::None,
7352 })
7353 }
7354
7355 /// Sets the value of [source][crate::model::CompilationResult::source]
7356 /// to hold a `Workspace`.
7357 ///
7358 /// Note that all the setters affecting `source` are
7359 /// mutually exclusive.
7360 ///
7361 /// # Example
7362 /// ```ignore,no_run
7363 /// # use google_cloud_dataform_v1::model::CompilationResult;
7364 /// # let project_id = "project_id";
7365 /// # let location_id = "location_id";
7366 /// # let repository_id = "repository_id";
7367 /// # let workspace_id = "workspace_id";
7368 /// let x = CompilationResult::new().set_workspace(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workspaces/{workspace_id}"));
7369 /// assert!(x.workspace().is_some());
7370 /// assert!(x.git_commitish().is_none());
7371 /// assert!(x.release_config().is_none());
7372 /// ```
7373 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7374 self.source = std::option::Option::Some(
7375 crate::model::compilation_result::Source::Workspace(v.into()),
7376 );
7377 self
7378 }
7379
7380 /// The value of [source][crate::model::CompilationResult::source]
7381 /// if it holds a `ReleaseConfig`, `None` if the field is not set or
7382 /// holds a different branch.
7383 pub fn release_config(&self) -> std::option::Option<&std::string::String> {
7384 #[allow(unreachable_patterns)]
7385 self.source.as_ref().and_then(|v| match v {
7386 crate::model::compilation_result::Source::ReleaseConfig(v) => {
7387 std::option::Option::Some(v)
7388 }
7389 _ => std::option::Option::None,
7390 })
7391 }
7392
7393 /// Sets the value of [source][crate::model::CompilationResult::source]
7394 /// to hold a `ReleaseConfig`.
7395 ///
7396 /// Note that all the setters affecting `source` are
7397 /// mutually exclusive.
7398 ///
7399 /// # Example
7400 /// ```ignore,no_run
7401 /// # use google_cloud_dataform_v1::model::CompilationResult;
7402 /// # let project_id = "project_id";
7403 /// # let location_id = "location_id";
7404 /// # let repository_id = "repository_id";
7405 /// # let release_config_id = "release_config_id";
7406 /// let x = CompilationResult::new().set_release_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
7407 /// assert!(x.release_config().is_some());
7408 /// assert!(x.git_commitish().is_none());
7409 /// assert!(x.workspace().is_none());
7410 /// ```
7411 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7412 self.source = std::option::Option::Some(
7413 crate::model::compilation_result::Source::ReleaseConfig(v.into()),
7414 );
7415 self
7416 }
7417}
7418
7419impl wkt::message::Message for CompilationResult {
7420 fn typename() -> &'static str {
7421 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult"
7422 }
7423}
7424
7425/// Defines additional types related to [CompilationResult].
7426pub mod compilation_result {
7427 #[allow(unused_imports)]
7428 use super::*;
7429
7430 /// An error encountered when attempting to compile a Dataform project.
7431 #[derive(Clone, Default, PartialEq)]
7432 #[non_exhaustive]
7433 pub struct CompilationError {
7434 /// Output only. The error's top level message.
7435 pub message: std::string::String,
7436
7437 /// Output only. The error's full stack trace.
7438 pub stack: std::string::String,
7439
7440 /// Output only. The path of the file where this error occurred, if
7441 /// available, relative to the project root.
7442 pub path: std::string::String,
7443
7444 /// Output only. The identifier of the action where this error occurred, if
7445 /// available.
7446 pub action_target: std::option::Option<crate::model::Target>,
7447
7448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7449 }
7450
7451 impl CompilationError {
7452 /// Creates a new default instance.
7453 pub fn new() -> Self {
7454 std::default::Default::default()
7455 }
7456
7457 /// Sets the value of [message][crate::model::compilation_result::CompilationError::message].
7458 ///
7459 /// # Example
7460 /// ```ignore,no_run
7461 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7462 /// let x = CompilationError::new().set_message("example");
7463 /// ```
7464 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7465 self.message = v.into();
7466 self
7467 }
7468
7469 /// Sets the value of [stack][crate::model::compilation_result::CompilationError::stack].
7470 ///
7471 /// # Example
7472 /// ```ignore,no_run
7473 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7474 /// let x = CompilationError::new().set_stack("example");
7475 /// ```
7476 pub fn set_stack<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7477 self.stack = v.into();
7478 self
7479 }
7480
7481 /// Sets the value of [path][crate::model::compilation_result::CompilationError::path].
7482 ///
7483 /// # Example
7484 /// ```ignore,no_run
7485 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7486 /// let x = CompilationError::new().set_path("example");
7487 /// ```
7488 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7489 self.path = v.into();
7490 self
7491 }
7492
7493 /// Sets the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
7494 ///
7495 /// # Example
7496 /// ```ignore,no_run
7497 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7498 /// use google_cloud_dataform_v1::model::Target;
7499 /// let x = CompilationError::new().set_action_target(Target::default()/* use setters */);
7500 /// ```
7501 pub fn set_action_target<T>(mut self, v: T) -> Self
7502 where
7503 T: std::convert::Into<crate::model::Target>,
7504 {
7505 self.action_target = std::option::Option::Some(v.into());
7506 self
7507 }
7508
7509 /// Sets or clears the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
7510 ///
7511 /// # Example
7512 /// ```ignore,no_run
7513 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7514 /// use google_cloud_dataform_v1::model::Target;
7515 /// let x = CompilationError::new().set_or_clear_action_target(Some(Target::default()/* use setters */));
7516 /// let x = CompilationError::new().set_or_clear_action_target(None::<Target>);
7517 /// ```
7518 pub fn set_or_clear_action_target<T>(mut self, v: std::option::Option<T>) -> Self
7519 where
7520 T: std::convert::Into<crate::model::Target>,
7521 {
7522 self.action_target = v.map(|x| x.into());
7523 self
7524 }
7525 }
7526
7527 impl wkt::message::Message for CompilationError {
7528 fn typename() -> &'static str {
7529 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult.CompilationError"
7530 }
7531 }
7532
7533 /// The source of the compilation result.
7534 #[derive(Clone, Debug, PartialEq)]
7535 #[non_exhaustive]
7536 pub enum Source {
7537 /// Immutable. Git commit/tag/branch name at which the repository should be
7538 /// compiled. Must exist in the remote repository. Examples:
7539 ///
7540 /// - a commit SHA: `12ade345`
7541 /// - a tag: `tag1`
7542 /// - a branch name: `branch1`
7543 GitCommitish(std::string::String),
7544 /// Immutable. The name of the workspace to compile. Must be in the format
7545 /// `projects/*/locations/*/repositories/*/workspaces/*`.
7546 Workspace(std::string::String),
7547 /// Immutable. The name of the release config to compile. Must be in the
7548 /// format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
7549 ReleaseConfig(std::string::String),
7550 }
7551}
7552
7553/// Configures various aspects of Dataform code compilation.
7554#[derive(Clone, Default, PartialEq)]
7555#[non_exhaustive]
7556pub struct CodeCompilationConfig {
7557 /// Optional. The default database (Google Cloud project ID).
7558 pub default_database: std::string::String,
7559
7560 /// Optional. The default schema (BigQuery dataset ID).
7561 pub default_schema: std::string::String,
7562
7563 /// Optional. The default BigQuery location to use. Defaults to "US".
7564 /// See the BigQuery docs for a full list of locations:
7565 /// <https://cloud.google.com/bigquery/docs/locations>.
7566 pub default_location: std::string::String,
7567
7568 /// Optional. The default schema (BigQuery dataset ID) for assertions.
7569 pub assertion_schema: std::string::String,
7570
7571 /// Optional. User-defined variables that are made available to project code
7572 /// during compilation.
7573 pub vars: std::collections::HashMap<std::string::String, std::string::String>,
7574
7575 /// Optional. The suffix that should be appended to all database (Google Cloud
7576 /// project ID) names.
7577 pub database_suffix: std::string::String,
7578
7579 /// Optional. The suffix that should be appended to all schema (BigQuery
7580 /// dataset ID) names.
7581 pub schema_suffix: std::string::String,
7582
7583 /// Optional. The prefix that should be prepended to all table names.
7584 pub table_prefix: std::string::String,
7585
7586 /// Optional. The prefix to prepend to built-in assertion names.
7587 pub builtin_assertion_name_prefix: std::string::String,
7588
7589 /// Optional. The default notebook runtime options.
7590 pub default_notebook_runtime_options: std::option::Option<crate::model::NotebookRuntimeOptions>,
7591
7592 /// Optional. The pipeline options which defines the pipeline type and path
7593 /// within the Git repository.
7594 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
7595
7596 /// Output only. Whether OpenLineage events are emitted for actions in this
7597 /// workflow. Reflects the `lineage.enabled` setting from
7598 /// `workflow_settings.yaml`.
7599 pub lineage_enabled: std::option::Option<bool>,
7600
7601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7602}
7603
7604impl CodeCompilationConfig {
7605 /// Creates a new default instance.
7606 pub fn new() -> Self {
7607 std::default::Default::default()
7608 }
7609
7610 /// Sets the value of [default_database][crate::model::CodeCompilationConfig::default_database].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7615 /// let x = CodeCompilationConfig::new().set_default_database("example");
7616 /// ```
7617 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
7618 mut self,
7619 v: T,
7620 ) -> Self {
7621 self.default_database = v.into();
7622 self
7623 }
7624
7625 /// Sets the value of [default_schema][crate::model::CodeCompilationConfig::default_schema].
7626 ///
7627 /// # Example
7628 /// ```ignore,no_run
7629 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7630 /// let x = CodeCompilationConfig::new().set_default_schema("example");
7631 /// ```
7632 pub fn set_default_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7633 self.default_schema = v.into();
7634 self
7635 }
7636
7637 /// Sets the value of [default_location][crate::model::CodeCompilationConfig::default_location].
7638 ///
7639 /// # Example
7640 /// ```ignore,no_run
7641 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7642 /// let x = CodeCompilationConfig::new().set_default_location("example");
7643 /// ```
7644 pub fn set_default_location<T: std::convert::Into<std::string::String>>(
7645 mut self,
7646 v: T,
7647 ) -> Self {
7648 self.default_location = v.into();
7649 self
7650 }
7651
7652 /// Sets the value of [assertion_schema][crate::model::CodeCompilationConfig::assertion_schema].
7653 ///
7654 /// # Example
7655 /// ```ignore,no_run
7656 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7657 /// let x = CodeCompilationConfig::new().set_assertion_schema("example");
7658 /// ```
7659 pub fn set_assertion_schema<T: std::convert::Into<std::string::String>>(
7660 mut self,
7661 v: T,
7662 ) -> Self {
7663 self.assertion_schema = v.into();
7664 self
7665 }
7666
7667 /// Sets the value of [vars][crate::model::CodeCompilationConfig::vars].
7668 ///
7669 /// # Example
7670 /// ```ignore,no_run
7671 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7672 /// let x = CodeCompilationConfig::new().set_vars([
7673 /// ("key0", "abc"),
7674 /// ("key1", "xyz"),
7675 /// ]);
7676 /// ```
7677 pub fn set_vars<T, K, V>(mut self, v: T) -> Self
7678 where
7679 T: std::iter::IntoIterator<Item = (K, V)>,
7680 K: std::convert::Into<std::string::String>,
7681 V: std::convert::Into<std::string::String>,
7682 {
7683 use std::iter::Iterator;
7684 self.vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7685 self
7686 }
7687
7688 /// Sets the value of [database_suffix][crate::model::CodeCompilationConfig::database_suffix].
7689 ///
7690 /// # Example
7691 /// ```ignore,no_run
7692 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7693 /// let x = CodeCompilationConfig::new().set_database_suffix("example");
7694 /// ```
7695 pub fn set_database_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7696 self.database_suffix = v.into();
7697 self
7698 }
7699
7700 /// Sets the value of [schema_suffix][crate::model::CodeCompilationConfig::schema_suffix].
7701 ///
7702 /// # Example
7703 /// ```ignore,no_run
7704 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7705 /// let x = CodeCompilationConfig::new().set_schema_suffix("example");
7706 /// ```
7707 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7708 self.schema_suffix = v.into();
7709 self
7710 }
7711
7712 /// Sets the value of [table_prefix][crate::model::CodeCompilationConfig::table_prefix].
7713 ///
7714 /// # Example
7715 /// ```ignore,no_run
7716 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7717 /// let x = CodeCompilationConfig::new().set_table_prefix("example");
7718 /// ```
7719 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7720 self.table_prefix = v.into();
7721 self
7722 }
7723
7724 /// Sets the value of [builtin_assertion_name_prefix][crate::model::CodeCompilationConfig::builtin_assertion_name_prefix].
7725 ///
7726 /// # Example
7727 /// ```ignore,no_run
7728 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7729 /// let x = CodeCompilationConfig::new().set_builtin_assertion_name_prefix("example");
7730 /// ```
7731 pub fn set_builtin_assertion_name_prefix<T: std::convert::Into<std::string::String>>(
7732 mut self,
7733 v: T,
7734 ) -> Self {
7735 self.builtin_assertion_name_prefix = v.into();
7736 self
7737 }
7738
7739 /// Sets the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7740 ///
7741 /// # Example
7742 /// ```ignore,no_run
7743 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7744 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7745 /// let x = CodeCompilationConfig::new().set_default_notebook_runtime_options(NotebookRuntimeOptions::default()/* use setters */);
7746 /// ```
7747 pub fn set_default_notebook_runtime_options<T>(mut self, v: T) -> Self
7748 where
7749 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7750 {
7751 self.default_notebook_runtime_options = std::option::Option::Some(v.into());
7752 self
7753 }
7754
7755 /// Sets or clears the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7756 ///
7757 /// # Example
7758 /// ```ignore,no_run
7759 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7760 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7761 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(Some(NotebookRuntimeOptions::default()/* use setters */));
7762 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(None::<NotebookRuntimeOptions>);
7763 /// ```
7764 pub fn set_or_clear_default_notebook_runtime_options<T>(
7765 mut self,
7766 v: std::option::Option<T>,
7767 ) -> Self
7768 where
7769 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7770 {
7771 self.default_notebook_runtime_options = v.map(|x| x.into());
7772 self
7773 }
7774
7775 /// Sets the value of [pipeline_config][crate::model::CodeCompilationConfig::pipeline_config].
7776 ///
7777 /// # Example
7778 /// ```ignore,no_run
7779 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7780 /// use google_cloud_dataform_v1::model::PipelineConfig;
7781 /// let x = CodeCompilationConfig::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
7782 /// ```
7783 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
7784 where
7785 T: std::convert::Into<crate::model::PipelineConfig>,
7786 {
7787 self.pipeline_config = std::option::Option::Some(v.into());
7788 self
7789 }
7790
7791 /// Sets or clears the value of [pipeline_config][crate::model::CodeCompilationConfig::pipeline_config].
7792 ///
7793 /// # Example
7794 /// ```ignore,no_run
7795 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7796 /// use google_cloud_dataform_v1::model::PipelineConfig;
7797 /// let x = CodeCompilationConfig::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
7798 /// let x = CodeCompilationConfig::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
7799 /// ```
7800 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
7801 where
7802 T: std::convert::Into<crate::model::PipelineConfig>,
7803 {
7804 self.pipeline_config = v.map(|x| x.into());
7805 self
7806 }
7807
7808 /// Sets the value of [lineage_enabled][crate::model::CodeCompilationConfig::lineage_enabled].
7809 ///
7810 /// # Example
7811 /// ```ignore,no_run
7812 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7813 /// let x = CodeCompilationConfig::new().set_lineage_enabled(true);
7814 /// ```
7815 pub fn set_lineage_enabled<T>(mut self, v: T) -> Self
7816 where
7817 T: std::convert::Into<bool>,
7818 {
7819 self.lineage_enabled = std::option::Option::Some(v.into());
7820 self
7821 }
7822
7823 /// Sets or clears the value of [lineage_enabled][crate::model::CodeCompilationConfig::lineage_enabled].
7824 ///
7825 /// # Example
7826 /// ```ignore,no_run
7827 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7828 /// let x = CodeCompilationConfig::new().set_or_clear_lineage_enabled(Some(false));
7829 /// let x = CodeCompilationConfig::new().set_or_clear_lineage_enabled(None::<bool>);
7830 /// ```
7831 pub fn set_or_clear_lineage_enabled<T>(mut self, v: std::option::Option<T>) -> Self
7832 where
7833 T: std::convert::Into<bool>,
7834 {
7835 self.lineage_enabled = v.map(|x| x.into());
7836 self
7837 }
7838}
7839
7840impl wkt::message::Message for CodeCompilationConfig {
7841 fn typename() -> &'static str {
7842 "type.googleapis.com/google.cloud.dataform.v1.CodeCompilationConfig"
7843 }
7844}
7845
7846/// Metadata about a repository snapshot stored in Google Cloud Storage.
7847#[derive(Clone, Default, PartialEq)]
7848#[non_exhaustive]
7849pub struct GcsRepositorySnapshotMetadata {
7850 /// Output only. The Google Cloud Storage URI of the repository snapshot.
7851 pub repository_snapshot_uri: std::string::String,
7852
7853 /// Output only. The crc32c checksum of the repository snapshot, big-endian
7854 /// base64 encoded.
7855 pub crc32c_checksum: std::string::String,
7856
7857 /// Output only. The generation number of the Cloud Storage object. See
7858 /// <https://cloud.google.com/storage/docs/metadata#generation-number>.
7859 pub generation: i64,
7860
7861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7862}
7863
7864impl GcsRepositorySnapshotMetadata {
7865 /// Creates a new default instance.
7866 pub fn new() -> Self {
7867 std::default::Default::default()
7868 }
7869
7870 /// Sets the value of [repository_snapshot_uri][crate::model::GcsRepositorySnapshotMetadata::repository_snapshot_uri].
7871 ///
7872 /// # Example
7873 /// ```ignore,no_run
7874 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7875 /// let x = GcsRepositorySnapshotMetadata::new().set_repository_snapshot_uri("example");
7876 /// ```
7877 pub fn set_repository_snapshot_uri<T: std::convert::Into<std::string::String>>(
7878 mut self,
7879 v: T,
7880 ) -> Self {
7881 self.repository_snapshot_uri = v.into();
7882 self
7883 }
7884
7885 /// Sets the value of [crc32c_checksum][crate::model::GcsRepositorySnapshotMetadata::crc32c_checksum].
7886 ///
7887 /// # Example
7888 /// ```ignore,no_run
7889 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7890 /// let x = GcsRepositorySnapshotMetadata::new().set_crc32c_checksum("example");
7891 /// ```
7892 pub fn set_crc32c_checksum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7893 self.crc32c_checksum = v.into();
7894 self
7895 }
7896
7897 /// Sets the value of [generation][crate::model::GcsRepositorySnapshotMetadata::generation].
7898 ///
7899 /// # Example
7900 /// ```ignore,no_run
7901 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotMetadata;
7902 /// let x = GcsRepositorySnapshotMetadata::new().set_generation(42);
7903 /// ```
7904 pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7905 self.generation = v.into();
7906 self
7907 }
7908}
7909
7910impl wkt::message::Message for GcsRepositorySnapshotMetadata {
7911 fn typename() -> &'static str {
7912 "type.googleapis.com/google.cloud.dataform.v1.GcsRepositorySnapshotMetadata"
7913 }
7914}
7915
7916/// Configures the destination for a repository snapshot.
7917#[derive(Clone, Default, PartialEq)]
7918#[non_exhaustive]
7919pub struct GcsRepositorySnapshotDestination {
7920 /// Optional. The Google Cloud Storage destination to upload the repository
7921 /// snapshot to. Format: `gs://bucket-name/path/`.
7922 pub repository_snapshot_uri: std::string::String,
7923
7924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7925}
7926
7927impl GcsRepositorySnapshotDestination {
7928 /// Creates a new default instance.
7929 pub fn new() -> Self {
7930 std::default::Default::default()
7931 }
7932
7933 /// Sets the value of [repository_snapshot_uri][crate::model::GcsRepositorySnapshotDestination::repository_snapshot_uri].
7934 ///
7935 /// # Example
7936 /// ```ignore,no_run
7937 /// # use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
7938 /// let x = GcsRepositorySnapshotDestination::new().set_repository_snapshot_uri("example");
7939 /// ```
7940 pub fn set_repository_snapshot_uri<T: std::convert::Into<std::string::String>>(
7941 mut self,
7942 v: T,
7943 ) -> Self {
7944 self.repository_snapshot_uri = v.into();
7945 self
7946 }
7947}
7948
7949impl wkt::message::Message for GcsRepositorySnapshotDestination {
7950 fn typename() -> &'static str {
7951 "type.googleapis.com/google.cloud.dataform.v1.GcsRepositorySnapshotDestination"
7952 }
7953}
7954
7955/// Configures various aspects of Dataform notebook runtime.
7956#[derive(Clone, Default, PartialEq)]
7957#[non_exhaustive]
7958pub struct NotebookRuntimeOptions {
7959 /// Optional. The resource name of the [Colab runtime template]
7960 /// (<https://cloud.google.com/colab/docs/runtimes>), from which a runtime is
7961 /// created for notebook executions. If not specified, a runtime is created
7962 /// with Colab's default specifications.
7963 pub ai_platform_notebook_runtime_template: std::string::String,
7964
7965 /// The location to store the notebook execution result.
7966 pub execution_sink: std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
7967
7968 /// The destination of the snapshot of repository files to be available for
7969 /// read-only access inside a notebook runtime
7970 pub repository_snapshot_storage:
7971 std::option::Option<crate::model::notebook_runtime_options::RepositorySnapshotStorage>,
7972
7973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7974}
7975
7976impl NotebookRuntimeOptions {
7977 /// Creates a new default instance.
7978 pub fn new() -> Self {
7979 std::default::Default::default()
7980 }
7981
7982 /// Sets the value of [ai_platform_notebook_runtime_template][crate::model::NotebookRuntimeOptions::ai_platform_notebook_runtime_template].
7983 ///
7984 /// # Example
7985 /// ```ignore,no_run
7986 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7987 /// let x = NotebookRuntimeOptions::new().set_ai_platform_notebook_runtime_template("example");
7988 /// ```
7989 pub fn set_ai_platform_notebook_runtime_template<T: std::convert::Into<std::string::String>>(
7990 mut self,
7991 v: T,
7992 ) -> Self {
7993 self.ai_platform_notebook_runtime_template = v.into();
7994 self
7995 }
7996
7997 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink].
7998 ///
7999 /// Note that all the setters affecting `execution_sink` are mutually
8000 /// exclusive.
8001 ///
8002 /// # Example
8003 /// ```ignore,no_run
8004 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
8005 /// use google_cloud_dataform_v1::model::notebook_runtime_options::ExecutionSink;
8006 /// let x = NotebookRuntimeOptions::new().set_execution_sink(Some(ExecutionSink::GcsOutputBucket("example".to_string())));
8007 /// ```
8008 pub fn set_execution_sink<
8009 T: std::convert::Into<
8010 std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
8011 >,
8012 >(
8013 mut self,
8014 v: T,
8015 ) -> Self {
8016 self.execution_sink = v.into();
8017 self
8018 }
8019
8020 /// The value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
8021 /// if it holds a `GcsOutputBucket`, `None` if the field is not set or
8022 /// holds a different branch.
8023 pub fn gcs_output_bucket(&self) -> std::option::Option<&std::string::String> {
8024 #[allow(unreachable_patterns)]
8025 self.execution_sink.as_ref().and_then(|v| match v {
8026 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v) => {
8027 std::option::Option::Some(v)
8028 }
8029 _ => std::option::Option::None,
8030 })
8031 }
8032
8033 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
8034 /// to hold a `GcsOutputBucket`.
8035 ///
8036 /// Note that all the setters affecting `execution_sink` are
8037 /// mutually exclusive.
8038 ///
8039 /// # Example
8040 /// ```ignore,no_run
8041 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
8042 /// let x = NotebookRuntimeOptions::new().set_gcs_output_bucket("example");
8043 /// assert!(x.gcs_output_bucket().is_some());
8044 /// ```
8045 pub fn set_gcs_output_bucket<T: std::convert::Into<std::string::String>>(
8046 mut self,
8047 v: T,
8048 ) -> Self {
8049 self.execution_sink = std::option::Option::Some(
8050 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v.into()),
8051 );
8052 self
8053 }
8054
8055 /// Sets the value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage].
8056 ///
8057 /// Note that all the setters affecting `repository_snapshot_storage` are mutually
8058 /// exclusive.
8059 ///
8060 /// # Example
8061 /// ```ignore,no_run
8062 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
8063 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
8064 /// let x = NotebookRuntimeOptions::new().set_repository_snapshot_storage(Some(
8065 /// google_cloud_dataform_v1::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(GcsRepositorySnapshotDestination::default().into())));
8066 /// ```
8067 pub fn set_repository_snapshot_storage<
8068 T: std::convert::Into<
8069 std::option::Option<
8070 crate::model::notebook_runtime_options::RepositorySnapshotStorage,
8071 >,
8072 >,
8073 >(
8074 mut self,
8075 v: T,
8076 ) -> Self {
8077 self.repository_snapshot_storage = v.into();
8078 self
8079 }
8080
8081 /// The value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage]
8082 /// if it holds a `GcsRepositorySnapshotDestination`, `None` if the field is not set or
8083 /// holds a different branch.
8084 pub fn gcs_repository_snapshot_destination(
8085 &self,
8086 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>> {
8087 #[allow(unreachable_patterns)]
8088 self.repository_snapshot_storage.as_ref().and_then(|v| match v {
8089 crate::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(v) => std::option::Option::Some(v),
8090 _ => std::option::Option::None,
8091 })
8092 }
8093
8094 /// Sets the value of [repository_snapshot_storage][crate::model::NotebookRuntimeOptions::repository_snapshot_storage]
8095 /// to hold a `GcsRepositorySnapshotDestination`.
8096 ///
8097 /// Note that all the setters affecting `repository_snapshot_storage` are
8098 /// mutually exclusive.
8099 ///
8100 /// # Example
8101 /// ```ignore,no_run
8102 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
8103 /// use google_cloud_dataform_v1::model::GcsRepositorySnapshotDestination;
8104 /// let x = NotebookRuntimeOptions::new().set_gcs_repository_snapshot_destination(GcsRepositorySnapshotDestination::default()/* use setters */);
8105 /// assert!(x.gcs_repository_snapshot_destination().is_some());
8106 /// ```
8107 pub fn set_gcs_repository_snapshot_destination<
8108 T: std::convert::Into<std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>>,
8109 >(
8110 mut self,
8111 v: T,
8112 ) -> Self {
8113 self.repository_snapshot_storage = std::option::Option::Some(
8114 crate::model::notebook_runtime_options::RepositorySnapshotStorage::GcsRepositorySnapshotDestination(
8115 v.into()
8116 )
8117 );
8118 self
8119 }
8120}
8121
8122impl wkt::message::Message for NotebookRuntimeOptions {
8123 fn typename() -> &'static str {
8124 "type.googleapis.com/google.cloud.dataform.v1.NotebookRuntimeOptions"
8125 }
8126}
8127
8128/// Defines additional types related to [NotebookRuntimeOptions].
8129pub mod notebook_runtime_options {
8130 #[allow(unused_imports)]
8131 use super::*;
8132
8133 /// The location to store the notebook execution result.
8134 #[derive(Clone, Debug, PartialEq)]
8135 #[non_exhaustive]
8136 pub enum ExecutionSink {
8137 /// Optional. The Google Cloud Storage location to upload the result to.
8138 /// Format: `gs://bucket-name`.
8139 GcsOutputBucket(std::string::String),
8140 }
8141
8142 /// The destination of the snapshot of repository files to be available for
8143 /// read-only access inside a notebook runtime
8144 #[derive(Clone, Debug, PartialEq)]
8145 #[non_exhaustive]
8146 pub enum RepositorySnapshotStorage {
8147 /// Optional. The Google Cloud Storage destination to upload the snapshot to.
8148 /// For empty URI it defaults to the provided gcs_output_bucket.
8149 /// Format: `gs://bucket-name/path/`.
8150 GcsRepositorySnapshotDestination(
8151 std::boxed::Box<crate::model::GcsRepositorySnapshotDestination>,
8152 ),
8153 }
8154}
8155
8156/// Defines the pipeline type and path within the Git repository.
8157#[derive(Clone, Default, PartialEq)]
8158#[non_exhaustive]
8159pub struct PipelineConfig {
8160 /// Required. The type of the pipeline.
8161 pub pipeline_type: crate::model::pipeline_config::PipelineType,
8162
8163 /// Required. The relative path within the Git repository where the pipeline is
8164 /// defined. For example, for a Dataform pipeline, it is a path to the folder
8165 /// where `workflow_settings.yaml` or `dataform.json` is located.
8166 pub path: std::string::String,
8167
8168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8169}
8170
8171impl PipelineConfig {
8172 /// Creates a new default instance.
8173 pub fn new() -> Self {
8174 std::default::Default::default()
8175 }
8176
8177 /// Sets the value of [pipeline_type][crate::model::PipelineConfig::pipeline_type].
8178 ///
8179 /// # Example
8180 /// ```ignore,no_run
8181 /// # use google_cloud_dataform_v1::model::PipelineConfig;
8182 /// use google_cloud_dataform_v1::model::pipeline_config::PipelineType;
8183 /// let x0 = PipelineConfig::new().set_pipeline_type(PipelineType::Dataform);
8184 /// let x1 = PipelineConfig::new().set_pipeline_type(PipelineType::Sql);
8185 /// let x2 = PipelineConfig::new().set_pipeline_type(PipelineType::Notebook);
8186 /// ```
8187 pub fn set_pipeline_type<T: std::convert::Into<crate::model::pipeline_config::PipelineType>>(
8188 mut self,
8189 v: T,
8190 ) -> Self {
8191 self.pipeline_type = v.into();
8192 self
8193 }
8194
8195 /// Sets the value of [path][crate::model::PipelineConfig::path].
8196 ///
8197 /// # Example
8198 /// ```ignore,no_run
8199 /// # use google_cloud_dataform_v1::model::PipelineConfig;
8200 /// let x = PipelineConfig::new().set_path("example");
8201 /// ```
8202 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8203 self.path = v.into();
8204 self
8205 }
8206}
8207
8208impl wkt::message::Message for PipelineConfig {
8209 fn typename() -> &'static str {
8210 "type.googleapis.com/google.cloud.dataform.v1.PipelineConfig"
8211 }
8212}
8213
8214/// Defines additional types related to [PipelineConfig].
8215pub mod pipeline_config {
8216 #[allow(unused_imports)]
8217 use super::*;
8218
8219 /// The type of the pipeline. This may be extended in the future.
8220 /// In case of UNSPECIFIED, the error will be thrown.
8221 ///
8222 /// # Working with unknown values
8223 ///
8224 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8225 /// additional enum variants at any time. Adding new variants is not considered
8226 /// a breaking change. Applications should write their code in anticipation of:
8227 ///
8228 /// - New values appearing in future releases of the client library, **and**
8229 /// - New values received dynamically, without application changes.
8230 ///
8231 /// Please consult the [Working with enums] section in the user guide for some
8232 /// guidelines.
8233 ///
8234 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8235 #[derive(Clone, Debug, PartialEq)]
8236 #[non_exhaustive]
8237 pub enum PipelineType {
8238 /// Default value. This value is unused.
8239 Unspecified,
8240 /// Regular Dataform pipeline.
8241 Dataform,
8242 /// SQL single file asset.
8243 Sql,
8244 /// Notebook single file asset.
8245 Notebook,
8246 /// If set, the enum was initialized with an unknown value.
8247 ///
8248 /// Applications can examine the value using [PipelineType::value] or
8249 /// [PipelineType::name].
8250 UnknownValue(pipeline_type::UnknownValue),
8251 }
8252
8253 #[doc(hidden)]
8254 pub mod pipeline_type {
8255 #[allow(unused_imports)]
8256 use super::*;
8257 #[derive(Clone, Debug, PartialEq)]
8258 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8259 }
8260
8261 impl PipelineType {
8262 /// Gets the enum value.
8263 ///
8264 /// Returns `None` if the enum contains an unknown value deserialized from
8265 /// the string representation of enums.
8266 pub fn value(&self) -> std::option::Option<i32> {
8267 match self {
8268 Self::Unspecified => std::option::Option::Some(0),
8269 Self::Dataform => std::option::Option::Some(1),
8270 Self::Sql => std::option::Option::Some(3),
8271 Self::Notebook => std::option::Option::Some(4),
8272 Self::UnknownValue(u) => u.0.value(),
8273 }
8274 }
8275
8276 /// Gets the enum value as a string.
8277 ///
8278 /// Returns `None` if the enum contains an unknown value deserialized from
8279 /// the integer representation of enums.
8280 pub fn name(&self) -> std::option::Option<&str> {
8281 match self {
8282 Self::Unspecified => std::option::Option::Some("PIPELINE_TYPE_UNSPECIFIED"),
8283 Self::Dataform => std::option::Option::Some("DATAFORM"),
8284 Self::Sql => std::option::Option::Some("SQL"),
8285 Self::Notebook => std::option::Option::Some("NOTEBOOK"),
8286 Self::UnknownValue(u) => u.0.name(),
8287 }
8288 }
8289 }
8290
8291 impl std::default::Default for PipelineType {
8292 fn default() -> Self {
8293 use std::convert::From;
8294 Self::from(0)
8295 }
8296 }
8297
8298 impl std::fmt::Display for PipelineType {
8299 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8300 wkt::internal::display_enum(f, self.name(), self.value())
8301 }
8302 }
8303
8304 impl std::convert::From<i32> for PipelineType {
8305 fn from(value: i32) -> Self {
8306 match value {
8307 0 => Self::Unspecified,
8308 1 => Self::Dataform,
8309 3 => Self::Sql,
8310 4 => Self::Notebook,
8311 _ => Self::UnknownValue(pipeline_type::UnknownValue(
8312 wkt::internal::UnknownEnumValue::Integer(value),
8313 )),
8314 }
8315 }
8316 }
8317
8318 impl std::convert::From<&str> for PipelineType {
8319 fn from(value: &str) -> Self {
8320 use std::string::ToString;
8321 match value {
8322 "PIPELINE_TYPE_UNSPECIFIED" => Self::Unspecified,
8323 "DATAFORM" => Self::Dataform,
8324 "SQL" => Self::Sql,
8325 "NOTEBOOK" => Self::Notebook,
8326 _ => Self::UnknownValue(pipeline_type::UnknownValue(
8327 wkt::internal::UnknownEnumValue::String(value.to_string()),
8328 )),
8329 }
8330 }
8331 }
8332
8333 impl serde::ser::Serialize for PipelineType {
8334 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8335 where
8336 S: serde::Serializer,
8337 {
8338 match self {
8339 Self::Unspecified => serializer.serialize_i32(0),
8340 Self::Dataform => serializer.serialize_i32(1),
8341 Self::Sql => serializer.serialize_i32(3),
8342 Self::Notebook => serializer.serialize_i32(4),
8343 Self::UnknownValue(u) => u.0.serialize(serializer),
8344 }
8345 }
8346 }
8347
8348 impl<'de> serde::de::Deserialize<'de> for PipelineType {
8349 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8350 where
8351 D: serde::Deserializer<'de>,
8352 {
8353 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PipelineType>::new(
8354 ".google.cloud.dataform.v1.PipelineConfig.PipelineType",
8355 ))
8356 }
8357 }
8358}
8359
8360/// `ListCompilationResults` request message.
8361#[derive(Clone, Default, PartialEq)]
8362#[non_exhaustive]
8363pub struct ListCompilationResultsRequest {
8364 /// Required. The repository in which to list compilation results. Must be in
8365 /// the format `projects/*/locations/*/repositories/*`.
8366 pub parent: std::string::String,
8367
8368 /// Optional. Maximum number of compilation results to return. The server may
8369 /// return fewer items than requested. If unspecified, the server will pick an
8370 /// appropriate default.
8371 pub page_size: i32,
8372
8373 /// Optional. Page token received from a previous `ListCompilationResults`
8374 /// call. Provide this to retrieve the subsequent page.
8375 ///
8376 /// When paginating, all other parameters provided to `ListCompilationResults`,
8377 /// with the exception of `page_size`, must match the call that provided the
8378 /// page token.
8379 pub page_token: std::string::String,
8380
8381 /// Optional. This field only supports ordering by `name` and `create_time`.
8382 /// If unspecified, the server will choose the ordering.
8383 /// If specified, the default order is ascending for the `name` field.
8384 pub order_by: std::string::String,
8385
8386 /// Optional. Filter for the returned list.
8387 pub filter: std::string::String,
8388
8389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8390}
8391
8392impl ListCompilationResultsRequest {
8393 /// Creates a new default instance.
8394 pub fn new() -> Self {
8395 std::default::Default::default()
8396 }
8397
8398 /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
8399 ///
8400 /// # Example
8401 /// ```ignore,no_run
8402 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8403 /// # let project_id = "project_id";
8404 /// # let location_id = "location_id";
8405 /// # let repository_id = "repository_id";
8406 /// let x = ListCompilationResultsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8407 /// ```
8408 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8409 self.parent = v.into();
8410 self
8411 }
8412
8413 /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
8414 ///
8415 /// # Example
8416 /// ```ignore,no_run
8417 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8418 /// let x = ListCompilationResultsRequest::new().set_page_size(42);
8419 /// ```
8420 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8421 self.page_size = v.into();
8422 self
8423 }
8424
8425 /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
8426 ///
8427 /// # Example
8428 /// ```ignore,no_run
8429 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8430 /// let x = ListCompilationResultsRequest::new().set_page_token("example");
8431 /// ```
8432 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8433 self.page_token = v.into();
8434 self
8435 }
8436
8437 /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
8438 ///
8439 /// # Example
8440 /// ```ignore,no_run
8441 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8442 /// let x = ListCompilationResultsRequest::new().set_order_by("example");
8443 /// ```
8444 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8445 self.order_by = v.into();
8446 self
8447 }
8448
8449 /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
8450 ///
8451 /// # Example
8452 /// ```ignore,no_run
8453 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
8454 /// let x = ListCompilationResultsRequest::new().set_filter("example");
8455 /// ```
8456 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8457 self.filter = v.into();
8458 self
8459 }
8460}
8461
8462impl wkt::message::Message for ListCompilationResultsRequest {
8463 fn typename() -> &'static str {
8464 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsRequest"
8465 }
8466}
8467
8468/// `ListCompilationResults` response message.
8469#[derive(Clone, Default, PartialEq)]
8470#[non_exhaustive]
8471pub struct ListCompilationResultsResponse {
8472 /// List of compilation results.
8473 pub compilation_results: std::vec::Vec<crate::model::CompilationResult>,
8474
8475 /// A token, which can be sent as `page_token` to retrieve the next page.
8476 /// If this field is omitted, there are no subsequent pages.
8477 pub next_page_token: std::string::String,
8478
8479 /// Locations which could not be reached.
8480 pub unreachable: std::vec::Vec<std::string::String>,
8481
8482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8483}
8484
8485impl ListCompilationResultsResponse {
8486 /// Creates a new default instance.
8487 pub fn new() -> Self {
8488 std::default::Default::default()
8489 }
8490
8491 /// Sets the value of [compilation_results][crate::model::ListCompilationResultsResponse::compilation_results].
8492 ///
8493 /// # Example
8494 /// ```ignore,no_run
8495 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8496 /// use google_cloud_dataform_v1::model::CompilationResult;
8497 /// let x = ListCompilationResultsResponse::new()
8498 /// .set_compilation_results([
8499 /// CompilationResult::default()/* use setters */,
8500 /// CompilationResult::default()/* use (different) setters */,
8501 /// ]);
8502 /// ```
8503 pub fn set_compilation_results<T, V>(mut self, v: T) -> Self
8504 where
8505 T: std::iter::IntoIterator<Item = V>,
8506 V: std::convert::Into<crate::model::CompilationResult>,
8507 {
8508 use std::iter::Iterator;
8509 self.compilation_results = v.into_iter().map(|i| i.into()).collect();
8510 self
8511 }
8512
8513 /// Sets the value of [next_page_token][crate::model::ListCompilationResultsResponse::next_page_token].
8514 ///
8515 /// # Example
8516 /// ```ignore,no_run
8517 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8518 /// let x = ListCompilationResultsResponse::new().set_next_page_token("example");
8519 /// ```
8520 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8521 self.next_page_token = v.into();
8522 self
8523 }
8524
8525 /// Sets the value of [unreachable][crate::model::ListCompilationResultsResponse::unreachable].
8526 ///
8527 /// # Example
8528 /// ```ignore,no_run
8529 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
8530 /// let x = ListCompilationResultsResponse::new().set_unreachable(["a", "b", "c"]);
8531 /// ```
8532 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8533 where
8534 T: std::iter::IntoIterator<Item = V>,
8535 V: std::convert::Into<std::string::String>,
8536 {
8537 use std::iter::Iterator;
8538 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8539 self
8540 }
8541}
8542
8543impl wkt::message::Message for ListCompilationResultsResponse {
8544 fn typename() -> &'static str {
8545 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsResponse"
8546 }
8547}
8548
8549#[doc(hidden)]
8550impl google_cloud_gax::paginator::internal::PageableResponse for ListCompilationResultsResponse {
8551 type PageItem = crate::model::CompilationResult;
8552
8553 fn items(self) -> std::vec::Vec<Self::PageItem> {
8554 self.compilation_results
8555 }
8556
8557 fn next_page_token(&self) -> std::string::String {
8558 use std::clone::Clone;
8559 self.next_page_token.clone()
8560 }
8561}
8562
8563/// `GetCompilationResult` request message.
8564#[derive(Clone, Default, PartialEq)]
8565#[non_exhaustive]
8566pub struct GetCompilationResultRequest {
8567 /// Required. The compilation result's name.
8568 pub name: std::string::String,
8569
8570 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8571}
8572
8573impl GetCompilationResultRequest {
8574 /// Creates a new default instance.
8575 pub fn new() -> Self {
8576 std::default::Default::default()
8577 }
8578
8579 /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
8580 ///
8581 /// # Example
8582 /// ```ignore,no_run
8583 /// # use google_cloud_dataform_v1::model::GetCompilationResultRequest;
8584 /// # let project_id = "project_id";
8585 /// # let location_id = "location_id";
8586 /// # let repository_id = "repository_id";
8587 /// # let compilation_result_id = "compilation_result_id";
8588 /// let x = GetCompilationResultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
8589 /// ```
8590 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8591 self.name = v.into();
8592 self
8593 }
8594}
8595
8596impl wkt::message::Message for GetCompilationResultRequest {
8597 fn typename() -> &'static str {
8598 "type.googleapis.com/google.cloud.dataform.v1.GetCompilationResultRequest"
8599 }
8600}
8601
8602/// `CreateCompilationResult` request message.
8603#[derive(Clone, Default, PartialEq)]
8604#[non_exhaustive]
8605pub struct CreateCompilationResultRequest {
8606 /// Required. The repository in which to create the compilation result. Must be
8607 /// in the format `projects/*/locations/*/repositories/*`.
8608 pub parent: std::string::String,
8609
8610 /// Required. The compilation result to create.
8611 pub compilation_result: std::option::Option<crate::model::CompilationResult>,
8612
8613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8614}
8615
8616impl CreateCompilationResultRequest {
8617 /// Creates a new default instance.
8618 pub fn new() -> Self {
8619 std::default::Default::default()
8620 }
8621
8622 /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
8623 ///
8624 /// # Example
8625 /// ```ignore,no_run
8626 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8627 /// # let project_id = "project_id";
8628 /// # let location_id = "location_id";
8629 /// # let repository_id = "repository_id";
8630 /// let x = CreateCompilationResultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8631 /// ```
8632 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8633 self.parent = v.into();
8634 self
8635 }
8636
8637 /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
8638 ///
8639 /// # Example
8640 /// ```ignore,no_run
8641 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8642 /// use google_cloud_dataform_v1::model::CompilationResult;
8643 /// let x = CreateCompilationResultRequest::new().set_compilation_result(CompilationResult::default()/* use setters */);
8644 /// ```
8645 pub fn set_compilation_result<T>(mut self, v: T) -> Self
8646 where
8647 T: std::convert::Into<crate::model::CompilationResult>,
8648 {
8649 self.compilation_result = std::option::Option::Some(v.into());
8650 self
8651 }
8652
8653 /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
8654 ///
8655 /// # Example
8656 /// ```ignore,no_run
8657 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
8658 /// use google_cloud_dataform_v1::model::CompilationResult;
8659 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(Some(CompilationResult::default()/* use setters */));
8660 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(None::<CompilationResult>);
8661 /// ```
8662 pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
8663 where
8664 T: std::convert::Into<crate::model::CompilationResult>,
8665 {
8666 self.compilation_result = v.map(|x| x.into());
8667 self
8668 }
8669}
8670
8671impl wkt::message::Message for CreateCompilationResultRequest {
8672 fn typename() -> &'static str {
8673 "type.googleapis.com/google.cloud.dataform.v1.CreateCompilationResultRequest"
8674 }
8675}
8676
8677/// Represents an action identifier. If the action writes output, the output
8678/// will be written to the referenced database object.
8679#[derive(Clone, Default, PartialEq)]
8680#[non_exhaustive]
8681pub struct Target {
8682 /// Optional. The action's database (Google Cloud project ID) .
8683 pub database: std::string::String,
8684
8685 /// Optional. The action's schema (BigQuery dataset ID), within `database`.
8686 pub schema: std::string::String,
8687
8688 /// Optional. The action's name, within `database` and `schema`.
8689 pub name: std::string::String,
8690
8691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8692}
8693
8694impl Target {
8695 /// Creates a new default instance.
8696 pub fn new() -> Self {
8697 std::default::Default::default()
8698 }
8699
8700 /// Sets the value of [database][crate::model::Target::database].
8701 ///
8702 /// # Example
8703 /// ```ignore,no_run
8704 /// # use google_cloud_dataform_v1::model::Target;
8705 /// let x = Target::new().set_database("example");
8706 /// ```
8707 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8708 self.database = v.into();
8709 self
8710 }
8711
8712 /// Sets the value of [schema][crate::model::Target::schema].
8713 ///
8714 /// # Example
8715 /// ```ignore,no_run
8716 /// # use google_cloud_dataform_v1::model::Target;
8717 /// let x = Target::new().set_schema("example");
8718 /// ```
8719 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8720 self.schema = v.into();
8721 self
8722 }
8723
8724 /// Sets the value of [name][crate::model::Target::name].
8725 ///
8726 /// # Example
8727 /// ```ignore,no_run
8728 /// # use google_cloud_dataform_v1::model::Target;
8729 /// let x = Target::new().set_name("example");
8730 /// ```
8731 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8732 self.name = v.into();
8733 self
8734 }
8735}
8736
8737impl wkt::message::Message for Target {
8738 fn typename() -> &'static str {
8739 "type.googleapis.com/google.cloud.dataform.v1.Target"
8740 }
8741}
8742
8743/// Describes a relation and its columns.
8744#[derive(Clone, Default, PartialEq)]
8745#[non_exhaustive]
8746pub struct RelationDescriptor {
8747 /// A text description of the relation.
8748 pub description: std::string::String,
8749
8750 /// A list of descriptions of columns within the relation.
8751 pub columns: std::vec::Vec<crate::model::relation_descriptor::ColumnDescriptor>,
8752
8753 /// A set of BigQuery labels that should be applied to the relation.
8754 pub bigquery_labels: std::collections::HashMap<std::string::String, std::string::String>,
8755
8756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8757}
8758
8759impl RelationDescriptor {
8760 /// Creates a new default instance.
8761 pub fn new() -> Self {
8762 std::default::Default::default()
8763 }
8764
8765 /// Sets the value of [description][crate::model::RelationDescriptor::description].
8766 ///
8767 /// # Example
8768 /// ```ignore,no_run
8769 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8770 /// let x = RelationDescriptor::new().set_description("example");
8771 /// ```
8772 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8773 self.description = v.into();
8774 self
8775 }
8776
8777 /// Sets the value of [columns][crate::model::RelationDescriptor::columns].
8778 ///
8779 /// # Example
8780 /// ```ignore,no_run
8781 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8782 /// use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8783 /// let x = RelationDescriptor::new()
8784 /// .set_columns([
8785 /// ColumnDescriptor::default()/* use setters */,
8786 /// ColumnDescriptor::default()/* use (different) setters */,
8787 /// ]);
8788 /// ```
8789 pub fn set_columns<T, V>(mut self, v: T) -> Self
8790 where
8791 T: std::iter::IntoIterator<Item = V>,
8792 V: std::convert::Into<crate::model::relation_descriptor::ColumnDescriptor>,
8793 {
8794 use std::iter::Iterator;
8795 self.columns = v.into_iter().map(|i| i.into()).collect();
8796 self
8797 }
8798
8799 /// Sets the value of [bigquery_labels][crate::model::RelationDescriptor::bigquery_labels].
8800 ///
8801 /// # Example
8802 /// ```ignore,no_run
8803 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
8804 /// let x = RelationDescriptor::new().set_bigquery_labels([
8805 /// ("key0", "abc"),
8806 /// ("key1", "xyz"),
8807 /// ]);
8808 /// ```
8809 pub fn set_bigquery_labels<T, K, V>(mut self, v: T) -> Self
8810 where
8811 T: std::iter::IntoIterator<Item = (K, V)>,
8812 K: std::convert::Into<std::string::String>,
8813 V: std::convert::Into<std::string::String>,
8814 {
8815 use std::iter::Iterator;
8816 self.bigquery_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8817 self
8818 }
8819}
8820
8821impl wkt::message::Message for RelationDescriptor {
8822 fn typename() -> &'static str {
8823 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor"
8824 }
8825}
8826
8827/// Defines additional types related to [RelationDescriptor].
8828pub mod relation_descriptor {
8829 #[allow(unused_imports)]
8830 use super::*;
8831
8832 /// Describes a column.
8833 #[derive(Clone, Default, PartialEq)]
8834 #[non_exhaustive]
8835 pub struct ColumnDescriptor {
8836 /// The identifier for the column. Each entry in `path` represents one level
8837 /// of nesting.
8838 pub path: std::vec::Vec<std::string::String>,
8839
8840 /// A textual description of the column.
8841 pub description: std::string::String,
8842
8843 /// A list of BigQuery policy tags that will be applied to the column.
8844 pub bigquery_policy_tags: std::vec::Vec<std::string::String>,
8845
8846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8847 }
8848
8849 impl ColumnDescriptor {
8850 /// Creates a new default instance.
8851 pub fn new() -> Self {
8852 std::default::Default::default()
8853 }
8854
8855 /// Sets the value of [path][crate::model::relation_descriptor::ColumnDescriptor::path].
8856 ///
8857 /// # Example
8858 /// ```ignore,no_run
8859 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8860 /// let x = ColumnDescriptor::new().set_path(["a", "b", "c"]);
8861 /// ```
8862 pub fn set_path<T, V>(mut self, v: T) -> Self
8863 where
8864 T: std::iter::IntoIterator<Item = V>,
8865 V: std::convert::Into<std::string::String>,
8866 {
8867 use std::iter::Iterator;
8868 self.path = v.into_iter().map(|i| i.into()).collect();
8869 self
8870 }
8871
8872 /// Sets the value of [description][crate::model::relation_descriptor::ColumnDescriptor::description].
8873 ///
8874 /// # Example
8875 /// ```ignore,no_run
8876 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8877 /// let x = ColumnDescriptor::new().set_description("example");
8878 /// ```
8879 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8880 self.description = v.into();
8881 self
8882 }
8883
8884 /// Sets the value of [bigquery_policy_tags][crate::model::relation_descriptor::ColumnDescriptor::bigquery_policy_tags].
8885 ///
8886 /// # Example
8887 /// ```ignore,no_run
8888 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
8889 /// let x = ColumnDescriptor::new().set_bigquery_policy_tags(["a", "b", "c"]);
8890 /// ```
8891 pub fn set_bigquery_policy_tags<T, V>(mut self, v: T) -> Self
8892 where
8893 T: std::iter::IntoIterator<Item = V>,
8894 V: std::convert::Into<std::string::String>,
8895 {
8896 use std::iter::Iterator;
8897 self.bigquery_policy_tags = v.into_iter().map(|i| i.into()).collect();
8898 self
8899 }
8900 }
8901
8902 impl wkt::message::Message for ColumnDescriptor {
8903 fn typename() -> &'static str {
8904 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor.ColumnDescriptor"
8905 }
8906 }
8907}
8908
8909/// Represents a single Dataform action in a compilation result.
8910#[derive(Clone, Default, PartialEq)]
8911#[non_exhaustive]
8912pub struct CompilationResultAction {
8913 /// This action's identifier. Unique within the compilation result.
8914 pub target: std::option::Option<crate::model::Target>,
8915
8916 /// The action's identifier if the project had been compiled without any
8917 /// overrides configured. Unique within the compilation result.
8918 pub canonical_target: std::option::Option<crate::model::Target>,
8919
8920 /// The full path including filename in which this action is located, relative
8921 /// to the workspace root.
8922 pub file_path: std::string::String,
8923
8924 /// Output only. All the metadata information that is used internally to serve
8925 /// the resource. For example: timestamps, flags, status fields, etc. The
8926 /// format of this field is a JSON string.
8927 pub internal_metadata: std::option::Option<std::string::String>,
8928
8929 /// The compiled object.
8930 pub compiled_object:
8931 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
8932
8933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8934}
8935
8936impl CompilationResultAction {
8937 /// Creates a new default instance.
8938 pub fn new() -> Self {
8939 std::default::Default::default()
8940 }
8941
8942 /// Sets the value of [target][crate::model::CompilationResultAction::target].
8943 ///
8944 /// # Example
8945 /// ```ignore,no_run
8946 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8947 /// use google_cloud_dataform_v1::model::Target;
8948 /// let x = CompilationResultAction::new().set_target(Target::default()/* use setters */);
8949 /// ```
8950 pub fn set_target<T>(mut self, v: T) -> Self
8951 where
8952 T: std::convert::Into<crate::model::Target>,
8953 {
8954 self.target = std::option::Option::Some(v.into());
8955 self
8956 }
8957
8958 /// Sets or clears the value of [target][crate::model::CompilationResultAction::target].
8959 ///
8960 /// # Example
8961 /// ```ignore,no_run
8962 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8963 /// use google_cloud_dataform_v1::model::Target;
8964 /// let x = CompilationResultAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
8965 /// let x = CompilationResultAction::new().set_or_clear_target(None::<Target>);
8966 /// ```
8967 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
8968 where
8969 T: std::convert::Into<crate::model::Target>,
8970 {
8971 self.target = v.map(|x| x.into());
8972 self
8973 }
8974
8975 /// Sets the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8980 /// use google_cloud_dataform_v1::model::Target;
8981 /// let x = CompilationResultAction::new().set_canonical_target(Target::default()/* use setters */);
8982 /// ```
8983 pub fn set_canonical_target<T>(mut self, v: T) -> Self
8984 where
8985 T: std::convert::Into<crate::model::Target>,
8986 {
8987 self.canonical_target = std::option::Option::Some(v.into());
8988 self
8989 }
8990
8991 /// Sets or clears the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
8992 ///
8993 /// # Example
8994 /// ```ignore,no_run
8995 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8996 /// use google_cloud_dataform_v1::model::Target;
8997 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
8998 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(None::<Target>);
8999 /// ```
9000 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
9001 where
9002 T: std::convert::Into<crate::model::Target>,
9003 {
9004 self.canonical_target = v.map(|x| x.into());
9005 self
9006 }
9007
9008 /// Sets the value of [file_path][crate::model::CompilationResultAction::file_path].
9009 ///
9010 /// # Example
9011 /// ```ignore,no_run
9012 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9013 /// let x = CompilationResultAction::new().set_file_path("example");
9014 /// ```
9015 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9016 self.file_path = v.into();
9017 self
9018 }
9019
9020 /// Sets the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
9021 ///
9022 /// # Example
9023 /// ```ignore,no_run
9024 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9025 /// let x = CompilationResultAction::new().set_internal_metadata("example");
9026 /// ```
9027 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
9028 where
9029 T: std::convert::Into<std::string::String>,
9030 {
9031 self.internal_metadata = std::option::Option::Some(v.into());
9032 self
9033 }
9034
9035 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9040 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(Some("example"));
9041 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(None::<String>);
9042 /// ```
9043 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9044 where
9045 T: std::convert::Into<std::string::String>,
9046 {
9047 self.internal_metadata = v.map(|x| x.into());
9048 self
9049 }
9050
9051 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object].
9052 ///
9053 /// Note that all the setters affecting `compiled_object` are mutually
9054 /// exclusive.
9055 ///
9056 /// # Example
9057 /// ```ignore,no_run
9058 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9059 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9060 /// let x = CompilationResultAction::new().set_compiled_object(Some(
9061 /// google_cloud_dataform_v1::model::compilation_result_action::CompiledObject::Relation(Relation::default().into())));
9062 /// ```
9063 pub fn set_compiled_object<
9064 T: std::convert::Into<
9065 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
9066 >,
9067 >(
9068 mut self,
9069 v: T,
9070 ) -> Self {
9071 self.compiled_object = v.into();
9072 self
9073 }
9074
9075 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9076 /// if it holds a `Relation`, `None` if the field is not set or
9077 /// holds a different branch.
9078 pub fn relation(
9079 &self,
9080 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Relation>>
9081 {
9082 #[allow(unreachable_patterns)]
9083 self.compiled_object.as_ref().and_then(|v| match v {
9084 crate::model::compilation_result_action::CompiledObject::Relation(v) => {
9085 std::option::Option::Some(v)
9086 }
9087 _ => std::option::Option::None,
9088 })
9089 }
9090
9091 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9092 /// to hold a `Relation`.
9093 ///
9094 /// Note that all the setters affecting `compiled_object` are
9095 /// mutually exclusive.
9096 ///
9097 /// # Example
9098 /// ```ignore,no_run
9099 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9100 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9101 /// let x = CompilationResultAction::new().set_relation(Relation::default()/* use setters */);
9102 /// assert!(x.relation().is_some());
9103 /// assert!(x.operations().is_none());
9104 /// assert!(x.assertion().is_none());
9105 /// assert!(x.declaration().is_none());
9106 /// assert!(x.notebook().is_none());
9107 /// assert!(x.data_preparation().is_none());
9108 /// ```
9109 pub fn set_relation<
9110 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Relation>>,
9111 >(
9112 mut self,
9113 v: T,
9114 ) -> Self {
9115 self.compiled_object = std::option::Option::Some(
9116 crate::model::compilation_result_action::CompiledObject::Relation(v.into()),
9117 );
9118 self
9119 }
9120
9121 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9122 /// if it holds a `Operations`, `None` if the field is not set or
9123 /// holds a different branch.
9124 pub fn operations(
9125 &self,
9126 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Operations>>
9127 {
9128 #[allow(unreachable_patterns)]
9129 self.compiled_object.as_ref().and_then(|v| match v {
9130 crate::model::compilation_result_action::CompiledObject::Operations(v) => {
9131 std::option::Option::Some(v)
9132 }
9133 _ => std::option::Option::None,
9134 })
9135 }
9136
9137 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9138 /// to hold a `Operations`.
9139 ///
9140 /// Note that all the setters affecting `compiled_object` are
9141 /// mutually exclusive.
9142 ///
9143 /// # Example
9144 /// ```ignore,no_run
9145 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9146 /// use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9147 /// let x = CompilationResultAction::new().set_operations(Operations::default()/* use setters */);
9148 /// assert!(x.operations().is_some());
9149 /// assert!(x.relation().is_none());
9150 /// assert!(x.assertion().is_none());
9151 /// assert!(x.declaration().is_none());
9152 /// assert!(x.notebook().is_none());
9153 /// assert!(x.data_preparation().is_none());
9154 /// ```
9155 pub fn set_operations<
9156 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Operations>>,
9157 >(
9158 mut self,
9159 v: T,
9160 ) -> Self {
9161 self.compiled_object = std::option::Option::Some(
9162 crate::model::compilation_result_action::CompiledObject::Operations(v.into()),
9163 );
9164 self
9165 }
9166
9167 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9168 /// if it holds a `Assertion`, `None` if the field is not set or
9169 /// holds a different branch.
9170 pub fn assertion(
9171 &self,
9172 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Assertion>>
9173 {
9174 #[allow(unreachable_patterns)]
9175 self.compiled_object.as_ref().and_then(|v| match v {
9176 crate::model::compilation_result_action::CompiledObject::Assertion(v) => {
9177 std::option::Option::Some(v)
9178 }
9179 _ => std::option::Option::None,
9180 })
9181 }
9182
9183 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9184 /// to hold a `Assertion`.
9185 ///
9186 /// Note that all the setters affecting `compiled_object` are
9187 /// mutually exclusive.
9188 ///
9189 /// # Example
9190 /// ```ignore,no_run
9191 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9192 /// use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9193 /// let x = CompilationResultAction::new().set_assertion(Assertion::default()/* use setters */);
9194 /// assert!(x.assertion().is_some());
9195 /// assert!(x.relation().is_none());
9196 /// assert!(x.operations().is_none());
9197 /// assert!(x.declaration().is_none());
9198 /// assert!(x.notebook().is_none());
9199 /// assert!(x.data_preparation().is_none());
9200 /// ```
9201 pub fn set_assertion<
9202 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Assertion>>,
9203 >(
9204 mut self,
9205 v: T,
9206 ) -> Self {
9207 self.compiled_object = std::option::Option::Some(
9208 crate::model::compilation_result_action::CompiledObject::Assertion(v.into()),
9209 );
9210 self
9211 }
9212
9213 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9214 /// if it holds a `Declaration`, `None` if the field is not set or
9215 /// holds a different branch.
9216 pub fn declaration(
9217 &self,
9218 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Declaration>>
9219 {
9220 #[allow(unreachable_patterns)]
9221 self.compiled_object.as_ref().and_then(|v| match v {
9222 crate::model::compilation_result_action::CompiledObject::Declaration(v) => {
9223 std::option::Option::Some(v)
9224 }
9225 _ => std::option::Option::None,
9226 })
9227 }
9228
9229 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9230 /// to hold a `Declaration`.
9231 ///
9232 /// Note that all the setters affecting `compiled_object` are
9233 /// mutually exclusive.
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9238 /// use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
9239 /// let x = CompilationResultAction::new().set_declaration(Declaration::default()/* use setters */);
9240 /// assert!(x.declaration().is_some());
9241 /// assert!(x.relation().is_none());
9242 /// assert!(x.operations().is_none());
9243 /// assert!(x.assertion().is_none());
9244 /// assert!(x.notebook().is_none());
9245 /// assert!(x.data_preparation().is_none());
9246 /// ```
9247 pub fn set_declaration<
9248 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Declaration>>,
9249 >(
9250 mut self,
9251 v: T,
9252 ) -> Self {
9253 self.compiled_object = std::option::Option::Some(
9254 crate::model::compilation_result_action::CompiledObject::Declaration(v.into()),
9255 );
9256 self
9257 }
9258
9259 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9260 /// if it holds a `Notebook`, `None` if the field is not set or
9261 /// holds a different branch.
9262 pub fn notebook(
9263 &self,
9264 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Notebook>>
9265 {
9266 #[allow(unreachable_patterns)]
9267 self.compiled_object.as_ref().and_then(|v| match v {
9268 crate::model::compilation_result_action::CompiledObject::Notebook(v) => {
9269 std::option::Option::Some(v)
9270 }
9271 _ => std::option::Option::None,
9272 })
9273 }
9274
9275 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9276 /// to hold a `Notebook`.
9277 ///
9278 /// Note that all the setters affecting `compiled_object` are
9279 /// mutually exclusive.
9280 ///
9281 /// # Example
9282 /// ```ignore,no_run
9283 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9284 /// use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9285 /// let x = CompilationResultAction::new().set_notebook(Notebook::default()/* use setters */);
9286 /// assert!(x.notebook().is_some());
9287 /// assert!(x.relation().is_none());
9288 /// assert!(x.operations().is_none());
9289 /// assert!(x.assertion().is_none());
9290 /// assert!(x.declaration().is_none());
9291 /// assert!(x.data_preparation().is_none());
9292 /// ```
9293 pub fn set_notebook<
9294 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Notebook>>,
9295 >(
9296 mut self,
9297 v: T,
9298 ) -> Self {
9299 self.compiled_object = std::option::Option::Some(
9300 crate::model::compilation_result_action::CompiledObject::Notebook(v.into()),
9301 );
9302 self
9303 }
9304
9305 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9306 /// if it holds a `DataPreparation`, `None` if the field is not set or
9307 /// holds a different branch.
9308 pub fn data_preparation(
9309 &self,
9310 ) -> std::option::Option<
9311 &std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
9312 > {
9313 #[allow(unreachable_patterns)]
9314 self.compiled_object.as_ref().and_then(|v| match v {
9315 crate::model::compilation_result_action::CompiledObject::DataPreparation(v) => {
9316 std::option::Option::Some(v)
9317 }
9318 _ => std::option::Option::None,
9319 })
9320 }
9321
9322 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
9323 /// to hold a `DataPreparation`.
9324 ///
9325 /// Note that all the setters affecting `compiled_object` are
9326 /// mutually exclusive.
9327 ///
9328 /// # Example
9329 /// ```ignore,no_run
9330 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
9331 /// use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9332 /// let x = CompilationResultAction::new().set_data_preparation(DataPreparation::default()/* use setters */);
9333 /// assert!(x.data_preparation().is_some());
9334 /// assert!(x.relation().is_none());
9335 /// assert!(x.operations().is_none());
9336 /// assert!(x.assertion().is_none());
9337 /// assert!(x.declaration().is_none());
9338 /// assert!(x.notebook().is_none());
9339 /// ```
9340 pub fn set_data_preparation<
9341 T: std::convert::Into<
9342 std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
9343 >,
9344 >(
9345 mut self,
9346 v: T,
9347 ) -> Self {
9348 self.compiled_object = std::option::Option::Some(
9349 crate::model::compilation_result_action::CompiledObject::DataPreparation(v.into()),
9350 );
9351 self
9352 }
9353}
9354
9355impl wkt::message::Message for CompilationResultAction {
9356 fn typename() -> &'static str {
9357 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction"
9358 }
9359}
9360
9361/// Defines additional types related to [CompilationResultAction].
9362pub mod compilation_result_action {
9363 #[allow(unused_imports)]
9364 use super::*;
9365
9366 /// Represents a database relation.
9367 #[derive(Clone, Default, PartialEq)]
9368 #[non_exhaustive]
9369 pub struct Relation {
9370 /// A list of actions that this action depends on.
9371 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9372
9373 /// Whether this action is disabled (i.e. should not be run).
9374 pub disabled: bool,
9375
9376 /// Arbitrary, user-defined tags on this action.
9377 pub tags: std::vec::Vec<std::string::String>,
9378
9379 /// Descriptor for the relation and its columns.
9380 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
9381
9382 /// The type of this relation.
9383 pub relation_type: crate::model::compilation_result_action::relation::RelationType,
9384
9385 /// The SELECT query which returns rows which this relation should contain.
9386 pub select_query: std::string::String,
9387
9388 /// SQL statements to be executed before creating the relation.
9389 pub pre_operations: std::vec::Vec<std::string::String>,
9390
9391 /// SQL statements to be executed after creating the relation.
9392 pub post_operations: std::vec::Vec<std::string::String>,
9393
9394 /// Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
9395 /// `relation_type` is `INCREMENTAL_TABLE`.
9396 pub incremental_table_config: std::option::Option<
9397 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9398 >,
9399
9400 /// The SQL expression used to partition the relation.
9401 pub partition_expression: std::string::String,
9402
9403 /// A list of columns or SQL expressions used to cluster the table.
9404 pub cluster_expressions: std::vec::Vec<std::string::String>,
9405
9406 /// Sets the partition expiration in days.
9407 pub partition_expiration_days: i32,
9408
9409 /// Specifies whether queries on this table must include a predicate filter
9410 /// that filters on the partitioning column.
9411 pub require_partition_filter: bool,
9412
9413 /// Additional options that will be provided as key/value pairs into the
9414 /// options clause of a create table/view statement. See
9415 /// <https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language>
9416 /// for more information on which options are supported.
9417 pub additional_options: std::collections::HashMap<std::string::String, std::string::String>,
9418
9419 /// Optional. The connection specifying the credentials to be used to read
9420 /// and write to external storage, such as Cloud Storage. The connection can
9421 /// have the form `{project}.{location}.{connection_id}` or
9422 /// `projects/{project}/locations/{location}/connections/{connection_id}`,
9423 /// or be set to DEFAULT.
9424 pub connection: std::string::String,
9425
9426 /// Optional. The table format for the BigQuery table.
9427 pub table_format: crate::model::compilation_result_action::relation::TableFormat,
9428
9429 /// Optional. The file format for the BigQuery table.
9430 pub file_format: crate::model::compilation_result_action::relation::FileFormat,
9431
9432 /// Optional. The fully qualified location prefix of the external folder
9433 /// where table data is stored. The URI should be in the format
9434 /// `gs://bucket/path_to_table/`.
9435 pub storage_uri: std::string::String,
9436
9437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9438 }
9439
9440 impl Relation {
9441 /// Creates a new default instance.
9442 pub fn new() -> Self {
9443 std::default::Default::default()
9444 }
9445
9446 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Relation::dependency_targets].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9451 /// use google_cloud_dataform_v1::model::Target;
9452 /// let x = Relation::new()
9453 /// .set_dependency_targets([
9454 /// Target::default()/* use setters */,
9455 /// Target::default()/* use (different) setters */,
9456 /// ]);
9457 /// ```
9458 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9459 where
9460 T: std::iter::IntoIterator<Item = V>,
9461 V: std::convert::Into<crate::model::Target>,
9462 {
9463 use std::iter::Iterator;
9464 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9465 self
9466 }
9467
9468 /// Sets the value of [disabled][crate::model::compilation_result_action::Relation::disabled].
9469 ///
9470 /// # Example
9471 /// ```ignore,no_run
9472 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9473 /// let x = Relation::new().set_disabled(true);
9474 /// ```
9475 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9476 self.disabled = v.into();
9477 self
9478 }
9479
9480 /// Sets the value of [tags][crate::model::compilation_result_action::Relation::tags].
9481 ///
9482 /// # Example
9483 /// ```ignore,no_run
9484 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9485 /// let x = Relation::new().set_tags(["a", "b", "c"]);
9486 /// ```
9487 pub fn set_tags<T, V>(mut self, v: T) -> Self
9488 where
9489 T: std::iter::IntoIterator<Item = V>,
9490 V: std::convert::Into<std::string::String>,
9491 {
9492 use std::iter::Iterator;
9493 self.tags = v.into_iter().map(|i| i.into()).collect();
9494 self
9495 }
9496
9497 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
9498 ///
9499 /// # Example
9500 /// ```ignore,no_run
9501 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9502 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9503 /// let x = Relation::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
9504 /// ```
9505 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
9506 where
9507 T: std::convert::Into<crate::model::RelationDescriptor>,
9508 {
9509 self.relation_descriptor = std::option::Option::Some(v.into());
9510 self
9511 }
9512
9513 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
9514 ///
9515 /// # Example
9516 /// ```ignore,no_run
9517 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9518 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9519 /// let x = Relation::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
9520 /// let x = Relation::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
9521 /// ```
9522 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
9523 where
9524 T: std::convert::Into<crate::model::RelationDescriptor>,
9525 {
9526 self.relation_descriptor = v.map(|x| x.into());
9527 self
9528 }
9529
9530 /// Sets the value of [relation_type][crate::model::compilation_result_action::Relation::relation_type].
9531 ///
9532 /// # Example
9533 /// ```ignore,no_run
9534 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9535 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::RelationType;
9536 /// let x0 = Relation::new().set_relation_type(RelationType::Table);
9537 /// let x1 = Relation::new().set_relation_type(RelationType::View);
9538 /// let x2 = Relation::new().set_relation_type(RelationType::IncrementalTable);
9539 /// ```
9540 pub fn set_relation_type<
9541 T: std::convert::Into<crate::model::compilation_result_action::relation::RelationType>,
9542 >(
9543 mut self,
9544 v: T,
9545 ) -> Self {
9546 self.relation_type = v.into();
9547 self
9548 }
9549
9550 /// Sets the value of [select_query][crate::model::compilation_result_action::Relation::select_query].
9551 ///
9552 /// # Example
9553 /// ```ignore,no_run
9554 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9555 /// let x = Relation::new().set_select_query("example");
9556 /// ```
9557 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9558 mut self,
9559 v: T,
9560 ) -> Self {
9561 self.select_query = v.into();
9562 self
9563 }
9564
9565 /// Sets the value of [pre_operations][crate::model::compilation_result_action::Relation::pre_operations].
9566 ///
9567 /// # Example
9568 /// ```ignore,no_run
9569 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9570 /// let x = Relation::new().set_pre_operations(["a", "b", "c"]);
9571 /// ```
9572 pub fn set_pre_operations<T, V>(mut self, v: T) -> Self
9573 where
9574 T: std::iter::IntoIterator<Item = V>,
9575 V: std::convert::Into<std::string::String>,
9576 {
9577 use std::iter::Iterator;
9578 self.pre_operations = v.into_iter().map(|i| i.into()).collect();
9579 self
9580 }
9581
9582 /// Sets the value of [post_operations][crate::model::compilation_result_action::Relation::post_operations].
9583 ///
9584 /// # Example
9585 /// ```ignore,no_run
9586 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9587 /// let x = Relation::new().set_post_operations(["a", "b", "c"]);
9588 /// ```
9589 pub fn set_post_operations<T, V>(mut self, v: T) -> Self
9590 where
9591 T: std::iter::IntoIterator<Item = V>,
9592 V: std::convert::Into<std::string::String>,
9593 {
9594 use std::iter::Iterator;
9595 self.post_operations = v.into_iter().map(|i| i.into()).collect();
9596 self
9597 }
9598
9599 /// Sets the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
9600 ///
9601 /// # Example
9602 /// ```ignore,no_run
9603 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9604 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9605 /// let x = Relation::new().set_incremental_table_config(IncrementalTableConfig::default()/* use setters */);
9606 /// ```
9607 pub fn set_incremental_table_config<T>(mut self, v: T) -> Self
9608 where
9609 T: std::convert::Into<
9610 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9611 >,
9612 {
9613 self.incremental_table_config = std::option::Option::Some(v.into());
9614 self
9615 }
9616
9617 /// Sets or clears the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
9618 ///
9619 /// # Example
9620 /// ```ignore,no_run
9621 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9622 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9623 /// let x = Relation::new().set_or_clear_incremental_table_config(Some(IncrementalTableConfig::default()/* use setters */));
9624 /// let x = Relation::new().set_or_clear_incremental_table_config(None::<IncrementalTableConfig>);
9625 /// ```
9626 pub fn set_or_clear_incremental_table_config<T>(mut self, v: std::option::Option<T>) -> Self
9627 where
9628 T: std::convert::Into<
9629 crate::model::compilation_result_action::relation::IncrementalTableConfig,
9630 >,
9631 {
9632 self.incremental_table_config = v.map(|x| x.into());
9633 self
9634 }
9635
9636 /// Sets the value of [partition_expression][crate::model::compilation_result_action::Relation::partition_expression].
9637 ///
9638 /// # Example
9639 /// ```ignore,no_run
9640 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9641 /// let x = Relation::new().set_partition_expression("example");
9642 /// ```
9643 pub fn set_partition_expression<T: std::convert::Into<std::string::String>>(
9644 mut self,
9645 v: T,
9646 ) -> Self {
9647 self.partition_expression = v.into();
9648 self
9649 }
9650
9651 /// Sets the value of [cluster_expressions][crate::model::compilation_result_action::Relation::cluster_expressions].
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9656 /// let x = Relation::new().set_cluster_expressions(["a", "b", "c"]);
9657 /// ```
9658 pub fn set_cluster_expressions<T, V>(mut self, v: T) -> Self
9659 where
9660 T: std::iter::IntoIterator<Item = V>,
9661 V: std::convert::Into<std::string::String>,
9662 {
9663 use std::iter::Iterator;
9664 self.cluster_expressions = v.into_iter().map(|i| i.into()).collect();
9665 self
9666 }
9667
9668 /// Sets the value of [partition_expiration_days][crate::model::compilation_result_action::Relation::partition_expiration_days].
9669 ///
9670 /// # Example
9671 /// ```ignore,no_run
9672 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9673 /// let x = Relation::new().set_partition_expiration_days(42);
9674 /// ```
9675 pub fn set_partition_expiration_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9676 self.partition_expiration_days = v.into();
9677 self
9678 }
9679
9680 /// Sets the value of [require_partition_filter][crate::model::compilation_result_action::Relation::require_partition_filter].
9681 ///
9682 /// # Example
9683 /// ```ignore,no_run
9684 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9685 /// let x = Relation::new().set_require_partition_filter(true);
9686 /// ```
9687 pub fn set_require_partition_filter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9688 self.require_partition_filter = v.into();
9689 self
9690 }
9691
9692 /// Sets the value of [additional_options][crate::model::compilation_result_action::Relation::additional_options].
9693 ///
9694 /// # Example
9695 /// ```ignore,no_run
9696 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9697 /// let x = Relation::new().set_additional_options([
9698 /// ("key0", "abc"),
9699 /// ("key1", "xyz"),
9700 /// ]);
9701 /// ```
9702 pub fn set_additional_options<T, K, V>(mut self, v: T) -> Self
9703 where
9704 T: std::iter::IntoIterator<Item = (K, V)>,
9705 K: std::convert::Into<std::string::String>,
9706 V: std::convert::Into<std::string::String>,
9707 {
9708 use std::iter::Iterator;
9709 self.additional_options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9710 self
9711 }
9712
9713 /// Sets the value of [connection][crate::model::compilation_result_action::Relation::connection].
9714 ///
9715 /// # Example
9716 /// ```ignore,no_run
9717 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9718 /// let x = Relation::new().set_connection("example");
9719 /// ```
9720 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9721 self.connection = v.into();
9722 self
9723 }
9724
9725 /// Sets the value of [table_format][crate::model::compilation_result_action::Relation::table_format].
9726 ///
9727 /// # Example
9728 /// ```ignore,no_run
9729 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9730 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::TableFormat;
9731 /// let x0 = Relation::new().set_table_format(TableFormat::Iceberg);
9732 /// ```
9733 pub fn set_table_format<
9734 T: std::convert::Into<crate::model::compilation_result_action::relation::TableFormat>,
9735 >(
9736 mut self,
9737 v: T,
9738 ) -> Self {
9739 self.table_format = v.into();
9740 self
9741 }
9742
9743 /// Sets the value of [file_format][crate::model::compilation_result_action::Relation::file_format].
9744 ///
9745 /// # Example
9746 /// ```ignore,no_run
9747 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9748 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::FileFormat;
9749 /// let x0 = Relation::new().set_file_format(FileFormat::Parquet);
9750 /// ```
9751 pub fn set_file_format<
9752 T: std::convert::Into<crate::model::compilation_result_action::relation::FileFormat>,
9753 >(
9754 mut self,
9755 v: T,
9756 ) -> Self {
9757 self.file_format = v.into();
9758 self
9759 }
9760
9761 /// Sets the value of [storage_uri][crate::model::compilation_result_action::Relation::storage_uri].
9762 ///
9763 /// # Example
9764 /// ```ignore,no_run
9765 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
9766 /// let x = Relation::new().set_storage_uri("example");
9767 /// ```
9768 pub fn set_storage_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9769 self.storage_uri = v.into();
9770 self
9771 }
9772 }
9773
9774 impl wkt::message::Message for Relation {
9775 fn typename() -> &'static str {
9776 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation"
9777 }
9778 }
9779
9780 /// Defines additional types related to [Relation].
9781 pub mod relation {
9782 #[allow(unused_imports)]
9783 use super::*;
9784
9785 /// Contains settings for relations of type `INCREMENTAL_TABLE`.
9786 #[derive(Clone, Default, PartialEq)]
9787 #[non_exhaustive]
9788 pub struct IncrementalTableConfig {
9789 /// The SELECT query which returns rows which should be inserted into the
9790 /// relation if it already exists and is not being refreshed.
9791 pub incremental_select_query: std::string::String,
9792
9793 /// Whether this table should be protected from being refreshed.
9794 pub refresh_disabled: bool,
9795
9796 /// A set of columns or SQL expressions used to define row uniqueness.
9797 /// If any duplicates are discovered (as defined by `unique_key_parts`),
9798 /// only the newly selected rows (as defined by `incremental_select_query`)
9799 /// will be included in the relation.
9800 pub unique_key_parts: std::vec::Vec<std::string::String>,
9801
9802 /// A SQL expression conditional used to limit the set of existing rows
9803 /// considered for a merge operation (see `unique_key_parts` for more
9804 /// information).
9805 pub update_partition_filter: std::string::String,
9806
9807 /// SQL statements to be executed before inserting new rows into the
9808 /// relation.
9809 pub incremental_pre_operations: std::vec::Vec<std::string::String>,
9810
9811 /// SQL statements to be executed after inserting new rows into the
9812 /// relation.
9813 pub incremental_post_operations: std::vec::Vec<std::string::String>,
9814
9815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9816 }
9817
9818 impl IncrementalTableConfig {
9819 /// Creates a new default instance.
9820 pub fn new() -> Self {
9821 std::default::Default::default()
9822 }
9823
9824 /// Sets the value of [incremental_select_query][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_select_query].
9825 ///
9826 /// # Example
9827 /// ```ignore,no_run
9828 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9829 /// let x = IncrementalTableConfig::new().set_incremental_select_query("example");
9830 /// ```
9831 pub fn set_incremental_select_query<T: std::convert::Into<std::string::String>>(
9832 mut self,
9833 v: T,
9834 ) -> Self {
9835 self.incremental_select_query = v.into();
9836 self
9837 }
9838
9839 /// Sets the value of [refresh_disabled][crate::model::compilation_result_action::relation::IncrementalTableConfig::refresh_disabled].
9840 ///
9841 /// # Example
9842 /// ```ignore,no_run
9843 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9844 /// let x = IncrementalTableConfig::new().set_refresh_disabled(true);
9845 /// ```
9846 pub fn set_refresh_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9847 self.refresh_disabled = v.into();
9848 self
9849 }
9850
9851 /// Sets the value of [unique_key_parts][crate::model::compilation_result_action::relation::IncrementalTableConfig::unique_key_parts].
9852 ///
9853 /// # Example
9854 /// ```ignore,no_run
9855 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9856 /// let x = IncrementalTableConfig::new().set_unique_key_parts(["a", "b", "c"]);
9857 /// ```
9858 pub fn set_unique_key_parts<T, V>(mut self, v: T) -> Self
9859 where
9860 T: std::iter::IntoIterator<Item = V>,
9861 V: std::convert::Into<std::string::String>,
9862 {
9863 use std::iter::Iterator;
9864 self.unique_key_parts = v.into_iter().map(|i| i.into()).collect();
9865 self
9866 }
9867
9868 /// Sets the value of [update_partition_filter][crate::model::compilation_result_action::relation::IncrementalTableConfig::update_partition_filter].
9869 ///
9870 /// # Example
9871 /// ```ignore,no_run
9872 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9873 /// let x = IncrementalTableConfig::new().set_update_partition_filter("example");
9874 /// ```
9875 pub fn set_update_partition_filter<T: std::convert::Into<std::string::String>>(
9876 mut self,
9877 v: T,
9878 ) -> Self {
9879 self.update_partition_filter = v.into();
9880 self
9881 }
9882
9883 /// Sets the value of [incremental_pre_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_pre_operations].
9884 ///
9885 /// # Example
9886 /// ```ignore,no_run
9887 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9888 /// let x = IncrementalTableConfig::new().set_incremental_pre_operations(["a", "b", "c"]);
9889 /// ```
9890 pub fn set_incremental_pre_operations<T, V>(mut self, v: T) -> Self
9891 where
9892 T: std::iter::IntoIterator<Item = V>,
9893 V: std::convert::Into<std::string::String>,
9894 {
9895 use std::iter::Iterator;
9896 self.incremental_pre_operations = v.into_iter().map(|i| i.into()).collect();
9897 self
9898 }
9899
9900 /// Sets the value of [incremental_post_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_post_operations].
9901 ///
9902 /// # Example
9903 /// ```ignore,no_run
9904 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
9905 /// let x = IncrementalTableConfig::new().set_incremental_post_operations(["a", "b", "c"]);
9906 /// ```
9907 pub fn set_incremental_post_operations<T, V>(mut self, v: T) -> Self
9908 where
9909 T: std::iter::IntoIterator<Item = V>,
9910 V: std::convert::Into<std::string::String>,
9911 {
9912 use std::iter::Iterator;
9913 self.incremental_post_operations = v.into_iter().map(|i| i.into()).collect();
9914 self
9915 }
9916 }
9917
9918 impl wkt::message::Message for IncrementalTableConfig {
9919 fn typename() -> &'static str {
9920 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation.IncrementalTableConfig"
9921 }
9922 }
9923
9924 /// Indicates the type of this relation.
9925 ///
9926 /// # Working with unknown values
9927 ///
9928 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9929 /// additional enum variants at any time. Adding new variants is not considered
9930 /// a breaking change. Applications should write their code in anticipation of:
9931 ///
9932 /// - New values appearing in future releases of the client library, **and**
9933 /// - New values received dynamically, without application changes.
9934 ///
9935 /// Please consult the [Working with enums] section in the user guide for some
9936 /// guidelines.
9937 ///
9938 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9939 #[derive(Clone, Debug, PartialEq)]
9940 #[non_exhaustive]
9941 pub enum RelationType {
9942 /// Default value. This value is unused.
9943 Unspecified,
9944 /// The relation is a table.
9945 Table,
9946 /// The relation is a view.
9947 View,
9948 /// The relation is an incrementalized table.
9949 IncrementalTable,
9950 /// The relation is a materialized view.
9951 MaterializedView,
9952 /// If set, the enum was initialized with an unknown value.
9953 ///
9954 /// Applications can examine the value using [RelationType::value] or
9955 /// [RelationType::name].
9956 UnknownValue(relation_type::UnknownValue),
9957 }
9958
9959 #[doc(hidden)]
9960 pub mod relation_type {
9961 #[allow(unused_imports)]
9962 use super::*;
9963 #[derive(Clone, Debug, PartialEq)]
9964 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9965 }
9966
9967 impl RelationType {
9968 /// Gets the enum value.
9969 ///
9970 /// Returns `None` if the enum contains an unknown value deserialized from
9971 /// the string representation of enums.
9972 pub fn value(&self) -> std::option::Option<i32> {
9973 match self {
9974 Self::Unspecified => std::option::Option::Some(0),
9975 Self::Table => std::option::Option::Some(1),
9976 Self::View => std::option::Option::Some(2),
9977 Self::IncrementalTable => std::option::Option::Some(3),
9978 Self::MaterializedView => std::option::Option::Some(4),
9979 Self::UnknownValue(u) => u.0.value(),
9980 }
9981 }
9982
9983 /// Gets the enum value as a string.
9984 ///
9985 /// Returns `None` if the enum contains an unknown value deserialized from
9986 /// the integer representation of enums.
9987 pub fn name(&self) -> std::option::Option<&str> {
9988 match self {
9989 Self::Unspecified => std::option::Option::Some("RELATION_TYPE_UNSPECIFIED"),
9990 Self::Table => std::option::Option::Some("TABLE"),
9991 Self::View => std::option::Option::Some("VIEW"),
9992 Self::IncrementalTable => std::option::Option::Some("INCREMENTAL_TABLE"),
9993 Self::MaterializedView => std::option::Option::Some("MATERIALIZED_VIEW"),
9994 Self::UnknownValue(u) => u.0.name(),
9995 }
9996 }
9997 }
9998
9999 impl std::default::Default for RelationType {
10000 fn default() -> Self {
10001 use std::convert::From;
10002 Self::from(0)
10003 }
10004 }
10005
10006 impl std::fmt::Display for RelationType {
10007 fn fmt(
10008 &self,
10009 f: &mut std::fmt::Formatter<'_>,
10010 ) -> std::result::Result<(), std::fmt::Error> {
10011 wkt::internal::display_enum(f, self.name(), self.value())
10012 }
10013 }
10014
10015 impl std::convert::From<i32> for RelationType {
10016 fn from(value: i32) -> Self {
10017 match value {
10018 0 => Self::Unspecified,
10019 1 => Self::Table,
10020 2 => Self::View,
10021 3 => Self::IncrementalTable,
10022 4 => Self::MaterializedView,
10023 _ => Self::UnknownValue(relation_type::UnknownValue(
10024 wkt::internal::UnknownEnumValue::Integer(value),
10025 )),
10026 }
10027 }
10028 }
10029
10030 impl std::convert::From<&str> for RelationType {
10031 fn from(value: &str) -> Self {
10032 use std::string::ToString;
10033 match value {
10034 "RELATION_TYPE_UNSPECIFIED" => Self::Unspecified,
10035 "TABLE" => Self::Table,
10036 "VIEW" => Self::View,
10037 "INCREMENTAL_TABLE" => Self::IncrementalTable,
10038 "MATERIALIZED_VIEW" => Self::MaterializedView,
10039 _ => Self::UnknownValue(relation_type::UnknownValue(
10040 wkt::internal::UnknownEnumValue::String(value.to_string()),
10041 )),
10042 }
10043 }
10044 }
10045
10046 impl serde::ser::Serialize for RelationType {
10047 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10048 where
10049 S: serde::Serializer,
10050 {
10051 match self {
10052 Self::Unspecified => serializer.serialize_i32(0),
10053 Self::Table => serializer.serialize_i32(1),
10054 Self::View => serializer.serialize_i32(2),
10055 Self::IncrementalTable => serializer.serialize_i32(3),
10056 Self::MaterializedView => serializer.serialize_i32(4),
10057 Self::UnknownValue(u) => u.0.serialize(serializer),
10058 }
10059 }
10060 }
10061
10062 impl<'de> serde::de::Deserialize<'de> for RelationType {
10063 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10064 where
10065 D: serde::Deserializer<'de>,
10066 {
10067 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelationType>::new(
10068 ".google.cloud.dataform.v1.CompilationResultAction.Relation.RelationType",
10069 ))
10070 }
10071 }
10072
10073 /// Supported table formats for BigQuery tables.
10074 ///
10075 /// # Working with unknown values
10076 ///
10077 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10078 /// additional enum variants at any time. Adding new variants is not considered
10079 /// a breaking change. Applications should write their code in anticipation of:
10080 ///
10081 /// - New values appearing in future releases of the client library, **and**
10082 /// - New values received dynamically, without application changes.
10083 ///
10084 /// Please consult the [Working with enums] section in the user guide for some
10085 /// guidelines.
10086 ///
10087 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10088 #[derive(Clone, Debug, PartialEq)]
10089 #[non_exhaustive]
10090 pub enum TableFormat {
10091 /// Default value.
10092 Unspecified,
10093 /// Apache Iceberg format.
10094 Iceberg,
10095 /// If set, the enum was initialized with an unknown value.
10096 ///
10097 /// Applications can examine the value using [TableFormat::value] or
10098 /// [TableFormat::name].
10099 UnknownValue(table_format::UnknownValue),
10100 }
10101
10102 #[doc(hidden)]
10103 pub mod table_format {
10104 #[allow(unused_imports)]
10105 use super::*;
10106 #[derive(Clone, Debug, PartialEq)]
10107 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10108 }
10109
10110 impl TableFormat {
10111 /// Gets the enum value.
10112 ///
10113 /// Returns `None` if the enum contains an unknown value deserialized from
10114 /// the string representation of enums.
10115 pub fn value(&self) -> std::option::Option<i32> {
10116 match self {
10117 Self::Unspecified => std::option::Option::Some(0),
10118 Self::Iceberg => std::option::Option::Some(1),
10119 Self::UnknownValue(u) => u.0.value(),
10120 }
10121 }
10122
10123 /// Gets the enum value as a string.
10124 ///
10125 /// Returns `None` if the enum contains an unknown value deserialized from
10126 /// the integer representation of enums.
10127 pub fn name(&self) -> std::option::Option<&str> {
10128 match self {
10129 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
10130 Self::Iceberg => std::option::Option::Some("ICEBERG"),
10131 Self::UnknownValue(u) => u.0.name(),
10132 }
10133 }
10134 }
10135
10136 impl std::default::Default for TableFormat {
10137 fn default() -> Self {
10138 use std::convert::From;
10139 Self::from(0)
10140 }
10141 }
10142
10143 impl std::fmt::Display for TableFormat {
10144 fn fmt(
10145 &self,
10146 f: &mut std::fmt::Formatter<'_>,
10147 ) -> std::result::Result<(), std::fmt::Error> {
10148 wkt::internal::display_enum(f, self.name(), self.value())
10149 }
10150 }
10151
10152 impl std::convert::From<i32> for TableFormat {
10153 fn from(value: i32) -> Self {
10154 match value {
10155 0 => Self::Unspecified,
10156 1 => Self::Iceberg,
10157 _ => Self::UnknownValue(table_format::UnknownValue(
10158 wkt::internal::UnknownEnumValue::Integer(value),
10159 )),
10160 }
10161 }
10162 }
10163
10164 impl std::convert::From<&str> for TableFormat {
10165 fn from(value: &str) -> Self {
10166 use std::string::ToString;
10167 match value {
10168 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
10169 "ICEBERG" => Self::Iceberg,
10170 _ => Self::UnknownValue(table_format::UnknownValue(
10171 wkt::internal::UnknownEnumValue::String(value.to_string()),
10172 )),
10173 }
10174 }
10175 }
10176
10177 impl serde::ser::Serialize for TableFormat {
10178 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10179 where
10180 S: serde::Serializer,
10181 {
10182 match self {
10183 Self::Unspecified => serializer.serialize_i32(0),
10184 Self::Iceberg => serializer.serialize_i32(1),
10185 Self::UnknownValue(u) => u.0.serialize(serializer),
10186 }
10187 }
10188 }
10189
10190 impl<'de> serde::de::Deserialize<'de> for TableFormat {
10191 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10192 where
10193 D: serde::Deserializer<'de>,
10194 {
10195 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
10196 ".google.cloud.dataform.v1.CompilationResultAction.Relation.TableFormat",
10197 ))
10198 }
10199 }
10200
10201 /// Supported file formats for BigQuery tables.
10202 ///
10203 /// # Working with unknown values
10204 ///
10205 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10206 /// additional enum variants at any time. Adding new variants is not considered
10207 /// a breaking change. Applications should write their code in anticipation of:
10208 ///
10209 /// - New values appearing in future releases of the client library, **and**
10210 /// - New values received dynamically, without application changes.
10211 ///
10212 /// Please consult the [Working with enums] section in the user guide for some
10213 /// guidelines.
10214 ///
10215 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10216 #[derive(Clone, Debug, PartialEq)]
10217 #[non_exhaustive]
10218 pub enum FileFormat {
10219 /// Default value.
10220 Unspecified,
10221 /// Apache Parquet format.
10222 Parquet,
10223 /// If set, the enum was initialized with an unknown value.
10224 ///
10225 /// Applications can examine the value using [FileFormat::value] or
10226 /// [FileFormat::name].
10227 UnknownValue(file_format::UnknownValue),
10228 }
10229
10230 #[doc(hidden)]
10231 pub mod file_format {
10232 #[allow(unused_imports)]
10233 use super::*;
10234 #[derive(Clone, Debug, PartialEq)]
10235 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10236 }
10237
10238 impl FileFormat {
10239 /// Gets the enum value.
10240 ///
10241 /// Returns `None` if the enum contains an unknown value deserialized from
10242 /// the string representation of enums.
10243 pub fn value(&self) -> std::option::Option<i32> {
10244 match self {
10245 Self::Unspecified => std::option::Option::Some(0),
10246 Self::Parquet => std::option::Option::Some(1),
10247 Self::UnknownValue(u) => u.0.value(),
10248 }
10249 }
10250
10251 /// Gets the enum value as a string.
10252 ///
10253 /// Returns `None` if the enum contains an unknown value deserialized from
10254 /// the integer representation of enums.
10255 pub fn name(&self) -> std::option::Option<&str> {
10256 match self {
10257 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
10258 Self::Parquet => std::option::Option::Some("PARQUET"),
10259 Self::UnknownValue(u) => u.0.name(),
10260 }
10261 }
10262 }
10263
10264 impl std::default::Default for FileFormat {
10265 fn default() -> Self {
10266 use std::convert::From;
10267 Self::from(0)
10268 }
10269 }
10270
10271 impl std::fmt::Display for FileFormat {
10272 fn fmt(
10273 &self,
10274 f: &mut std::fmt::Formatter<'_>,
10275 ) -> std::result::Result<(), std::fmt::Error> {
10276 wkt::internal::display_enum(f, self.name(), self.value())
10277 }
10278 }
10279
10280 impl std::convert::From<i32> for FileFormat {
10281 fn from(value: i32) -> Self {
10282 match value {
10283 0 => Self::Unspecified,
10284 1 => Self::Parquet,
10285 _ => Self::UnknownValue(file_format::UnknownValue(
10286 wkt::internal::UnknownEnumValue::Integer(value),
10287 )),
10288 }
10289 }
10290 }
10291
10292 impl std::convert::From<&str> for FileFormat {
10293 fn from(value: &str) -> Self {
10294 use std::string::ToString;
10295 match value {
10296 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
10297 "PARQUET" => Self::Parquet,
10298 _ => Self::UnknownValue(file_format::UnknownValue(
10299 wkt::internal::UnknownEnumValue::String(value.to_string()),
10300 )),
10301 }
10302 }
10303 }
10304
10305 impl serde::ser::Serialize for FileFormat {
10306 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10307 where
10308 S: serde::Serializer,
10309 {
10310 match self {
10311 Self::Unspecified => serializer.serialize_i32(0),
10312 Self::Parquet => serializer.serialize_i32(1),
10313 Self::UnknownValue(u) => u.0.serialize(serializer),
10314 }
10315 }
10316 }
10317
10318 impl<'de> serde::de::Deserialize<'de> for FileFormat {
10319 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10320 where
10321 D: serde::Deserializer<'de>,
10322 {
10323 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
10324 ".google.cloud.dataform.v1.CompilationResultAction.Relation.FileFormat",
10325 ))
10326 }
10327 }
10328 }
10329
10330 /// Represents a list of arbitrary database operations.
10331 #[derive(Clone, Default, PartialEq)]
10332 #[non_exhaustive]
10333 pub struct Operations {
10334 /// A list of actions that this action depends on.
10335 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10336
10337 /// Whether this action is disabled (i.e. should not be run).
10338 pub disabled: bool,
10339
10340 /// Arbitrary, user-defined tags on this action.
10341 pub tags: std::vec::Vec<std::string::String>,
10342
10343 /// Descriptor for any output relation and its columns. Only set if
10344 /// `has_output` is true.
10345 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10346
10347 /// A list of arbitrary SQL statements that will be executed without
10348 /// alteration.
10349 pub queries: std::vec::Vec<std::string::String>,
10350
10351 /// Whether these operations produce an output relation.
10352 pub has_output: bool,
10353
10354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10355 }
10356
10357 impl Operations {
10358 /// Creates a new default instance.
10359 pub fn new() -> Self {
10360 std::default::Default::default()
10361 }
10362
10363 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Operations::dependency_targets].
10364 ///
10365 /// # Example
10366 /// ```ignore,no_run
10367 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10368 /// use google_cloud_dataform_v1::model::Target;
10369 /// let x = Operations::new()
10370 /// .set_dependency_targets([
10371 /// Target::default()/* use setters */,
10372 /// Target::default()/* use (different) setters */,
10373 /// ]);
10374 /// ```
10375 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10376 where
10377 T: std::iter::IntoIterator<Item = V>,
10378 V: std::convert::Into<crate::model::Target>,
10379 {
10380 use std::iter::Iterator;
10381 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10382 self
10383 }
10384
10385 /// Sets the value of [disabled][crate::model::compilation_result_action::Operations::disabled].
10386 ///
10387 /// # Example
10388 /// ```ignore,no_run
10389 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10390 /// let x = Operations::new().set_disabled(true);
10391 /// ```
10392 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10393 self.disabled = v.into();
10394 self
10395 }
10396
10397 /// Sets the value of [tags][crate::model::compilation_result_action::Operations::tags].
10398 ///
10399 /// # Example
10400 /// ```ignore,no_run
10401 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10402 /// let x = Operations::new().set_tags(["a", "b", "c"]);
10403 /// ```
10404 pub fn set_tags<T, V>(mut self, v: T) -> Self
10405 where
10406 T: std::iter::IntoIterator<Item = V>,
10407 V: std::convert::Into<std::string::String>,
10408 {
10409 use std::iter::Iterator;
10410 self.tags = v.into_iter().map(|i| i.into()).collect();
10411 self
10412 }
10413
10414 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
10415 ///
10416 /// # Example
10417 /// ```ignore,no_run
10418 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10419 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10420 /// let x = Operations::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10421 /// ```
10422 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10423 where
10424 T: std::convert::Into<crate::model::RelationDescriptor>,
10425 {
10426 self.relation_descriptor = std::option::Option::Some(v.into());
10427 self
10428 }
10429
10430 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
10431 ///
10432 /// # Example
10433 /// ```ignore,no_run
10434 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10435 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10436 /// let x = Operations::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10437 /// let x = Operations::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10438 /// ```
10439 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10440 where
10441 T: std::convert::Into<crate::model::RelationDescriptor>,
10442 {
10443 self.relation_descriptor = v.map(|x| x.into());
10444 self
10445 }
10446
10447 /// Sets the value of [queries][crate::model::compilation_result_action::Operations::queries].
10448 ///
10449 /// # Example
10450 /// ```ignore,no_run
10451 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10452 /// let x = Operations::new().set_queries(["a", "b", "c"]);
10453 /// ```
10454 pub fn set_queries<T, V>(mut self, v: T) -> Self
10455 where
10456 T: std::iter::IntoIterator<Item = V>,
10457 V: std::convert::Into<std::string::String>,
10458 {
10459 use std::iter::Iterator;
10460 self.queries = v.into_iter().map(|i| i.into()).collect();
10461 self
10462 }
10463
10464 /// Sets the value of [has_output][crate::model::compilation_result_action::Operations::has_output].
10465 ///
10466 /// # Example
10467 /// ```ignore,no_run
10468 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
10469 /// let x = Operations::new().set_has_output(true);
10470 /// ```
10471 pub fn set_has_output<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10472 self.has_output = v.into();
10473 self
10474 }
10475 }
10476
10477 impl wkt::message::Message for Operations {
10478 fn typename() -> &'static str {
10479 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Operations"
10480 }
10481 }
10482
10483 /// Represents an assertion upon a SQL query which is required return zero
10484 /// rows.
10485 #[derive(Clone, Default, PartialEq)]
10486 #[non_exhaustive]
10487 pub struct Assertion {
10488 /// A list of actions that this action depends on.
10489 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10490
10491 /// The parent action of this assertion. Only set if this assertion was
10492 /// automatically generated.
10493 pub parent_action: std::option::Option<crate::model::Target>,
10494
10495 /// Whether this action is disabled (i.e. should not be run).
10496 pub disabled: bool,
10497
10498 /// Arbitrary, user-defined tags on this action.
10499 pub tags: std::vec::Vec<std::string::String>,
10500
10501 /// The SELECT query which must return zero rows in order for this assertion
10502 /// to succeed.
10503 pub select_query: std::string::String,
10504
10505 /// Descriptor for the assertion's automatically-generated view and its
10506 /// columns.
10507 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10508
10509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10510 }
10511
10512 impl Assertion {
10513 /// Creates a new default instance.
10514 pub fn new() -> Self {
10515 std::default::Default::default()
10516 }
10517
10518 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Assertion::dependency_targets].
10519 ///
10520 /// # Example
10521 /// ```ignore,no_run
10522 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10523 /// use google_cloud_dataform_v1::model::Target;
10524 /// let x = Assertion::new()
10525 /// .set_dependency_targets([
10526 /// Target::default()/* use setters */,
10527 /// Target::default()/* use (different) setters */,
10528 /// ]);
10529 /// ```
10530 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10531 where
10532 T: std::iter::IntoIterator<Item = V>,
10533 V: std::convert::Into<crate::model::Target>,
10534 {
10535 use std::iter::Iterator;
10536 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10537 self
10538 }
10539
10540 /// Sets the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
10541 ///
10542 /// # Example
10543 /// ```ignore,no_run
10544 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10545 /// use google_cloud_dataform_v1::model::Target;
10546 /// let x = Assertion::new().set_parent_action(Target::default()/* use setters */);
10547 /// ```
10548 pub fn set_parent_action<T>(mut self, v: T) -> Self
10549 where
10550 T: std::convert::Into<crate::model::Target>,
10551 {
10552 self.parent_action = std::option::Option::Some(v.into());
10553 self
10554 }
10555
10556 /// Sets or clears the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
10557 ///
10558 /// # Example
10559 /// ```ignore,no_run
10560 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10561 /// use google_cloud_dataform_v1::model::Target;
10562 /// let x = Assertion::new().set_or_clear_parent_action(Some(Target::default()/* use setters */));
10563 /// let x = Assertion::new().set_or_clear_parent_action(None::<Target>);
10564 /// ```
10565 pub fn set_or_clear_parent_action<T>(mut self, v: std::option::Option<T>) -> Self
10566 where
10567 T: std::convert::Into<crate::model::Target>,
10568 {
10569 self.parent_action = v.map(|x| x.into());
10570 self
10571 }
10572
10573 /// Sets the value of [disabled][crate::model::compilation_result_action::Assertion::disabled].
10574 ///
10575 /// # Example
10576 /// ```ignore,no_run
10577 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10578 /// let x = Assertion::new().set_disabled(true);
10579 /// ```
10580 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10581 self.disabled = v.into();
10582 self
10583 }
10584
10585 /// Sets the value of [tags][crate::model::compilation_result_action::Assertion::tags].
10586 ///
10587 /// # Example
10588 /// ```ignore,no_run
10589 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10590 /// let x = Assertion::new().set_tags(["a", "b", "c"]);
10591 /// ```
10592 pub fn set_tags<T, V>(mut self, v: T) -> Self
10593 where
10594 T: std::iter::IntoIterator<Item = V>,
10595 V: std::convert::Into<std::string::String>,
10596 {
10597 use std::iter::Iterator;
10598 self.tags = v.into_iter().map(|i| i.into()).collect();
10599 self
10600 }
10601
10602 /// Sets the value of [select_query][crate::model::compilation_result_action::Assertion::select_query].
10603 ///
10604 /// # Example
10605 /// ```ignore,no_run
10606 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10607 /// let x = Assertion::new().set_select_query("example");
10608 /// ```
10609 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
10610 mut self,
10611 v: T,
10612 ) -> Self {
10613 self.select_query = v.into();
10614 self
10615 }
10616
10617 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
10618 ///
10619 /// # Example
10620 /// ```ignore,no_run
10621 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10622 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10623 /// let x = Assertion::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10624 /// ```
10625 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10626 where
10627 T: std::convert::Into<crate::model::RelationDescriptor>,
10628 {
10629 self.relation_descriptor = std::option::Option::Some(v.into());
10630 self
10631 }
10632
10633 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
10634 ///
10635 /// # Example
10636 /// ```ignore,no_run
10637 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
10638 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10639 /// let x = Assertion::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10640 /// let x = Assertion::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10641 /// ```
10642 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10643 where
10644 T: std::convert::Into<crate::model::RelationDescriptor>,
10645 {
10646 self.relation_descriptor = v.map(|x| x.into());
10647 self
10648 }
10649 }
10650
10651 impl wkt::message::Message for Assertion {
10652 fn typename() -> &'static str {
10653 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Assertion"
10654 }
10655 }
10656
10657 /// Represents a relation which is not managed by Dataform but which may be
10658 /// referenced by Dataform actions.
10659 #[derive(Clone, Default, PartialEq)]
10660 #[non_exhaustive]
10661 pub struct Declaration {
10662 /// Descriptor for the relation and its columns. Used as documentation only,
10663 /// i.e. values here will result in no changes to the relation's metadata.
10664 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
10665
10666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10667 }
10668
10669 impl Declaration {
10670 /// Creates a new default instance.
10671 pub fn new() -> Self {
10672 std::default::Default::default()
10673 }
10674
10675 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
10676 ///
10677 /// # Example
10678 /// ```ignore,no_run
10679 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
10680 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10681 /// let x = Declaration::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
10682 /// ```
10683 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
10684 where
10685 T: std::convert::Into<crate::model::RelationDescriptor>,
10686 {
10687 self.relation_descriptor = std::option::Option::Some(v.into());
10688 self
10689 }
10690
10691 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
10692 ///
10693 /// # Example
10694 /// ```ignore,no_run
10695 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
10696 /// use google_cloud_dataform_v1::model::RelationDescriptor;
10697 /// let x = Declaration::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
10698 /// let x = Declaration::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
10699 /// ```
10700 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
10701 where
10702 T: std::convert::Into<crate::model::RelationDescriptor>,
10703 {
10704 self.relation_descriptor = v.map(|x| x.into());
10705 self
10706 }
10707 }
10708
10709 impl wkt::message::Message for Declaration {
10710 fn typename() -> &'static str {
10711 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Declaration"
10712 }
10713 }
10714
10715 /// Represents a notebook.
10716 #[derive(Clone, Default, PartialEq)]
10717 #[non_exhaustive]
10718 pub struct Notebook {
10719 /// A list of actions that this action depends on.
10720 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10721
10722 /// Whether this action is disabled (i.e. should not be run).
10723 pub disabled: bool,
10724
10725 /// The contents of the notebook.
10726 pub contents: std::string::String,
10727
10728 /// Arbitrary, user-defined tags on this action.
10729 pub tags: std::vec::Vec<std::string::String>,
10730
10731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10732 }
10733
10734 impl Notebook {
10735 /// Creates a new default instance.
10736 pub fn new() -> Self {
10737 std::default::Default::default()
10738 }
10739
10740 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Notebook::dependency_targets].
10741 ///
10742 /// # Example
10743 /// ```ignore,no_run
10744 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10745 /// use google_cloud_dataform_v1::model::Target;
10746 /// let x = Notebook::new()
10747 /// .set_dependency_targets([
10748 /// Target::default()/* use setters */,
10749 /// Target::default()/* use (different) setters */,
10750 /// ]);
10751 /// ```
10752 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10753 where
10754 T: std::iter::IntoIterator<Item = V>,
10755 V: std::convert::Into<crate::model::Target>,
10756 {
10757 use std::iter::Iterator;
10758 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10759 self
10760 }
10761
10762 /// Sets the value of [disabled][crate::model::compilation_result_action::Notebook::disabled].
10763 ///
10764 /// # Example
10765 /// ```ignore,no_run
10766 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10767 /// let x = Notebook::new().set_disabled(true);
10768 /// ```
10769 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10770 self.disabled = v.into();
10771 self
10772 }
10773
10774 /// Sets the value of [contents][crate::model::compilation_result_action::Notebook::contents].
10775 ///
10776 /// # Example
10777 /// ```ignore,no_run
10778 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10779 /// let x = Notebook::new().set_contents("example");
10780 /// ```
10781 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10782 self.contents = v.into();
10783 self
10784 }
10785
10786 /// Sets the value of [tags][crate::model::compilation_result_action::Notebook::tags].
10787 ///
10788 /// # Example
10789 /// ```ignore,no_run
10790 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
10791 /// let x = Notebook::new().set_tags(["a", "b", "c"]);
10792 /// ```
10793 pub fn set_tags<T, V>(mut self, v: T) -> Self
10794 where
10795 T: std::iter::IntoIterator<Item = V>,
10796 V: std::convert::Into<std::string::String>,
10797 {
10798 use std::iter::Iterator;
10799 self.tags = v.into_iter().map(|i| i.into()).collect();
10800 self
10801 }
10802 }
10803
10804 impl wkt::message::Message for Notebook {
10805 fn typename() -> &'static str {
10806 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Notebook"
10807 }
10808 }
10809
10810 /// Defines a compiled Data Preparation entity
10811 #[derive(Clone, Default, PartialEq)]
10812 #[non_exhaustive]
10813 pub struct DataPreparation {
10814 /// A list of actions that this action depends on.
10815 pub dependency_targets: std::vec::Vec<crate::model::Target>,
10816
10817 /// Whether this action is disabled (i.e. should not be run).
10818 pub disabled: bool,
10819
10820 /// Arbitrary, user-defined tags on this action.
10821 pub tags: std::vec::Vec<std::string::String>,
10822
10823 /// The definition for the data preparation.
10824 pub definition: std::option::Option<
10825 crate::model::compilation_result_action::data_preparation::Definition,
10826 >,
10827
10828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10829 }
10830
10831 impl DataPreparation {
10832 /// Creates a new default instance.
10833 pub fn new() -> Self {
10834 std::default::Default::default()
10835 }
10836
10837 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::DataPreparation::dependency_targets].
10838 ///
10839 /// # Example
10840 /// ```ignore,no_run
10841 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10842 /// use google_cloud_dataform_v1::model::Target;
10843 /// let x = DataPreparation::new()
10844 /// .set_dependency_targets([
10845 /// Target::default()/* use setters */,
10846 /// Target::default()/* use (different) setters */,
10847 /// ]);
10848 /// ```
10849 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
10850 where
10851 T: std::iter::IntoIterator<Item = V>,
10852 V: std::convert::Into<crate::model::Target>,
10853 {
10854 use std::iter::Iterator;
10855 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
10856 self
10857 }
10858
10859 /// Sets the value of [disabled][crate::model::compilation_result_action::DataPreparation::disabled].
10860 ///
10861 /// # Example
10862 /// ```ignore,no_run
10863 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10864 /// let x = DataPreparation::new().set_disabled(true);
10865 /// ```
10866 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10867 self.disabled = v.into();
10868 self
10869 }
10870
10871 /// Sets the value of [tags][crate::model::compilation_result_action::DataPreparation::tags].
10872 ///
10873 /// # Example
10874 /// ```ignore,no_run
10875 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10876 /// let x = DataPreparation::new().set_tags(["a", "b", "c"]);
10877 /// ```
10878 pub fn set_tags<T, V>(mut self, v: T) -> Self
10879 where
10880 T: std::iter::IntoIterator<Item = V>,
10881 V: std::convert::Into<std::string::String>,
10882 {
10883 use std::iter::Iterator;
10884 self.tags = v.into_iter().map(|i| i.into()).collect();
10885 self
10886 }
10887
10888 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition].
10889 ///
10890 /// Note that all the setters affecting `definition` are mutually
10891 /// exclusive.
10892 ///
10893 /// # Example
10894 /// ```ignore,no_run
10895 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10896 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::Definition;
10897 /// let x = DataPreparation::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
10898 /// ```
10899 pub fn set_definition<
10900 T: std::convert::Into<
10901 std::option::Option<
10902 crate::model::compilation_result_action::data_preparation::Definition,
10903 >,
10904 >,
10905 >(
10906 mut self,
10907 v: T,
10908 ) -> Self {
10909 self.definition = v.into();
10910 self
10911 }
10912
10913 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10914 /// if it holds a `ContentsYaml`, `None` if the field is not set or
10915 /// holds a different branch.
10916 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
10917 #[allow(unreachable_patterns)]
10918 self.definition.as_ref().and_then(|v| match v {
10919 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(v) => std::option::Option::Some(v),
10920 _ => std::option::Option::None,
10921 })
10922 }
10923
10924 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10925 /// to hold a `ContentsYaml`.
10926 ///
10927 /// Note that all the setters affecting `definition` are
10928 /// mutually exclusive.
10929 ///
10930 /// # Example
10931 /// ```ignore,no_run
10932 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10933 /// let x = DataPreparation::new().set_contents_yaml("example");
10934 /// assert!(x.contents_yaml().is_some());
10935 /// assert!(x.contents_sql().is_none());
10936 /// ```
10937 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
10938 mut self,
10939 v: T,
10940 ) -> Self {
10941 self.definition = std::option::Option::Some(
10942 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(
10943 v.into(),
10944 ),
10945 );
10946 self
10947 }
10948
10949 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10950 /// if it holds a `ContentsSql`, `None` if the field is not set or
10951 /// holds a different branch.
10952 pub fn contents_sql(
10953 &self,
10954 ) -> std::option::Option<
10955 &std::boxed::Box<
10956 crate::model::compilation_result_action::data_preparation::SqlDefinition,
10957 >,
10958 > {
10959 #[allow(unreachable_patterns)]
10960 self.definition.as_ref().and_then(|v| match v {
10961 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(v) => std::option::Option::Some(v),
10962 _ => std::option::Option::None,
10963 })
10964 }
10965
10966 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
10967 /// to hold a `ContentsSql`.
10968 ///
10969 /// Note that all the setters affecting `definition` are
10970 /// mutually exclusive.
10971 ///
10972 /// # Example
10973 /// ```ignore,no_run
10974 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
10975 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10976 /// let x = DataPreparation::new().set_contents_sql(SqlDefinition::default()/* use setters */);
10977 /// assert!(x.contents_sql().is_some());
10978 /// assert!(x.contents_yaml().is_none());
10979 /// ```
10980 pub fn set_contents_sql<
10981 T: std::convert::Into<
10982 std::boxed::Box<
10983 crate::model::compilation_result_action::data_preparation::SqlDefinition,
10984 >,
10985 >,
10986 >(
10987 mut self,
10988 v: T,
10989 ) -> Self {
10990 self.definition = std::option::Option::Some(
10991 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(
10992 v.into(),
10993 ),
10994 );
10995 self
10996 }
10997 }
10998
10999 impl wkt::message::Message for DataPreparation {
11000 fn typename() -> &'static str {
11001 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation"
11002 }
11003 }
11004
11005 /// Defines additional types related to [DataPreparation].
11006 pub mod data_preparation {
11007 #[allow(unused_imports)]
11008 use super::*;
11009
11010 /// Definition of a SQL Data Preparation
11011 #[derive(Clone, Default, PartialEq)]
11012 #[non_exhaustive]
11013 pub struct SqlDefinition {
11014 /// The SQL query representing the data preparation steps. Formatted as a
11015 /// Pipe SQL query statement.
11016 pub query: std::string::String,
11017
11018 /// Error table configuration,
11019 pub error_table: std::option::Option<
11020 crate::model::compilation_result_action::data_preparation::ErrorTable,
11021 >,
11022
11023 /// Load configuration.
11024 pub load: std::option::Option<crate::model::compilation_result_action::LoadConfig>,
11025
11026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11027 }
11028
11029 impl SqlDefinition {
11030 /// Creates a new default instance.
11031 pub fn new() -> Self {
11032 std::default::Default::default()
11033 }
11034
11035 /// Sets the value of [query][crate::model::compilation_result_action::data_preparation::SqlDefinition::query].
11036 ///
11037 /// # Example
11038 /// ```ignore,no_run
11039 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
11040 /// let x = SqlDefinition::new().set_query("example");
11041 /// ```
11042 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11043 self.query = v.into();
11044 self
11045 }
11046
11047 /// Sets the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
11048 ///
11049 /// # Example
11050 /// ```ignore,no_run
11051 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
11052 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11053 /// let x = SqlDefinition::new().set_error_table(ErrorTable::default()/* use setters */);
11054 /// ```
11055 pub fn set_error_table<T>(mut self, v: T) -> Self
11056 where
11057 T: std::convert::Into<
11058 crate::model::compilation_result_action::data_preparation::ErrorTable,
11059 >,
11060 {
11061 self.error_table = std::option::Option::Some(v.into());
11062 self
11063 }
11064
11065 /// Sets or clears the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
11066 ///
11067 /// # Example
11068 /// ```ignore,no_run
11069 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
11070 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11071 /// let x = SqlDefinition::new().set_or_clear_error_table(Some(ErrorTable::default()/* use setters */));
11072 /// let x = SqlDefinition::new().set_or_clear_error_table(None::<ErrorTable>);
11073 /// ```
11074 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
11075 where
11076 T: std::convert::Into<
11077 crate::model::compilation_result_action::data_preparation::ErrorTable,
11078 >,
11079 {
11080 self.error_table = v.map(|x| x.into());
11081 self
11082 }
11083
11084 /// Sets the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
11085 ///
11086 /// # Example
11087 /// ```ignore,no_run
11088 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
11089 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11090 /// let x = SqlDefinition::new().set_load(LoadConfig::default()/* use setters */);
11091 /// ```
11092 pub fn set_load<T>(mut self, v: T) -> Self
11093 where
11094 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
11095 {
11096 self.load = std::option::Option::Some(v.into());
11097 self
11098 }
11099
11100 /// Sets or clears the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
11101 ///
11102 /// # Example
11103 /// ```ignore,no_run
11104 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
11105 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11106 /// let x = SqlDefinition::new().set_or_clear_load(Some(LoadConfig::default()/* use setters */));
11107 /// let x = SqlDefinition::new().set_or_clear_load(None::<LoadConfig>);
11108 /// ```
11109 pub fn set_or_clear_load<T>(mut self, v: std::option::Option<T>) -> Self
11110 where
11111 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
11112 {
11113 self.load = v.map(|x| x.into());
11114 self
11115 }
11116 }
11117
11118 impl wkt::message::Message for SqlDefinition {
11119 fn typename() -> &'static str {
11120 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.SqlDefinition"
11121 }
11122 }
11123
11124 /// Error table information, used to write error data into a BigQuery
11125 /// table.
11126 #[derive(Clone, Default, PartialEq)]
11127 #[non_exhaustive]
11128 pub struct ErrorTable {
11129 /// Error Table target.
11130 pub target: std::option::Option<crate::model::Target>,
11131
11132 /// Error table partition expiration in days. Only positive values are
11133 /// allowed.
11134 pub retention_days: i32,
11135
11136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11137 }
11138
11139 impl ErrorTable {
11140 /// Creates a new default instance.
11141 pub fn new() -> Self {
11142 std::default::Default::default()
11143 }
11144
11145 /// Sets the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
11146 ///
11147 /// # Example
11148 /// ```ignore,no_run
11149 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11150 /// use google_cloud_dataform_v1::model::Target;
11151 /// let x = ErrorTable::new().set_target(Target::default()/* use setters */);
11152 /// ```
11153 pub fn set_target<T>(mut self, v: T) -> Self
11154 where
11155 T: std::convert::Into<crate::model::Target>,
11156 {
11157 self.target = std::option::Option::Some(v.into());
11158 self
11159 }
11160
11161 /// Sets or clears the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
11162 ///
11163 /// # Example
11164 /// ```ignore,no_run
11165 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11166 /// use google_cloud_dataform_v1::model::Target;
11167 /// let x = ErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
11168 /// let x = ErrorTable::new().set_or_clear_target(None::<Target>);
11169 /// ```
11170 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
11171 where
11172 T: std::convert::Into<crate::model::Target>,
11173 {
11174 self.target = v.map(|x| x.into());
11175 self
11176 }
11177
11178 /// Sets the value of [retention_days][crate::model::compilation_result_action::data_preparation::ErrorTable::retention_days].
11179 ///
11180 /// # Example
11181 /// ```ignore,no_run
11182 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
11183 /// let x = ErrorTable::new().set_retention_days(42);
11184 /// ```
11185 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11186 self.retention_days = v.into();
11187 self
11188 }
11189 }
11190
11191 impl wkt::message::Message for ErrorTable {
11192 fn typename() -> &'static str {
11193 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.ErrorTable"
11194 }
11195 }
11196
11197 /// The definition for the data preparation.
11198 #[derive(Clone, Debug, PartialEq)]
11199 #[non_exhaustive]
11200 pub enum Definition {
11201 /// The data preparation definition, stored as a YAML string.
11202 ContentsYaml(std::string::String),
11203 /// SQL definition for a Data Preparation. Contains a SQL query and
11204 /// additional context information.
11205 ContentsSql(
11206 std::boxed::Box<
11207 crate::model::compilation_result_action::data_preparation::SqlDefinition,
11208 >,
11209 ),
11210 }
11211 }
11212
11213 /// Simplified load configuration for actions
11214 #[derive(Clone, Default, PartialEq)]
11215 #[non_exhaustive]
11216 pub struct LoadConfig {
11217 /// Load mode
11218 pub mode: std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
11219
11220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11221 }
11222
11223 impl LoadConfig {
11224 /// Creates a new default instance.
11225 pub fn new() -> Self {
11226 std::default::Default::default()
11227 }
11228
11229 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode].
11230 ///
11231 /// Note that all the setters affecting `mode` are mutually
11232 /// exclusive.
11233 ///
11234 /// # Example
11235 /// ```ignore,no_run
11236 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11237 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11238 /// let x = LoadConfig::new().set_mode(Some(
11239 /// google_cloud_dataform_v1::model::compilation_result_action::load_config::Mode::Replace(SimpleLoadMode::default().into())));
11240 /// ```
11241 pub fn set_mode<
11242 T: std::convert::Into<
11243 std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
11244 >,
11245 >(
11246 mut self,
11247 v: T,
11248 ) -> Self {
11249 self.mode = v.into();
11250 self
11251 }
11252
11253 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11254 /// if it holds a `Replace`, `None` if the field is not set or
11255 /// holds a different branch.
11256 pub fn replace(
11257 &self,
11258 ) -> std::option::Option<
11259 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11260 > {
11261 #[allow(unreachable_patterns)]
11262 self.mode.as_ref().and_then(|v| match v {
11263 crate::model::compilation_result_action::load_config::Mode::Replace(v) => {
11264 std::option::Option::Some(v)
11265 }
11266 _ => std::option::Option::None,
11267 })
11268 }
11269
11270 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11271 /// to hold a `Replace`.
11272 ///
11273 /// Note that all the setters affecting `mode` are
11274 /// mutually exclusive.
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11279 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11280 /// let x = LoadConfig::new().set_replace(SimpleLoadMode::default()/* use setters */);
11281 /// assert!(x.replace().is_some());
11282 /// assert!(x.append().is_none());
11283 /// assert!(x.maximum().is_none());
11284 /// assert!(x.unique().is_none());
11285 /// ```
11286 pub fn set_replace<
11287 T: std::convert::Into<
11288 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11289 >,
11290 >(
11291 mut self,
11292 v: T,
11293 ) -> Self {
11294 self.mode = std::option::Option::Some(
11295 crate::model::compilation_result_action::load_config::Mode::Replace(v.into()),
11296 );
11297 self
11298 }
11299
11300 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11301 /// if it holds a `Append`, `None` if the field is not set or
11302 /// holds a different branch.
11303 pub fn append(
11304 &self,
11305 ) -> std::option::Option<
11306 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11307 > {
11308 #[allow(unreachable_patterns)]
11309 self.mode.as_ref().and_then(|v| match v {
11310 crate::model::compilation_result_action::load_config::Mode::Append(v) => {
11311 std::option::Option::Some(v)
11312 }
11313 _ => std::option::Option::None,
11314 })
11315 }
11316
11317 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11318 /// to hold a `Append`.
11319 ///
11320 /// Note that all the setters affecting `mode` are
11321 /// mutually exclusive.
11322 ///
11323 /// # Example
11324 /// ```ignore,no_run
11325 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11326 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
11327 /// let x = LoadConfig::new().set_append(SimpleLoadMode::default()/* use setters */);
11328 /// assert!(x.append().is_some());
11329 /// assert!(x.replace().is_none());
11330 /// assert!(x.maximum().is_none());
11331 /// assert!(x.unique().is_none());
11332 /// ```
11333 pub fn set_append<
11334 T: std::convert::Into<
11335 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
11336 >,
11337 >(
11338 mut self,
11339 v: T,
11340 ) -> Self {
11341 self.mode = std::option::Option::Some(
11342 crate::model::compilation_result_action::load_config::Mode::Append(v.into()),
11343 );
11344 self
11345 }
11346
11347 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11348 /// if it holds a `Maximum`, `None` if the field is not set or
11349 /// holds a different branch.
11350 pub fn maximum(
11351 &self,
11352 ) -> std::option::Option<
11353 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11354 > {
11355 #[allow(unreachable_patterns)]
11356 self.mode.as_ref().and_then(|v| match v {
11357 crate::model::compilation_result_action::load_config::Mode::Maximum(v) => {
11358 std::option::Option::Some(v)
11359 }
11360 _ => std::option::Option::None,
11361 })
11362 }
11363
11364 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11365 /// to hold a `Maximum`.
11366 ///
11367 /// Note that all the setters affecting `mode` are
11368 /// mutually exclusive.
11369 ///
11370 /// # Example
11371 /// ```ignore,no_run
11372 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11373 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11374 /// let x = LoadConfig::new().set_maximum(IncrementalLoadMode::default()/* use setters */);
11375 /// assert!(x.maximum().is_some());
11376 /// assert!(x.replace().is_none());
11377 /// assert!(x.append().is_none());
11378 /// assert!(x.unique().is_none());
11379 /// ```
11380 pub fn set_maximum<
11381 T: std::convert::Into<
11382 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11383 >,
11384 >(
11385 mut self,
11386 v: T,
11387 ) -> Self {
11388 self.mode = std::option::Option::Some(
11389 crate::model::compilation_result_action::load_config::Mode::Maximum(v.into()),
11390 );
11391 self
11392 }
11393
11394 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11395 /// if it holds a `Unique`, `None` if the field is not set or
11396 /// holds a different branch.
11397 pub fn unique(
11398 &self,
11399 ) -> std::option::Option<
11400 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11401 > {
11402 #[allow(unreachable_patterns)]
11403 self.mode.as_ref().and_then(|v| match v {
11404 crate::model::compilation_result_action::load_config::Mode::Unique(v) => {
11405 std::option::Option::Some(v)
11406 }
11407 _ => std::option::Option::None,
11408 })
11409 }
11410
11411 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
11412 /// to hold a `Unique`.
11413 ///
11414 /// Note that all the setters affecting `mode` are
11415 /// mutually exclusive.
11416 ///
11417 /// # Example
11418 /// ```ignore,no_run
11419 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
11420 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11421 /// let x = LoadConfig::new().set_unique(IncrementalLoadMode::default()/* use setters */);
11422 /// assert!(x.unique().is_some());
11423 /// assert!(x.replace().is_none());
11424 /// assert!(x.append().is_none());
11425 /// assert!(x.maximum().is_none());
11426 /// ```
11427 pub fn set_unique<
11428 T: std::convert::Into<
11429 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
11430 >,
11431 >(
11432 mut self,
11433 v: T,
11434 ) -> Self {
11435 self.mode = std::option::Option::Some(
11436 crate::model::compilation_result_action::load_config::Mode::Unique(v.into()),
11437 );
11438 self
11439 }
11440 }
11441
11442 impl wkt::message::Message for LoadConfig {
11443 fn typename() -> &'static str {
11444 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.LoadConfig"
11445 }
11446 }
11447
11448 /// Defines additional types related to [LoadConfig].
11449 pub mod load_config {
11450 #[allow(unused_imports)]
11451 use super::*;
11452
11453 /// Load mode
11454 #[derive(Clone, Debug, PartialEq)]
11455 #[non_exhaustive]
11456 pub enum Mode {
11457 /// Replace destination table
11458 Replace(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
11459 /// Append into destination table
11460 Append(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
11461 /// Insert records where the value exceeds the previous maximum value for a
11462 /// column in the destination table
11463 Maximum(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
11464 /// Insert records where the value of a column is not already present in
11465 /// the destination table
11466 Unique(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
11467 }
11468 }
11469
11470 /// Simple load definition
11471 #[derive(Clone, Default, PartialEq)]
11472 #[non_exhaustive]
11473 pub struct SimpleLoadMode {
11474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11475 }
11476
11477 impl SimpleLoadMode {
11478 /// Creates a new default instance.
11479 pub fn new() -> Self {
11480 std::default::Default::default()
11481 }
11482 }
11483
11484 impl wkt::message::Message for SimpleLoadMode {
11485 fn typename() -> &'static str {
11486 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.SimpleLoadMode"
11487 }
11488 }
11489
11490 /// Load definition for incremental load modes
11491 #[derive(Clone, Default, PartialEq)]
11492 #[non_exhaustive]
11493 pub struct IncrementalLoadMode {
11494 /// Column name for incremental load modes
11495 pub column: std::string::String,
11496
11497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11498 }
11499
11500 impl IncrementalLoadMode {
11501 /// Creates a new default instance.
11502 pub fn new() -> Self {
11503 std::default::Default::default()
11504 }
11505
11506 /// Sets the value of [column][crate::model::compilation_result_action::IncrementalLoadMode::column].
11507 ///
11508 /// # Example
11509 /// ```ignore,no_run
11510 /// # use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
11511 /// let x = IncrementalLoadMode::new().set_column("example");
11512 /// ```
11513 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11514 self.column = v.into();
11515 self
11516 }
11517 }
11518
11519 impl wkt::message::Message for IncrementalLoadMode {
11520 fn typename() -> &'static str {
11521 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.IncrementalLoadMode"
11522 }
11523 }
11524
11525 /// The compiled object.
11526 #[derive(Clone, Debug, PartialEq)]
11527 #[non_exhaustive]
11528 pub enum CompiledObject {
11529 /// The database relation created/updated by this action.
11530 Relation(std::boxed::Box<crate::model::compilation_result_action::Relation>),
11531 /// The database operations executed by this action.
11532 Operations(std::boxed::Box<crate::model::compilation_result_action::Operations>),
11533 /// The assertion executed by this action.
11534 Assertion(std::boxed::Box<crate::model::compilation_result_action::Assertion>),
11535 /// The declaration declared by this action.
11536 Declaration(std::boxed::Box<crate::model::compilation_result_action::Declaration>),
11537 /// The notebook executed by this action.
11538 Notebook(std::boxed::Box<crate::model::compilation_result_action::Notebook>),
11539 /// The data preparation executed by this action.
11540 DataPreparation(std::boxed::Box<crate::model::compilation_result_action::DataPreparation>),
11541 }
11542}
11543
11544/// `QueryCompilationResultActions` request message.
11545#[derive(Clone, Default, PartialEq)]
11546#[non_exhaustive]
11547pub struct QueryCompilationResultActionsRequest {
11548 /// Required. The compilation result's name.
11549 pub name: std::string::String,
11550
11551 /// Optional. Maximum number of compilation results to return. The server may
11552 /// return fewer items than requested. If unspecified, the server will pick an
11553 /// appropriate default.
11554 pub page_size: i32,
11555
11556 /// Optional. Page token received from a previous
11557 /// `QueryCompilationResultActions` call. Provide this to retrieve the
11558 /// subsequent page.
11559 ///
11560 /// When paginating, all other parameters provided to
11561 /// `QueryCompilationResultActions`, with the exception of `page_size`, must
11562 /// match the call that provided the page token.
11563 pub page_token: std::string::String,
11564
11565 /// Optional. Optional filter for the returned list. Filtering is only
11566 /// currently supported on the `file_path` field.
11567 pub filter: std::string::String,
11568
11569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11570}
11571
11572impl QueryCompilationResultActionsRequest {
11573 /// Creates a new default instance.
11574 pub fn new() -> Self {
11575 std::default::Default::default()
11576 }
11577
11578 /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
11579 ///
11580 /// # Example
11581 /// ```ignore,no_run
11582 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11583 /// # let project_id = "project_id";
11584 /// # let location_id = "location_id";
11585 /// # let repository_id = "repository_id";
11586 /// # let compilation_result_id = "compilation_result_id";
11587 /// let x = QueryCompilationResultActionsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
11588 /// ```
11589 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11590 self.name = v.into();
11591 self
11592 }
11593
11594 /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
11595 ///
11596 /// # Example
11597 /// ```ignore,no_run
11598 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11599 /// let x = QueryCompilationResultActionsRequest::new().set_page_size(42);
11600 /// ```
11601 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11602 self.page_size = v.into();
11603 self
11604 }
11605
11606 /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
11607 ///
11608 /// # Example
11609 /// ```ignore,no_run
11610 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11611 /// let x = QueryCompilationResultActionsRequest::new().set_page_token("example");
11612 /// ```
11613 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11614 self.page_token = v.into();
11615 self
11616 }
11617
11618 /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
11619 ///
11620 /// # Example
11621 /// ```ignore,no_run
11622 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
11623 /// let x = QueryCompilationResultActionsRequest::new().set_filter("example");
11624 /// ```
11625 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11626 self.filter = v.into();
11627 self
11628 }
11629}
11630
11631impl wkt::message::Message for QueryCompilationResultActionsRequest {
11632 fn typename() -> &'static str {
11633 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsRequest"
11634 }
11635}
11636
11637/// `QueryCompilationResultActions` response message.
11638#[derive(Clone, Default, PartialEq)]
11639#[non_exhaustive]
11640pub struct QueryCompilationResultActionsResponse {
11641 /// List of compilation result actions.
11642 pub compilation_result_actions: std::vec::Vec<crate::model::CompilationResultAction>,
11643
11644 /// A token, which can be sent as `page_token` to retrieve the next page.
11645 /// If this field is omitted, there are no subsequent pages.
11646 pub next_page_token: std::string::String,
11647
11648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11649}
11650
11651impl QueryCompilationResultActionsResponse {
11652 /// Creates a new default instance.
11653 pub fn new() -> Self {
11654 std::default::Default::default()
11655 }
11656
11657 /// Sets the value of [compilation_result_actions][crate::model::QueryCompilationResultActionsResponse::compilation_result_actions].
11658 ///
11659 /// # Example
11660 /// ```ignore,no_run
11661 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
11662 /// use google_cloud_dataform_v1::model::CompilationResultAction;
11663 /// let x = QueryCompilationResultActionsResponse::new()
11664 /// .set_compilation_result_actions([
11665 /// CompilationResultAction::default()/* use setters */,
11666 /// CompilationResultAction::default()/* use (different) setters */,
11667 /// ]);
11668 /// ```
11669 pub fn set_compilation_result_actions<T, V>(mut self, v: T) -> Self
11670 where
11671 T: std::iter::IntoIterator<Item = V>,
11672 V: std::convert::Into<crate::model::CompilationResultAction>,
11673 {
11674 use std::iter::Iterator;
11675 self.compilation_result_actions = v.into_iter().map(|i| i.into()).collect();
11676 self
11677 }
11678
11679 /// Sets the value of [next_page_token][crate::model::QueryCompilationResultActionsResponse::next_page_token].
11680 ///
11681 /// # Example
11682 /// ```ignore,no_run
11683 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
11684 /// let x = QueryCompilationResultActionsResponse::new().set_next_page_token("example");
11685 /// ```
11686 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687 self.next_page_token = v.into();
11688 self
11689 }
11690}
11691
11692impl wkt::message::Message for QueryCompilationResultActionsResponse {
11693 fn typename() -> &'static str {
11694 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsResponse"
11695 }
11696}
11697
11698#[doc(hidden)]
11699impl google_cloud_gax::paginator::internal::PageableResponse
11700 for QueryCompilationResultActionsResponse
11701{
11702 type PageItem = crate::model::CompilationResultAction;
11703
11704 fn items(self) -> std::vec::Vec<Self::PageItem> {
11705 self.compilation_result_actions
11706 }
11707
11708 fn next_page_token(&self) -> std::string::String {
11709 use std::clone::Clone;
11710 self.next_page_token.clone()
11711 }
11712}
11713
11714/// Represents a Dataform workflow configuration.
11715#[derive(Clone, Default, PartialEq)]
11716#[non_exhaustive]
11717pub struct WorkflowConfig {
11718 /// Identifier. The workflow config's name.
11719 pub name: std::string::String,
11720
11721 /// Required. The name of the release config whose release_compilation_result
11722 /// should be executed. Must be in the format
11723 /// `projects/*/locations/*/repositories/*/releaseConfigs/*`.
11724 pub release_config: std::string::String,
11725
11726 /// Optional. If left unset, a default InvocationConfig will be used.
11727 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
11728
11729 /// Optional. Optional schedule (in cron format) for automatic execution of
11730 /// this workflow config.
11731 pub cron_schedule: std::string::String,
11732
11733 /// Optional. Specifies the time zone to be used when interpreting
11734 /// cron_schedule. Must be a time zone name from the [time zone
11735 /// database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If
11736 /// left unspecified, the default is `UTC`.
11737 pub time_zone: std::string::String,
11738
11739 /// Output only. Records of the 10 most recent scheduled execution attempts,
11740 /// ordered in descending order of `execution_time`. Updated whenever automatic
11741 /// creation of a workflow invocation is triggered by cron_schedule.
11742 pub recent_scheduled_execution_records:
11743 std::vec::Vec<crate::model::workflow_config::ScheduledExecutionRecord>,
11744
11745 /// Optional. Disables automatic creation of workflow invocations.
11746 pub disabled: bool,
11747
11748 /// Output only. The timestamp of when the WorkflowConfig was created.
11749 pub create_time: std::option::Option<wkt::Timestamp>,
11750
11751 /// Output only. The timestamp of when the WorkflowConfig was last updated.
11752 pub update_time: std::option::Option<wkt::Timestamp>,
11753
11754 /// Output only. All the metadata information that is used internally to serve
11755 /// the resource. For example: timestamps, flags, status fields, etc. The
11756 /// format of this field is a JSON string.
11757 pub internal_metadata: std::option::Option<std::string::String>,
11758
11759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11760}
11761
11762impl WorkflowConfig {
11763 /// Creates a new default instance.
11764 pub fn new() -> Self {
11765 std::default::Default::default()
11766 }
11767
11768 /// Sets the value of [name][crate::model::WorkflowConfig::name].
11769 ///
11770 /// # Example
11771 /// ```ignore,no_run
11772 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11773 /// # let project_id = "project_id";
11774 /// # let location_id = "location_id";
11775 /// # let repository_id = "repository_id";
11776 /// # let workflow_config_id = "workflow_config_id";
11777 /// let x = WorkflowConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
11778 /// ```
11779 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11780 self.name = v.into();
11781 self
11782 }
11783
11784 /// Sets the value of [release_config][crate::model::WorkflowConfig::release_config].
11785 ///
11786 /// # Example
11787 /// ```ignore,no_run
11788 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11789 /// # let project_id = "project_id";
11790 /// # let location_id = "location_id";
11791 /// # let repository_id = "repository_id";
11792 /// # let release_config_id = "release_config_id";
11793 /// let x = WorkflowConfig::new().set_release_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/releaseConfigs/{release_config_id}"));
11794 /// ```
11795 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11796 self.release_config = v.into();
11797 self
11798 }
11799
11800 /// Sets the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
11801 ///
11802 /// # Example
11803 /// ```ignore,no_run
11804 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11805 /// use google_cloud_dataform_v1::model::InvocationConfig;
11806 /// let x = WorkflowConfig::new().set_invocation_config(InvocationConfig::default()/* use setters */);
11807 /// ```
11808 pub fn set_invocation_config<T>(mut self, v: T) -> Self
11809 where
11810 T: std::convert::Into<crate::model::InvocationConfig>,
11811 {
11812 self.invocation_config = std::option::Option::Some(v.into());
11813 self
11814 }
11815
11816 /// Sets or clears the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
11817 ///
11818 /// # Example
11819 /// ```ignore,no_run
11820 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11821 /// use google_cloud_dataform_v1::model::InvocationConfig;
11822 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
11823 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(None::<InvocationConfig>);
11824 /// ```
11825 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
11826 where
11827 T: std::convert::Into<crate::model::InvocationConfig>,
11828 {
11829 self.invocation_config = v.map(|x| x.into());
11830 self
11831 }
11832
11833 /// Sets the value of [cron_schedule][crate::model::WorkflowConfig::cron_schedule].
11834 ///
11835 /// # Example
11836 /// ```ignore,no_run
11837 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11838 /// let x = WorkflowConfig::new().set_cron_schedule("example");
11839 /// ```
11840 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11841 self.cron_schedule = v.into();
11842 self
11843 }
11844
11845 /// Sets the value of [time_zone][crate::model::WorkflowConfig::time_zone].
11846 ///
11847 /// # Example
11848 /// ```ignore,no_run
11849 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11850 /// let x = WorkflowConfig::new().set_time_zone("example");
11851 /// ```
11852 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11853 self.time_zone = v.into();
11854 self
11855 }
11856
11857 /// Sets the value of [recent_scheduled_execution_records][crate::model::WorkflowConfig::recent_scheduled_execution_records].
11858 ///
11859 /// # Example
11860 /// ```ignore,no_run
11861 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11862 /// use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11863 /// let x = WorkflowConfig::new()
11864 /// .set_recent_scheduled_execution_records([
11865 /// ScheduledExecutionRecord::default()/* use setters */,
11866 /// ScheduledExecutionRecord::default()/* use (different) setters */,
11867 /// ]);
11868 /// ```
11869 pub fn set_recent_scheduled_execution_records<T, V>(mut self, v: T) -> Self
11870 where
11871 T: std::iter::IntoIterator<Item = V>,
11872 V: std::convert::Into<crate::model::workflow_config::ScheduledExecutionRecord>,
11873 {
11874 use std::iter::Iterator;
11875 self.recent_scheduled_execution_records = v.into_iter().map(|i| i.into()).collect();
11876 self
11877 }
11878
11879 /// Sets the value of [disabled][crate::model::WorkflowConfig::disabled].
11880 ///
11881 /// # Example
11882 /// ```ignore,no_run
11883 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11884 /// let x = WorkflowConfig::new().set_disabled(true);
11885 /// ```
11886 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11887 self.disabled = v.into();
11888 self
11889 }
11890
11891 /// Sets the value of [create_time][crate::model::WorkflowConfig::create_time].
11892 ///
11893 /// # Example
11894 /// ```ignore,no_run
11895 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11896 /// use wkt::Timestamp;
11897 /// let x = WorkflowConfig::new().set_create_time(Timestamp::default()/* use setters */);
11898 /// ```
11899 pub fn set_create_time<T>(mut self, v: T) -> Self
11900 where
11901 T: std::convert::Into<wkt::Timestamp>,
11902 {
11903 self.create_time = std::option::Option::Some(v.into());
11904 self
11905 }
11906
11907 /// Sets or clears the value of [create_time][crate::model::WorkflowConfig::create_time].
11908 ///
11909 /// # Example
11910 /// ```ignore,no_run
11911 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11912 /// use wkt::Timestamp;
11913 /// let x = WorkflowConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11914 /// let x = WorkflowConfig::new().set_or_clear_create_time(None::<Timestamp>);
11915 /// ```
11916 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11917 where
11918 T: std::convert::Into<wkt::Timestamp>,
11919 {
11920 self.create_time = v.map(|x| x.into());
11921 self
11922 }
11923
11924 /// Sets the value of [update_time][crate::model::WorkflowConfig::update_time].
11925 ///
11926 /// # Example
11927 /// ```ignore,no_run
11928 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11929 /// use wkt::Timestamp;
11930 /// let x = WorkflowConfig::new().set_update_time(Timestamp::default()/* use setters */);
11931 /// ```
11932 pub fn set_update_time<T>(mut self, v: T) -> Self
11933 where
11934 T: std::convert::Into<wkt::Timestamp>,
11935 {
11936 self.update_time = std::option::Option::Some(v.into());
11937 self
11938 }
11939
11940 /// Sets or clears the value of [update_time][crate::model::WorkflowConfig::update_time].
11941 ///
11942 /// # Example
11943 /// ```ignore,no_run
11944 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11945 /// use wkt::Timestamp;
11946 /// let x = WorkflowConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11947 /// let x = WorkflowConfig::new().set_or_clear_update_time(None::<Timestamp>);
11948 /// ```
11949 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11950 where
11951 T: std::convert::Into<wkt::Timestamp>,
11952 {
11953 self.update_time = v.map(|x| x.into());
11954 self
11955 }
11956
11957 /// Sets the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
11958 ///
11959 /// # Example
11960 /// ```ignore,no_run
11961 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11962 /// let x = WorkflowConfig::new().set_internal_metadata("example");
11963 /// ```
11964 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
11965 where
11966 T: std::convert::Into<std::string::String>,
11967 {
11968 self.internal_metadata = std::option::Option::Some(v.into());
11969 self
11970 }
11971
11972 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
11973 ///
11974 /// # Example
11975 /// ```ignore,no_run
11976 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
11977 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(Some("example"));
11978 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(None::<String>);
11979 /// ```
11980 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11981 where
11982 T: std::convert::Into<std::string::String>,
11983 {
11984 self.internal_metadata = v.map(|x| x.into());
11985 self
11986 }
11987}
11988
11989impl wkt::message::Message for WorkflowConfig {
11990 fn typename() -> &'static str {
11991 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig"
11992 }
11993}
11994
11995/// Defines additional types related to [WorkflowConfig].
11996pub mod workflow_config {
11997 #[allow(unused_imports)]
11998 use super::*;
11999
12000 /// A record of an attempt to create a workflow invocation for this workflow
12001 /// config.
12002 #[derive(Clone, Default, PartialEq)]
12003 #[non_exhaustive]
12004 pub struct ScheduledExecutionRecord {
12005 /// Output only. The timestamp of this execution attempt.
12006 pub execution_time: std::option::Option<wkt::Timestamp>,
12007
12008 /// The result of this execution attempt.
12009 pub result:
12010 std::option::Option<crate::model::workflow_config::scheduled_execution_record::Result>,
12011
12012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12013 }
12014
12015 impl ScheduledExecutionRecord {
12016 /// Creates a new default instance.
12017 pub fn new() -> Self {
12018 std::default::Default::default()
12019 }
12020
12021 /// Sets the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
12022 ///
12023 /// # Example
12024 /// ```ignore,no_run
12025 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12026 /// use wkt::Timestamp;
12027 /// let x = ScheduledExecutionRecord::new().set_execution_time(Timestamp::default()/* use setters */);
12028 /// ```
12029 pub fn set_execution_time<T>(mut self, v: T) -> Self
12030 where
12031 T: std::convert::Into<wkt::Timestamp>,
12032 {
12033 self.execution_time = std::option::Option::Some(v.into());
12034 self
12035 }
12036
12037 /// Sets or clears the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
12038 ///
12039 /// # Example
12040 /// ```ignore,no_run
12041 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12042 /// use wkt::Timestamp;
12043 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(Some(Timestamp::default()/* use setters */));
12044 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(None::<Timestamp>);
12045 /// ```
12046 pub fn set_or_clear_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
12047 where
12048 T: std::convert::Into<wkt::Timestamp>,
12049 {
12050 self.execution_time = v.map(|x| x.into());
12051 self
12052 }
12053
12054 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result].
12055 ///
12056 /// Note that all the setters affecting `result` are mutually
12057 /// exclusive.
12058 ///
12059 /// # Example
12060 /// ```ignore,no_run
12061 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12062 /// use google_cloud_dataform_v1::model::workflow_config::scheduled_execution_record::Result;
12063 /// let x = ScheduledExecutionRecord::new().set_result(Some(Result::WorkflowInvocation("example".to_string())));
12064 /// ```
12065 pub fn set_result<
12066 T: std::convert::Into<
12067 std::option::Option<
12068 crate::model::workflow_config::scheduled_execution_record::Result,
12069 >,
12070 >,
12071 >(
12072 mut self,
12073 v: T,
12074 ) -> Self {
12075 self.result = v.into();
12076 self
12077 }
12078
12079 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
12080 /// if it holds a `WorkflowInvocation`, `None` if the field is not set or
12081 /// holds a different branch.
12082 pub fn workflow_invocation(&self) -> std::option::Option<&std::string::String> {
12083 #[allow(unreachable_patterns)]
12084 self.result.as_ref().and_then(|v| match v {
12085 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(v) => std::option::Option::Some(v),
12086 _ => std::option::Option::None,
12087 })
12088 }
12089
12090 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
12091 /// to hold a `WorkflowInvocation`.
12092 ///
12093 /// Note that all the setters affecting `result` are
12094 /// mutually exclusive.
12095 ///
12096 /// # Example
12097 /// ```ignore,no_run
12098 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12099 /// # let project_id = "project_id";
12100 /// # let location_id = "location_id";
12101 /// # let repository_id = "repository_id";
12102 /// # let workflow_invocation_id = "workflow_invocation_id";
12103 /// let x = ScheduledExecutionRecord::new().set_workflow_invocation(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
12104 /// assert!(x.workflow_invocation().is_some());
12105 /// assert!(x.error_status().is_none());
12106 /// ```
12107 pub fn set_workflow_invocation<T: std::convert::Into<std::string::String>>(
12108 mut self,
12109 v: T,
12110 ) -> Self {
12111 self.result = std::option::Option::Some(
12112 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(
12113 v.into()
12114 )
12115 );
12116 self
12117 }
12118
12119 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
12120 /// if it holds a `ErrorStatus`, `None` if the field is not set or
12121 /// holds a different branch.
12122 pub fn error_status(
12123 &self,
12124 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
12125 #[allow(unreachable_patterns)]
12126 self.result.as_ref().and_then(|v| match v {
12127 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
12128 v,
12129 ) => std::option::Option::Some(v),
12130 _ => std::option::Option::None,
12131 })
12132 }
12133
12134 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
12135 /// to hold a `ErrorStatus`.
12136 ///
12137 /// Note that all the setters affecting `result` are
12138 /// mutually exclusive.
12139 ///
12140 /// # Example
12141 /// ```ignore,no_run
12142 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
12143 /// use google_cloud_rpc::model::Status;
12144 /// let x = ScheduledExecutionRecord::new().set_error_status(Status::default()/* use setters */);
12145 /// assert!(x.error_status().is_some());
12146 /// assert!(x.workflow_invocation().is_none());
12147 /// ```
12148 pub fn set_error_status<
12149 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
12150 >(
12151 mut self,
12152 v: T,
12153 ) -> Self {
12154 self.result = std::option::Option::Some(
12155 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
12156 v.into(),
12157 ),
12158 );
12159 self
12160 }
12161 }
12162
12163 impl wkt::message::Message for ScheduledExecutionRecord {
12164 fn typename() -> &'static str {
12165 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig.ScheduledExecutionRecord"
12166 }
12167 }
12168
12169 /// Defines additional types related to [ScheduledExecutionRecord].
12170 pub mod scheduled_execution_record {
12171 #[allow(unused_imports)]
12172 use super::*;
12173
12174 /// The result of this execution attempt.
12175 #[derive(Clone, Debug, PartialEq)]
12176 #[non_exhaustive]
12177 pub enum Result {
12178 /// The name of the created workflow invocation, if one was successfully
12179 /// created. Must be in the format
12180 /// `projects/*/locations/*/repositories/*/workflowInvocations/*`.
12181 WorkflowInvocation(std::string::String),
12182 /// The error status encountered upon this attempt to create the
12183 /// workflow invocation, if the attempt was unsuccessful.
12184 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
12185 }
12186 }
12187}
12188
12189/// Includes various configuration options for a workflow invocation.
12190/// If both `included_targets` and `included_tags` are unset, all actions
12191/// will be included.
12192#[derive(Clone, Default, PartialEq)]
12193#[non_exhaustive]
12194pub struct InvocationConfig {
12195 /// Optional. The set of action identifiers to include.
12196 pub included_targets: std::vec::Vec<crate::model::Target>,
12197
12198 /// Optional. The set of tags to include.
12199 pub included_tags: std::vec::Vec<std::string::String>,
12200
12201 /// Optional. When set to true, transitive dependencies of included actions
12202 /// will be executed.
12203 pub transitive_dependencies_included: bool,
12204
12205 /// Optional. When set to true, transitive dependents of included actions will
12206 /// be executed.
12207 pub transitive_dependents_included: bool,
12208
12209 /// Optional. When set to true, any incremental tables will be fully refreshed.
12210 pub fully_refresh_incremental_tables_enabled: bool,
12211
12212 /// Optional. The service account to run workflow invocations under.
12213 pub service_account: std::string::String,
12214
12215 /// Optional. Configuration for end user authentication.
12216 /// Note that this should not be set when `service_account` is used.
12217 pub end_user_auth_config:
12218 std::option::Option<crate::model::invocation_config::EndUserAuthenticationConfig>,
12219
12220 /// Optional. Specifies the priority for query execution in BigQuery.
12221 /// More information can be found at
12222 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
12223 pub query_priority: std::option::Option<crate::model::invocation_config::QueryPriority>,
12224
12225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12226}
12227
12228impl InvocationConfig {
12229 /// Creates a new default instance.
12230 pub fn new() -> Self {
12231 std::default::Default::default()
12232 }
12233
12234 /// Sets the value of [included_targets][crate::model::InvocationConfig::included_targets].
12235 ///
12236 /// # Example
12237 /// ```ignore,no_run
12238 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12239 /// use google_cloud_dataform_v1::model::Target;
12240 /// let x = InvocationConfig::new()
12241 /// .set_included_targets([
12242 /// Target::default()/* use setters */,
12243 /// Target::default()/* use (different) setters */,
12244 /// ]);
12245 /// ```
12246 pub fn set_included_targets<T, V>(mut self, v: T) -> Self
12247 where
12248 T: std::iter::IntoIterator<Item = V>,
12249 V: std::convert::Into<crate::model::Target>,
12250 {
12251 use std::iter::Iterator;
12252 self.included_targets = v.into_iter().map(|i| i.into()).collect();
12253 self
12254 }
12255
12256 /// Sets the value of [included_tags][crate::model::InvocationConfig::included_tags].
12257 ///
12258 /// # Example
12259 /// ```ignore,no_run
12260 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12261 /// let x = InvocationConfig::new().set_included_tags(["a", "b", "c"]);
12262 /// ```
12263 pub fn set_included_tags<T, V>(mut self, v: T) -> Self
12264 where
12265 T: std::iter::IntoIterator<Item = V>,
12266 V: std::convert::Into<std::string::String>,
12267 {
12268 use std::iter::Iterator;
12269 self.included_tags = v.into_iter().map(|i| i.into()).collect();
12270 self
12271 }
12272
12273 /// Sets the value of [transitive_dependencies_included][crate::model::InvocationConfig::transitive_dependencies_included].
12274 ///
12275 /// # Example
12276 /// ```ignore,no_run
12277 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12278 /// let x = InvocationConfig::new().set_transitive_dependencies_included(true);
12279 /// ```
12280 pub fn set_transitive_dependencies_included<T: std::convert::Into<bool>>(
12281 mut self,
12282 v: T,
12283 ) -> Self {
12284 self.transitive_dependencies_included = v.into();
12285 self
12286 }
12287
12288 /// Sets the value of [transitive_dependents_included][crate::model::InvocationConfig::transitive_dependents_included].
12289 ///
12290 /// # Example
12291 /// ```ignore,no_run
12292 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12293 /// let x = InvocationConfig::new().set_transitive_dependents_included(true);
12294 /// ```
12295 pub fn set_transitive_dependents_included<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12296 self.transitive_dependents_included = v.into();
12297 self
12298 }
12299
12300 /// Sets the value of [fully_refresh_incremental_tables_enabled][crate::model::InvocationConfig::fully_refresh_incremental_tables_enabled].
12301 ///
12302 /// # Example
12303 /// ```ignore,no_run
12304 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12305 /// let x = InvocationConfig::new().set_fully_refresh_incremental_tables_enabled(true);
12306 /// ```
12307 pub fn set_fully_refresh_incremental_tables_enabled<T: std::convert::Into<bool>>(
12308 mut self,
12309 v: T,
12310 ) -> Self {
12311 self.fully_refresh_incremental_tables_enabled = v.into();
12312 self
12313 }
12314
12315 /// Sets the value of [service_account][crate::model::InvocationConfig::service_account].
12316 ///
12317 /// # Example
12318 /// ```ignore,no_run
12319 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12320 /// let x = InvocationConfig::new().set_service_account("example");
12321 /// ```
12322 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12323 self.service_account = v.into();
12324 self
12325 }
12326
12327 /// Sets the value of [end_user_auth_config][crate::model::InvocationConfig::end_user_auth_config].
12328 ///
12329 /// # Example
12330 /// ```ignore,no_run
12331 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12332 /// use google_cloud_dataform_v1::model::invocation_config::EndUserAuthenticationConfig;
12333 /// let x = InvocationConfig::new().set_end_user_auth_config(EndUserAuthenticationConfig::default()/* use setters */);
12334 /// ```
12335 pub fn set_end_user_auth_config<T>(mut self, v: T) -> Self
12336 where
12337 T: std::convert::Into<crate::model::invocation_config::EndUserAuthenticationConfig>,
12338 {
12339 self.end_user_auth_config = std::option::Option::Some(v.into());
12340 self
12341 }
12342
12343 /// Sets or clears the value of [end_user_auth_config][crate::model::InvocationConfig::end_user_auth_config].
12344 ///
12345 /// # Example
12346 /// ```ignore,no_run
12347 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12348 /// use google_cloud_dataform_v1::model::invocation_config::EndUserAuthenticationConfig;
12349 /// let x = InvocationConfig::new().set_or_clear_end_user_auth_config(Some(EndUserAuthenticationConfig::default()/* use setters */));
12350 /// let x = InvocationConfig::new().set_or_clear_end_user_auth_config(None::<EndUserAuthenticationConfig>);
12351 /// ```
12352 pub fn set_or_clear_end_user_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
12353 where
12354 T: std::convert::Into<crate::model::invocation_config::EndUserAuthenticationConfig>,
12355 {
12356 self.end_user_auth_config = v.map(|x| x.into());
12357 self
12358 }
12359
12360 /// Sets the value of [query_priority][crate::model::InvocationConfig::query_priority].
12361 ///
12362 /// # Example
12363 /// ```ignore,no_run
12364 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12365 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
12366 /// let x0 = InvocationConfig::new().set_query_priority(QueryPriority::Interactive);
12367 /// let x1 = InvocationConfig::new().set_query_priority(QueryPriority::Batch);
12368 /// ```
12369 pub fn set_query_priority<T>(mut self, v: T) -> Self
12370 where
12371 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
12372 {
12373 self.query_priority = std::option::Option::Some(v.into());
12374 self
12375 }
12376
12377 /// Sets or clears the value of [query_priority][crate::model::InvocationConfig::query_priority].
12378 ///
12379 /// # Example
12380 /// ```ignore,no_run
12381 /// # use google_cloud_dataform_v1::model::InvocationConfig;
12382 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
12383 /// let x0 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Interactive));
12384 /// let x1 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Batch));
12385 /// let x_none = InvocationConfig::new().set_or_clear_query_priority(None::<QueryPriority>);
12386 /// ```
12387 pub fn set_or_clear_query_priority<T>(mut self, v: std::option::Option<T>) -> Self
12388 where
12389 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
12390 {
12391 self.query_priority = v.map(|x| x.into());
12392 self
12393 }
12394}
12395
12396impl wkt::message::Message for InvocationConfig {
12397 fn typename() -> &'static str {
12398 "type.googleapis.com/google.cloud.dataform.v1.InvocationConfig"
12399 }
12400}
12401
12402/// Defines additional types related to [InvocationConfig].
12403pub mod invocation_config {
12404 #[allow(unused_imports)]
12405 use super::*;
12406
12407 /// Includes configuration options for end user authentication.
12408 #[derive(Clone, Default, PartialEq)]
12409 #[non_exhaustive]
12410 pub struct EndUserAuthenticationConfig {
12411 /// Output only. Email address of the user to run workflow invocations under.
12412 pub user_email: std::string::String,
12413
12414 /// Optional. OAuth configuration for end user authentication.
12415 pub oauth_config: std::option::Option<crate::model::OAuthConfig>,
12416
12417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12418 }
12419
12420 impl EndUserAuthenticationConfig {
12421 /// Creates a new default instance.
12422 pub fn new() -> Self {
12423 std::default::Default::default()
12424 }
12425
12426 /// Sets the value of [user_email][crate::model::invocation_config::EndUserAuthenticationConfig::user_email].
12427 ///
12428 /// # Example
12429 /// ```ignore,no_run
12430 /// # use google_cloud_dataform_v1::model::invocation_config::EndUserAuthenticationConfig;
12431 /// let x = EndUserAuthenticationConfig::new().set_user_email("example");
12432 /// ```
12433 pub fn set_user_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12434 self.user_email = v.into();
12435 self
12436 }
12437
12438 /// Sets the value of [oauth_config][crate::model::invocation_config::EndUserAuthenticationConfig::oauth_config].
12439 ///
12440 /// # Example
12441 /// ```ignore,no_run
12442 /// # use google_cloud_dataform_v1::model::invocation_config::EndUserAuthenticationConfig;
12443 /// use google_cloud_dataform_v1::model::OAuthConfig;
12444 /// let x = EndUserAuthenticationConfig::new().set_oauth_config(OAuthConfig::default()/* use setters */);
12445 /// ```
12446 pub fn set_oauth_config<T>(mut self, v: T) -> Self
12447 where
12448 T: std::convert::Into<crate::model::OAuthConfig>,
12449 {
12450 self.oauth_config = std::option::Option::Some(v.into());
12451 self
12452 }
12453
12454 /// Sets or clears the value of [oauth_config][crate::model::invocation_config::EndUserAuthenticationConfig::oauth_config].
12455 ///
12456 /// # Example
12457 /// ```ignore,no_run
12458 /// # use google_cloud_dataform_v1::model::invocation_config::EndUserAuthenticationConfig;
12459 /// use google_cloud_dataform_v1::model::OAuthConfig;
12460 /// let x = EndUserAuthenticationConfig::new().set_or_clear_oauth_config(Some(OAuthConfig::default()/* use setters */));
12461 /// let x = EndUserAuthenticationConfig::new().set_or_clear_oauth_config(None::<OAuthConfig>);
12462 /// ```
12463 pub fn set_or_clear_oauth_config<T>(mut self, v: std::option::Option<T>) -> Self
12464 where
12465 T: std::convert::Into<crate::model::OAuthConfig>,
12466 {
12467 self.oauth_config = v.map(|x| x.into());
12468 self
12469 }
12470 }
12471
12472 impl wkt::message::Message for EndUserAuthenticationConfig {
12473 fn typename() -> &'static str {
12474 "type.googleapis.com/google.cloud.dataform.v1.InvocationConfig.EndUserAuthenticationConfig"
12475 }
12476 }
12477
12478 /// Types of priority for query execution in BigQuery.
12479 ///
12480 /// # Working with unknown values
12481 ///
12482 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12483 /// additional enum variants at any time. Adding new variants is not considered
12484 /// a breaking change. Applications should write their code in anticipation of:
12485 ///
12486 /// - New values appearing in future releases of the client library, **and**
12487 /// - New values received dynamically, without application changes.
12488 ///
12489 /// Please consult the [Working with enums] section in the user guide for some
12490 /// guidelines.
12491 ///
12492 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12493 #[derive(Clone, Debug, PartialEq)]
12494 #[non_exhaustive]
12495 pub enum QueryPriority {
12496 /// Default value. This value is unused.
12497 Unspecified,
12498 /// Query will be executed in BigQuery with interactive priority.
12499 /// More information can be found at
12500 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
12501 Interactive,
12502 /// Query will be executed in BigQuery with batch priority.
12503 /// More information can be found at
12504 /// <https://cloud.google.com/bigquery/docs/running-queries#batchqueries>.
12505 Batch,
12506 /// If set, the enum was initialized with an unknown value.
12507 ///
12508 /// Applications can examine the value using [QueryPriority::value] or
12509 /// [QueryPriority::name].
12510 UnknownValue(query_priority::UnknownValue),
12511 }
12512
12513 #[doc(hidden)]
12514 pub mod query_priority {
12515 #[allow(unused_imports)]
12516 use super::*;
12517 #[derive(Clone, Debug, PartialEq)]
12518 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12519 }
12520
12521 impl QueryPriority {
12522 /// Gets the enum value.
12523 ///
12524 /// Returns `None` if the enum contains an unknown value deserialized from
12525 /// the string representation of enums.
12526 pub fn value(&self) -> std::option::Option<i32> {
12527 match self {
12528 Self::Unspecified => std::option::Option::Some(0),
12529 Self::Interactive => std::option::Option::Some(1),
12530 Self::Batch => std::option::Option::Some(2),
12531 Self::UnknownValue(u) => u.0.value(),
12532 }
12533 }
12534
12535 /// Gets the enum value as a string.
12536 ///
12537 /// Returns `None` if the enum contains an unknown value deserialized from
12538 /// the integer representation of enums.
12539 pub fn name(&self) -> std::option::Option<&str> {
12540 match self {
12541 Self::Unspecified => std::option::Option::Some("QUERY_PRIORITY_UNSPECIFIED"),
12542 Self::Interactive => std::option::Option::Some("INTERACTIVE"),
12543 Self::Batch => std::option::Option::Some("BATCH"),
12544 Self::UnknownValue(u) => u.0.name(),
12545 }
12546 }
12547 }
12548
12549 impl std::default::Default for QueryPriority {
12550 fn default() -> Self {
12551 use std::convert::From;
12552 Self::from(0)
12553 }
12554 }
12555
12556 impl std::fmt::Display for QueryPriority {
12557 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12558 wkt::internal::display_enum(f, self.name(), self.value())
12559 }
12560 }
12561
12562 impl std::convert::From<i32> for QueryPriority {
12563 fn from(value: i32) -> Self {
12564 match value {
12565 0 => Self::Unspecified,
12566 1 => Self::Interactive,
12567 2 => Self::Batch,
12568 _ => Self::UnknownValue(query_priority::UnknownValue(
12569 wkt::internal::UnknownEnumValue::Integer(value),
12570 )),
12571 }
12572 }
12573 }
12574
12575 impl std::convert::From<&str> for QueryPriority {
12576 fn from(value: &str) -> Self {
12577 use std::string::ToString;
12578 match value {
12579 "QUERY_PRIORITY_UNSPECIFIED" => Self::Unspecified,
12580 "INTERACTIVE" => Self::Interactive,
12581 "BATCH" => Self::Batch,
12582 _ => Self::UnknownValue(query_priority::UnknownValue(
12583 wkt::internal::UnknownEnumValue::String(value.to_string()),
12584 )),
12585 }
12586 }
12587 }
12588
12589 impl serde::ser::Serialize for QueryPriority {
12590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12591 where
12592 S: serde::Serializer,
12593 {
12594 match self {
12595 Self::Unspecified => serializer.serialize_i32(0),
12596 Self::Interactive => serializer.serialize_i32(1),
12597 Self::Batch => serializer.serialize_i32(2),
12598 Self::UnknownValue(u) => u.0.serialize(serializer),
12599 }
12600 }
12601 }
12602
12603 impl<'de> serde::de::Deserialize<'de> for QueryPriority {
12604 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12605 where
12606 D: serde::Deserializer<'de>,
12607 {
12608 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryPriority>::new(
12609 ".google.cloud.dataform.v1.InvocationConfig.QueryPriority",
12610 ))
12611 }
12612 }
12613}
12614
12615/// `ListWorkflowConfigs` request message.
12616#[derive(Clone, Default, PartialEq)]
12617#[non_exhaustive]
12618pub struct ListWorkflowConfigsRequest {
12619 /// Required. The repository in which to list workflow configs. Must be in the
12620 /// format `projects/*/locations/*/repositories/*`.
12621 pub parent: std::string::String,
12622
12623 /// Optional. Maximum number of workflow configs to return. The server may
12624 /// return fewer items than requested. If unspecified, the server will pick an
12625 /// appropriate default.
12626 pub page_size: i32,
12627
12628 /// Optional. Page token received from a previous `ListWorkflowConfigs` call.
12629 /// Provide this to retrieve the subsequent page.
12630 ///
12631 /// When paginating, all other parameters provided to `ListWorkflowConfigs`,
12632 /// with the exception of `page_size`, must match the call that provided the
12633 /// page token.
12634 pub page_token: std::string::String,
12635
12636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12637}
12638
12639impl ListWorkflowConfigsRequest {
12640 /// Creates a new default instance.
12641 pub fn new() -> Self {
12642 std::default::Default::default()
12643 }
12644
12645 /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
12646 ///
12647 /// # Example
12648 /// ```ignore,no_run
12649 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12650 /// # let project_id = "project_id";
12651 /// # let location_id = "location_id";
12652 /// # let repository_id = "repository_id";
12653 /// let x = ListWorkflowConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
12654 /// ```
12655 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12656 self.parent = v.into();
12657 self
12658 }
12659
12660 /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
12661 ///
12662 /// # Example
12663 /// ```ignore,no_run
12664 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12665 /// let x = ListWorkflowConfigsRequest::new().set_page_size(42);
12666 /// ```
12667 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12668 self.page_size = v.into();
12669 self
12670 }
12671
12672 /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
12673 ///
12674 /// # Example
12675 /// ```ignore,no_run
12676 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
12677 /// let x = ListWorkflowConfigsRequest::new().set_page_token("example");
12678 /// ```
12679 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12680 self.page_token = v.into();
12681 self
12682 }
12683}
12684
12685impl wkt::message::Message for ListWorkflowConfigsRequest {
12686 fn typename() -> &'static str {
12687 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsRequest"
12688 }
12689}
12690
12691/// `ListWorkflowConfigs` response message.
12692#[derive(Clone, Default, PartialEq)]
12693#[non_exhaustive]
12694pub struct ListWorkflowConfigsResponse {
12695 /// List of workflow configs.
12696 pub workflow_configs: std::vec::Vec<crate::model::WorkflowConfig>,
12697
12698 /// A token, which can be sent as `page_token` to retrieve the next page.
12699 /// If this field is omitted, there are no subsequent pages.
12700 pub next_page_token: std::string::String,
12701
12702 /// Locations which could not be reached.
12703 pub unreachable: std::vec::Vec<std::string::String>,
12704
12705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12706}
12707
12708impl ListWorkflowConfigsResponse {
12709 /// Creates a new default instance.
12710 pub fn new() -> Self {
12711 std::default::Default::default()
12712 }
12713
12714 /// Sets the value of [workflow_configs][crate::model::ListWorkflowConfigsResponse::workflow_configs].
12715 ///
12716 /// # Example
12717 /// ```ignore,no_run
12718 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12719 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12720 /// let x = ListWorkflowConfigsResponse::new()
12721 /// .set_workflow_configs([
12722 /// WorkflowConfig::default()/* use setters */,
12723 /// WorkflowConfig::default()/* use (different) setters */,
12724 /// ]);
12725 /// ```
12726 pub fn set_workflow_configs<T, V>(mut self, v: T) -> Self
12727 where
12728 T: std::iter::IntoIterator<Item = V>,
12729 V: std::convert::Into<crate::model::WorkflowConfig>,
12730 {
12731 use std::iter::Iterator;
12732 self.workflow_configs = v.into_iter().map(|i| i.into()).collect();
12733 self
12734 }
12735
12736 /// Sets the value of [next_page_token][crate::model::ListWorkflowConfigsResponse::next_page_token].
12737 ///
12738 /// # Example
12739 /// ```ignore,no_run
12740 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12741 /// let x = ListWorkflowConfigsResponse::new().set_next_page_token("example");
12742 /// ```
12743 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12744 self.next_page_token = v.into();
12745 self
12746 }
12747
12748 /// Sets the value of [unreachable][crate::model::ListWorkflowConfigsResponse::unreachable].
12749 ///
12750 /// # Example
12751 /// ```ignore,no_run
12752 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
12753 /// let x = ListWorkflowConfigsResponse::new().set_unreachable(["a", "b", "c"]);
12754 /// ```
12755 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12756 where
12757 T: std::iter::IntoIterator<Item = V>,
12758 V: std::convert::Into<std::string::String>,
12759 {
12760 use std::iter::Iterator;
12761 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12762 self
12763 }
12764}
12765
12766impl wkt::message::Message for ListWorkflowConfigsResponse {
12767 fn typename() -> &'static str {
12768 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsResponse"
12769 }
12770}
12771
12772#[doc(hidden)]
12773impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowConfigsResponse {
12774 type PageItem = crate::model::WorkflowConfig;
12775
12776 fn items(self) -> std::vec::Vec<Self::PageItem> {
12777 self.workflow_configs
12778 }
12779
12780 fn next_page_token(&self) -> std::string::String {
12781 use std::clone::Clone;
12782 self.next_page_token.clone()
12783 }
12784}
12785
12786/// `GetWorkflowConfig` request message.
12787#[derive(Clone, Default, PartialEq)]
12788#[non_exhaustive]
12789pub struct GetWorkflowConfigRequest {
12790 /// Required. The workflow config's name.
12791 pub name: std::string::String,
12792
12793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12794}
12795
12796impl GetWorkflowConfigRequest {
12797 /// Creates a new default instance.
12798 pub fn new() -> Self {
12799 std::default::Default::default()
12800 }
12801
12802 /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
12803 ///
12804 /// # Example
12805 /// ```ignore,no_run
12806 /// # use google_cloud_dataform_v1::model::GetWorkflowConfigRequest;
12807 /// # let project_id = "project_id";
12808 /// # let location_id = "location_id";
12809 /// # let repository_id = "repository_id";
12810 /// # let workflow_config_id = "workflow_config_id";
12811 /// let x = GetWorkflowConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
12812 /// ```
12813 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12814 self.name = v.into();
12815 self
12816 }
12817}
12818
12819impl wkt::message::Message for GetWorkflowConfigRequest {
12820 fn typename() -> &'static str {
12821 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowConfigRequest"
12822 }
12823}
12824
12825/// `CreateWorkflowConfig` request message.
12826#[derive(Clone, Default, PartialEq)]
12827#[non_exhaustive]
12828pub struct CreateWorkflowConfigRequest {
12829 /// Required. The repository in which to create the workflow config. Must be in
12830 /// the format `projects/*/locations/*/repositories/*`.
12831 pub parent: std::string::String,
12832
12833 /// Required. The workflow config to create.
12834 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
12835
12836 /// Required. The ID to use for the workflow config, which will become the
12837 /// final component of the workflow config's resource name.
12838 pub workflow_config_id: std::string::String,
12839
12840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12841}
12842
12843impl CreateWorkflowConfigRequest {
12844 /// Creates a new default instance.
12845 pub fn new() -> Self {
12846 std::default::Default::default()
12847 }
12848
12849 /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
12850 ///
12851 /// # Example
12852 /// ```ignore,no_run
12853 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12854 /// # let project_id = "project_id";
12855 /// # let location_id = "location_id";
12856 /// # let repository_id = "repository_id";
12857 /// let x = CreateWorkflowConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
12858 /// ```
12859 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12860 self.parent = v.into();
12861 self
12862 }
12863
12864 /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
12865 ///
12866 /// # Example
12867 /// ```ignore,no_run
12868 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12869 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12870 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
12871 /// ```
12872 pub fn set_workflow_config<T>(mut self, v: T) -> Self
12873 where
12874 T: std::convert::Into<crate::model::WorkflowConfig>,
12875 {
12876 self.workflow_config = std::option::Option::Some(v.into());
12877 self
12878 }
12879
12880 /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
12881 ///
12882 /// # Example
12883 /// ```ignore,no_run
12884 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12885 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12886 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
12887 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
12888 /// ```
12889 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
12890 where
12891 T: std::convert::Into<crate::model::WorkflowConfig>,
12892 {
12893 self.workflow_config = v.map(|x| x.into());
12894 self
12895 }
12896
12897 /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
12898 ///
12899 /// # Example
12900 /// ```ignore,no_run
12901 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
12902 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config_id("example");
12903 /// ```
12904 pub fn set_workflow_config_id<T: std::convert::Into<std::string::String>>(
12905 mut self,
12906 v: T,
12907 ) -> Self {
12908 self.workflow_config_id = v.into();
12909 self
12910 }
12911}
12912
12913impl wkt::message::Message for CreateWorkflowConfigRequest {
12914 fn typename() -> &'static str {
12915 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowConfigRequest"
12916 }
12917}
12918
12919/// `UpdateWorkflowConfig` request message.
12920#[derive(Clone, Default, PartialEq)]
12921#[non_exhaustive]
12922pub struct UpdateWorkflowConfigRequest {
12923 /// Optional. Specifies the fields to be updated in the workflow config. If
12924 /// left unset, all fields will be updated.
12925 pub update_mask: std::option::Option<wkt::FieldMask>,
12926
12927 /// Required. The workflow config to update.
12928 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
12929
12930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12931}
12932
12933impl UpdateWorkflowConfigRequest {
12934 /// Creates a new default instance.
12935 pub fn new() -> Self {
12936 std::default::Default::default()
12937 }
12938
12939 /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
12940 ///
12941 /// # Example
12942 /// ```ignore,no_run
12943 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12944 /// use wkt::FieldMask;
12945 /// let x = UpdateWorkflowConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12946 /// ```
12947 pub fn set_update_mask<T>(mut self, v: T) -> Self
12948 where
12949 T: std::convert::Into<wkt::FieldMask>,
12950 {
12951 self.update_mask = std::option::Option::Some(v.into());
12952 self
12953 }
12954
12955 /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
12956 ///
12957 /// # Example
12958 /// ```ignore,no_run
12959 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12960 /// use wkt::FieldMask;
12961 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12962 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12963 /// ```
12964 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12965 where
12966 T: std::convert::Into<wkt::FieldMask>,
12967 {
12968 self.update_mask = v.map(|x| x.into());
12969 self
12970 }
12971
12972 /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
12973 ///
12974 /// # Example
12975 /// ```ignore,no_run
12976 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12977 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12978 /// let x = UpdateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
12979 /// ```
12980 pub fn set_workflow_config<T>(mut self, v: T) -> Self
12981 where
12982 T: std::convert::Into<crate::model::WorkflowConfig>,
12983 {
12984 self.workflow_config = std::option::Option::Some(v.into());
12985 self
12986 }
12987
12988 /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
12989 ///
12990 /// # Example
12991 /// ```ignore,no_run
12992 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
12993 /// use google_cloud_dataform_v1::model::WorkflowConfig;
12994 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
12995 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
12996 /// ```
12997 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
12998 where
12999 T: std::convert::Into<crate::model::WorkflowConfig>,
13000 {
13001 self.workflow_config = v.map(|x| x.into());
13002 self
13003 }
13004}
13005
13006impl wkt::message::Message for UpdateWorkflowConfigRequest {
13007 fn typename() -> &'static str {
13008 "type.googleapis.com/google.cloud.dataform.v1.UpdateWorkflowConfigRequest"
13009 }
13010}
13011
13012/// `DeleteWorkflowConfig` request message.
13013#[derive(Clone, Default, PartialEq)]
13014#[non_exhaustive]
13015pub struct DeleteWorkflowConfigRequest {
13016 /// Required. The workflow config's name.
13017 pub name: std::string::String,
13018
13019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13020}
13021
13022impl DeleteWorkflowConfigRequest {
13023 /// Creates a new default instance.
13024 pub fn new() -> Self {
13025 std::default::Default::default()
13026 }
13027
13028 /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
13029 ///
13030 /// # Example
13031 /// ```ignore,no_run
13032 /// # use google_cloud_dataform_v1::model::DeleteWorkflowConfigRequest;
13033 /// # let project_id = "project_id";
13034 /// # let location_id = "location_id";
13035 /// # let repository_id = "repository_id";
13036 /// # let workflow_config_id = "workflow_config_id";
13037 /// let x = DeleteWorkflowConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
13038 /// ```
13039 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13040 self.name = v.into();
13041 self
13042 }
13043}
13044
13045impl wkt::message::Message for DeleteWorkflowConfigRequest {
13046 fn typename() -> &'static str {
13047 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowConfigRequest"
13048 }
13049}
13050
13051/// Represents a single invocation of a compilation result.
13052#[derive(Clone, Default, PartialEq)]
13053#[non_exhaustive]
13054pub struct WorkflowInvocation {
13055 /// Output only. The workflow invocation's name.
13056 pub name: std::string::String,
13057
13058 /// Immutable. If left unset, a default InvocationConfig will be used.
13059 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
13060
13061 /// Output only. This workflow invocation's current state.
13062 pub state: crate::model::workflow_invocation::State,
13063
13064 /// Output only. This workflow invocation's timing details.
13065 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
13066
13067 /// Output only. The resolved compilation result that was used to create this
13068 /// invocation. Will be in the format
13069 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
13070 pub resolved_compilation_result: std::string::String,
13071
13072 /// Output only. Only set if the repository has a KMS Key.
13073 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
13074
13075 /// Output only. All the metadata information that is used internally to serve
13076 /// the resource. For example: timestamps, flags, status fields, etc. The
13077 /// format of this field is a JSON string.
13078 pub internal_metadata: std::option::Option<std::string::String>,
13079
13080 /// Output only. Metadata indicating whether this resource is user-scoped.
13081 /// `WorkflowInvocation` resource is `user_scoped` only if it is sourced
13082 /// from a compilation result and the compilation result is user-scoped.
13083 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
13084
13085 /// Output only. The pipeline options which defines the pipeline type and path
13086 /// within the Git repository.
13087 pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
13088
13089 /// The source of the compilation result to use for this invocation.
13090 pub compilation_source:
13091 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
13092
13093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13094}
13095
13096impl WorkflowInvocation {
13097 /// Creates a new default instance.
13098 pub fn new() -> Self {
13099 std::default::Default::default()
13100 }
13101
13102 /// Sets the value of [name][crate::model::WorkflowInvocation::name].
13103 ///
13104 /// # Example
13105 /// ```ignore,no_run
13106 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13107 /// # let project_id = "project_id";
13108 /// # let location_id = "location_id";
13109 /// # let repository_id = "repository_id";
13110 /// # let workflow_invocation_id = "workflow_invocation_id";
13111 /// let x = WorkflowInvocation::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13112 /// ```
13113 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13114 self.name = v.into();
13115 self
13116 }
13117
13118 /// Sets the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
13119 ///
13120 /// # Example
13121 /// ```ignore,no_run
13122 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13123 /// use google_cloud_dataform_v1::model::InvocationConfig;
13124 /// let x = WorkflowInvocation::new().set_invocation_config(InvocationConfig::default()/* use setters */);
13125 /// ```
13126 pub fn set_invocation_config<T>(mut self, v: T) -> Self
13127 where
13128 T: std::convert::Into<crate::model::InvocationConfig>,
13129 {
13130 self.invocation_config = std::option::Option::Some(v.into());
13131 self
13132 }
13133
13134 /// Sets or clears the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
13135 ///
13136 /// # Example
13137 /// ```ignore,no_run
13138 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13139 /// use google_cloud_dataform_v1::model::InvocationConfig;
13140 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
13141 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(None::<InvocationConfig>);
13142 /// ```
13143 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
13144 where
13145 T: std::convert::Into<crate::model::InvocationConfig>,
13146 {
13147 self.invocation_config = v.map(|x| x.into());
13148 self
13149 }
13150
13151 /// Sets the value of [state][crate::model::WorkflowInvocation::state].
13152 ///
13153 /// # Example
13154 /// ```ignore,no_run
13155 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13156 /// use google_cloud_dataform_v1::model::workflow_invocation::State;
13157 /// let x0 = WorkflowInvocation::new().set_state(State::Running);
13158 /// let x1 = WorkflowInvocation::new().set_state(State::Succeeded);
13159 /// let x2 = WorkflowInvocation::new().set_state(State::Cancelled);
13160 /// ```
13161 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation::State>>(
13162 mut self,
13163 v: T,
13164 ) -> Self {
13165 self.state = v.into();
13166 self
13167 }
13168
13169 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
13170 ///
13171 /// # Example
13172 /// ```ignore,no_run
13173 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13174 /// use google_cloud_type::model::Interval;
13175 /// let x = WorkflowInvocation::new().set_invocation_timing(Interval::default()/* use setters */);
13176 /// ```
13177 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
13178 where
13179 T: std::convert::Into<google_cloud_type::model::Interval>,
13180 {
13181 self.invocation_timing = std::option::Option::Some(v.into());
13182 self
13183 }
13184
13185 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
13186 ///
13187 /// # Example
13188 /// ```ignore,no_run
13189 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13190 /// use google_cloud_type::model::Interval;
13191 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
13192 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(None::<Interval>);
13193 /// ```
13194 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
13195 where
13196 T: std::convert::Into<google_cloud_type::model::Interval>,
13197 {
13198 self.invocation_timing = v.map(|x| x.into());
13199 self
13200 }
13201
13202 /// Sets the value of [resolved_compilation_result][crate::model::WorkflowInvocation::resolved_compilation_result].
13203 ///
13204 /// # Example
13205 /// ```ignore,no_run
13206 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13207 /// # let project_id = "project_id";
13208 /// # let location_id = "location_id";
13209 /// # let repository_id = "repository_id";
13210 /// # let compilation_result_id = "compilation_result_id";
13211 /// let x = WorkflowInvocation::new().set_resolved_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
13212 /// ```
13213 pub fn set_resolved_compilation_result<T: std::convert::Into<std::string::String>>(
13214 mut self,
13215 v: T,
13216 ) -> Self {
13217 self.resolved_compilation_result = v.into();
13218 self
13219 }
13220
13221 /// Sets the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
13222 ///
13223 /// # Example
13224 /// ```ignore,no_run
13225 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13226 /// use google_cloud_dataform_v1::model::DataEncryptionState;
13227 /// let x = WorkflowInvocation::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
13228 /// ```
13229 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
13230 where
13231 T: std::convert::Into<crate::model::DataEncryptionState>,
13232 {
13233 self.data_encryption_state = std::option::Option::Some(v.into());
13234 self
13235 }
13236
13237 /// Sets or clears the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
13238 ///
13239 /// # Example
13240 /// ```ignore,no_run
13241 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13242 /// use google_cloud_dataform_v1::model::DataEncryptionState;
13243 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
13244 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
13245 /// ```
13246 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
13247 where
13248 T: std::convert::Into<crate::model::DataEncryptionState>,
13249 {
13250 self.data_encryption_state = v.map(|x| x.into());
13251 self
13252 }
13253
13254 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
13255 ///
13256 /// # Example
13257 /// ```ignore,no_run
13258 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13259 /// let x = WorkflowInvocation::new().set_internal_metadata("example");
13260 /// ```
13261 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
13262 where
13263 T: std::convert::Into<std::string::String>,
13264 {
13265 self.internal_metadata = std::option::Option::Some(v.into());
13266 self
13267 }
13268
13269 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
13270 ///
13271 /// # Example
13272 /// ```ignore,no_run
13273 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13274 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(Some("example"));
13275 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(None::<String>);
13276 /// ```
13277 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13278 where
13279 T: std::convert::Into<std::string::String>,
13280 {
13281 self.internal_metadata = v.map(|x| x.into());
13282 self
13283 }
13284
13285 /// Sets the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
13286 ///
13287 /// # Example
13288 /// ```ignore,no_run
13289 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13290 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
13291 /// let x = WorkflowInvocation::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
13292 /// ```
13293 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
13294 where
13295 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
13296 {
13297 self.private_resource_metadata = std::option::Option::Some(v.into());
13298 self
13299 }
13300
13301 /// Sets or clears the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
13302 ///
13303 /// # Example
13304 /// ```ignore,no_run
13305 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13306 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
13307 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
13308 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
13309 /// ```
13310 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13311 where
13312 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
13313 {
13314 self.private_resource_metadata = v.map(|x| x.into());
13315 self
13316 }
13317
13318 /// Sets the value of [pipeline_config][crate::model::WorkflowInvocation::pipeline_config].
13319 ///
13320 /// # Example
13321 /// ```ignore,no_run
13322 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13323 /// use google_cloud_dataform_v1::model::PipelineConfig;
13324 /// let x = WorkflowInvocation::new().set_pipeline_config(PipelineConfig::default()/* use setters */);
13325 /// ```
13326 pub fn set_pipeline_config<T>(mut self, v: T) -> Self
13327 where
13328 T: std::convert::Into<crate::model::PipelineConfig>,
13329 {
13330 self.pipeline_config = std::option::Option::Some(v.into());
13331 self
13332 }
13333
13334 /// Sets or clears the value of [pipeline_config][crate::model::WorkflowInvocation::pipeline_config].
13335 ///
13336 /// # Example
13337 /// ```ignore,no_run
13338 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13339 /// use google_cloud_dataform_v1::model::PipelineConfig;
13340 /// let x = WorkflowInvocation::new().set_or_clear_pipeline_config(Some(PipelineConfig::default()/* use setters */));
13341 /// let x = WorkflowInvocation::new().set_or_clear_pipeline_config(None::<PipelineConfig>);
13342 /// ```
13343 pub fn set_or_clear_pipeline_config<T>(mut self, v: std::option::Option<T>) -> Self
13344 where
13345 T: std::convert::Into<crate::model::PipelineConfig>,
13346 {
13347 self.pipeline_config = v.map(|x| x.into());
13348 self
13349 }
13350
13351 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source].
13352 ///
13353 /// Note that all the setters affecting `compilation_source` are mutually
13354 /// exclusive.
13355 ///
13356 /// # Example
13357 /// ```ignore,no_run
13358 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13359 /// use google_cloud_dataform_v1::model::workflow_invocation::CompilationSource;
13360 /// let x = WorkflowInvocation::new().set_compilation_source(Some(CompilationSource::CompilationResult("example".to_string())));
13361 /// ```
13362 pub fn set_compilation_source<
13363 T: std::convert::Into<
13364 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
13365 >,
13366 >(
13367 mut self,
13368 v: T,
13369 ) -> Self {
13370 self.compilation_source = v.into();
13371 self
13372 }
13373
13374 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13375 /// if it holds a `CompilationResult`, `None` if the field is not set or
13376 /// holds a different branch.
13377 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
13378 #[allow(unreachable_patterns)]
13379 self.compilation_source.as_ref().and_then(|v| match v {
13380 crate::model::workflow_invocation::CompilationSource::CompilationResult(v) => {
13381 std::option::Option::Some(v)
13382 }
13383 _ => std::option::Option::None,
13384 })
13385 }
13386
13387 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13388 /// to hold a `CompilationResult`.
13389 ///
13390 /// Note that all the setters affecting `compilation_source` are
13391 /// mutually exclusive.
13392 ///
13393 /// # Example
13394 /// ```ignore,no_run
13395 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13396 /// # let project_id = "project_id";
13397 /// # let location_id = "location_id";
13398 /// # let repository_id = "repository_id";
13399 /// # let compilation_result_id = "compilation_result_id";
13400 /// let x = WorkflowInvocation::new().set_compilation_result(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/compilationResults/{compilation_result_id}"));
13401 /// assert!(x.compilation_result().is_some());
13402 /// assert!(x.workflow_config().is_none());
13403 /// ```
13404 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
13405 mut self,
13406 v: T,
13407 ) -> Self {
13408 self.compilation_source = std::option::Option::Some(
13409 crate::model::workflow_invocation::CompilationSource::CompilationResult(v.into()),
13410 );
13411 self
13412 }
13413
13414 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13415 /// if it holds a `WorkflowConfig`, `None` if the field is not set or
13416 /// holds a different branch.
13417 pub fn workflow_config(&self) -> std::option::Option<&std::string::String> {
13418 #[allow(unreachable_patterns)]
13419 self.compilation_source.as_ref().and_then(|v| match v {
13420 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v) => {
13421 std::option::Option::Some(v)
13422 }
13423 _ => std::option::Option::None,
13424 })
13425 }
13426
13427 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
13428 /// to hold a `WorkflowConfig`.
13429 ///
13430 /// Note that all the setters affecting `compilation_source` are
13431 /// mutually exclusive.
13432 ///
13433 /// # Example
13434 /// ```ignore,no_run
13435 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
13436 /// # let project_id = "project_id";
13437 /// # let location_id = "location_id";
13438 /// # let repository_id = "repository_id";
13439 /// # let workflow_config_id = "workflow_config_id";
13440 /// let x = WorkflowInvocation::new().set_workflow_config(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowConfigs/{workflow_config_id}"));
13441 /// assert!(x.workflow_config().is_some());
13442 /// assert!(x.compilation_result().is_none());
13443 /// ```
13444 pub fn set_workflow_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13445 self.compilation_source = std::option::Option::Some(
13446 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v.into()),
13447 );
13448 self
13449 }
13450}
13451
13452impl wkt::message::Message for WorkflowInvocation {
13453 fn typename() -> &'static str {
13454 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocation"
13455 }
13456}
13457
13458/// Defines additional types related to [WorkflowInvocation].
13459pub mod workflow_invocation {
13460 #[allow(unused_imports)]
13461 use super::*;
13462
13463 /// Represents the current state of a workflow invocation.
13464 ///
13465 /// # Working with unknown values
13466 ///
13467 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13468 /// additional enum variants at any time. Adding new variants is not considered
13469 /// a breaking change. Applications should write their code in anticipation of:
13470 ///
13471 /// - New values appearing in future releases of the client library, **and**
13472 /// - New values received dynamically, without application changes.
13473 ///
13474 /// Please consult the [Working with enums] section in the user guide for some
13475 /// guidelines.
13476 ///
13477 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13478 #[derive(Clone, Debug, PartialEq)]
13479 #[non_exhaustive]
13480 pub enum State {
13481 /// Default value. This value is unused.
13482 Unspecified,
13483 /// The workflow invocation is currently running.
13484 Running,
13485 /// The workflow invocation succeeded. A terminal state.
13486 Succeeded,
13487 /// The workflow invocation was cancelled. A terminal state.
13488 Cancelled,
13489 /// The workflow invocation failed. A terminal state.
13490 Failed,
13491 /// The workflow invocation is being cancelled, but some actions are still
13492 /// running.
13493 Canceling,
13494 /// If set, the enum was initialized with an unknown value.
13495 ///
13496 /// Applications can examine the value using [State::value] or
13497 /// [State::name].
13498 UnknownValue(state::UnknownValue),
13499 }
13500
13501 #[doc(hidden)]
13502 pub mod state {
13503 #[allow(unused_imports)]
13504 use super::*;
13505 #[derive(Clone, Debug, PartialEq)]
13506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13507 }
13508
13509 impl State {
13510 /// Gets the enum value.
13511 ///
13512 /// Returns `None` if the enum contains an unknown value deserialized from
13513 /// the string representation of enums.
13514 pub fn value(&self) -> std::option::Option<i32> {
13515 match self {
13516 Self::Unspecified => std::option::Option::Some(0),
13517 Self::Running => std::option::Option::Some(1),
13518 Self::Succeeded => std::option::Option::Some(2),
13519 Self::Cancelled => std::option::Option::Some(3),
13520 Self::Failed => std::option::Option::Some(4),
13521 Self::Canceling => std::option::Option::Some(5),
13522 Self::UnknownValue(u) => u.0.value(),
13523 }
13524 }
13525
13526 /// Gets the enum value as a string.
13527 ///
13528 /// Returns `None` if the enum contains an unknown value deserialized from
13529 /// the integer representation of enums.
13530 pub fn name(&self) -> std::option::Option<&str> {
13531 match self {
13532 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13533 Self::Running => std::option::Option::Some("RUNNING"),
13534 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13535 Self::Cancelled => std::option::Option::Some("CANCELLED"),
13536 Self::Failed => std::option::Option::Some("FAILED"),
13537 Self::Canceling => std::option::Option::Some("CANCELING"),
13538 Self::UnknownValue(u) => u.0.name(),
13539 }
13540 }
13541 }
13542
13543 impl std::default::Default for State {
13544 fn default() -> Self {
13545 use std::convert::From;
13546 Self::from(0)
13547 }
13548 }
13549
13550 impl std::fmt::Display for State {
13551 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13552 wkt::internal::display_enum(f, self.name(), self.value())
13553 }
13554 }
13555
13556 impl std::convert::From<i32> for State {
13557 fn from(value: i32) -> Self {
13558 match value {
13559 0 => Self::Unspecified,
13560 1 => Self::Running,
13561 2 => Self::Succeeded,
13562 3 => Self::Cancelled,
13563 4 => Self::Failed,
13564 5 => Self::Canceling,
13565 _ => Self::UnknownValue(state::UnknownValue(
13566 wkt::internal::UnknownEnumValue::Integer(value),
13567 )),
13568 }
13569 }
13570 }
13571
13572 impl std::convert::From<&str> for State {
13573 fn from(value: &str) -> Self {
13574 use std::string::ToString;
13575 match value {
13576 "STATE_UNSPECIFIED" => Self::Unspecified,
13577 "RUNNING" => Self::Running,
13578 "SUCCEEDED" => Self::Succeeded,
13579 "CANCELLED" => Self::Cancelled,
13580 "FAILED" => Self::Failed,
13581 "CANCELING" => Self::Canceling,
13582 _ => Self::UnknownValue(state::UnknownValue(
13583 wkt::internal::UnknownEnumValue::String(value.to_string()),
13584 )),
13585 }
13586 }
13587 }
13588
13589 impl serde::ser::Serialize for State {
13590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13591 where
13592 S: serde::Serializer,
13593 {
13594 match self {
13595 Self::Unspecified => serializer.serialize_i32(0),
13596 Self::Running => serializer.serialize_i32(1),
13597 Self::Succeeded => serializer.serialize_i32(2),
13598 Self::Cancelled => serializer.serialize_i32(3),
13599 Self::Failed => serializer.serialize_i32(4),
13600 Self::Canceling => serializer.serialize_i32(5),
13601 Self::UnknownValue(u) => u.0.serialize(serializer),
13602 }
13603 }
13604 }
13605
13606 impl<'de> serde::de::Deserialize<'de> for State {
13607 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13608 where
13609 D: serde::Deserializer<'de>,
13610 {
13611 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13612 ".google.cloud.dataform.v1.WorkflowInvocation.State",
13613 ))
13614 }
13615 }
13616
13617 /// The source of the compilation result to use for this invocation.
13618 #[derive(Clone, Debug, PartialEq)]
13619 #[non_exhaustive]
13620 pub enum CompilationSource {
13621 /// Immutable. The name of the compilation result to use for this invocation.
13622 /// Must be in the format
13623 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
13624 CompilationResult(std::string::String),
13625 /// Immutable. The name of the workflow config to invoke. Must be in the
13626 /// format `projects/*/locations/*/repositories/*/workflowConfigs/*`.
13627 WorkflowConfig(std::string::String),
13628 }
13629}
13630
13631/// `ListWorkflowInvocations` request message.
13632#[derive(Clone, Default, PartialEq)]
13633#[non_exhaustive]
13634pub struct ListWorkflowInvocationsRequest {
13635 /// Required. The parent resource of the WorkflowInvocation type. Must be in
13636 /// the format `projects/*/locations/*/repositories/*`.
13637 pub parent: std::string::String,
13638
13639 /// Optional. Maximum number of workflow invocations to return. The server may
13640 /// return fewer items than requested. If unspecified, the server will pick an
13641 /// appropriate default.
13642 pub page_size: i32,
13643
13644 /// Optional. Page token received from a previous `ListWorkflowInvocations`
13645 /// call. Provide this to retrieve the subsequent page.
13646 ///
13647 /// When paginating, all other parameters provided to
13648 /// `ListWorkflowInvocations`, with the exception of `page_size`, must match
13649 /// the call that provided the page token.
13650 pub page_token: std::string::String,
13651
13652 /// Optional. This field only supports ordering by `name`. If unspecified, the
13653 /// server will choose the ordering. If specified, the default order is
13654 /// ascending for the `name` field.
13655 pub order_by: std::string::String,
13656
13657 /// Optional. Filter for the returned list.
13658 pub filter: std::string::String,
13659
13660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13661}
13662
13663impl ListWorkflowInvocationsRequest {
13664 /// Creates a new default instance.
13665 pub fn new() -> Self {
13666 std::default::Default::default()
13667 }
13668
13669 /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
13670 ///
13671 /// # Example
13672 /// ```ignore,no_run
13673 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13674 /// # let project_id = "project_id";
13675 /// # let location_id = "location_id";
13676 /// # let repository_id = "repository_id";
13677 /// let x = ListWorkflowInvocationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
13678 /// ```
13679 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13680 self.parent = v.into();
13681 self
13682 }
13683
13684 /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
13685 ///
13686 /// # Example
13687 /// ```ignore,no_run
13688 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13689 /// let x = ListWorkflowInvocationsRequest::new().set_page_size(42);
13690 /// ```
13691 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13692 self.page_size = v.into();
13693 self
13694 }
13695
13696 /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
13697 ///
13698 /// # Example
13699 /// ```ignore,no_run
13700 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13701 /// let x = ListWorkflowInvocationsRequest::new().set_page_token("example");
13702 /// ```
13703 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13704 self.page_token = v.into();
13705 self
13706 }
13707
13708 /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
13709 ///
13710 /// # Example
13711 /// ```ignore,no_run
13712 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13713 /// let x = ListWorkflowInvocationsRequest::new().set_order_by("example");
13714 /// ```
13715 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13716 self.order_by = v.into();
13717 self
13718 }
13719
13720 /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
13721 ///
13722 /// # Example
13723 /// ```ignore,no_run
13724 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
13725 /// let x = ListWorkflowInvocationsRequest::new().set_filter("example");
13726 /// ```
13727 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13728 self.filter = v.into();
13729 self
13730 }
13731}
13732
13733impl wkt::message::Message for ListWorkflowInvocationsRequest {
13734 fn typename() -> &'static str {
13735 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsRequest"
13736 }
13737}
13738
13739/// `ListWorkflowInvocations` response message.
13740#[derive(Clone, Default, PartialEq)]
13741#[non_exhaustive]
13742pub struct ListWorkflowInvocationsResponse {
13743 /// List of workflow invocations.
13744 pub workflow_invocations: std::vec::Vec<crate::model::WorkflowInvocation>,
13745
13746 /// A token, which can be sent as `page_token` to retrieve the next page.
13747 /// If this field is omitted, there are no subsequent pages.
13748 pub next_page_token: std::string::String,
13749
13750 /// Locations which could not be reached.
13751 pub unreachable: std::vec::Vec<std::string::String>,
13752
13753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13754}
13755
13756impl ListWorkflowInvocationsResponse {
13757 /// Creates a new default instance.
13758 pub fn new() -> Self {
13759 std::default::Default::default()
13760 }
13761
13762 /// Sets the value of [workflow_invocations][crate::model::ListWorkflowInvocationsResponse::workflow_invocations].
13763 ///
13764 /// # Example
13765 /// ```ignore,no_run
13766 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13767 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13768 /// let x = ListWorkflowInvocationsResponse::new()
13769 /// .set_workflow_invocations([
13770 /// WorkflowInvocation::default()/* use setters */,
13771 /// WorkflowInvocation::default()/* use (different) setters */,
13772 /// ]);
13773 /// ```
13774 pub fn set_workflow_invocations<T, V>(mut self, v: T) -> Self
13775 where
13776 T: std::iter::IntoIterator<Item = V>,
13777 V: std::convert::Into<crate::model::WorkflowInvocation>,
13778 {
13779 use std::iter::Iterator;
13780 self.workflow_invocations = v.into_iter().map(|i| i.into()).collect();
13781 self
13782 }
13783
13784 /// Sets the value of [next_page_token][crate::model::ListWorkflowInvocationsResponse::next_page_token].
13785 ///
13786 /// # Example
13787 /// ```ignore,no_run
13788 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13789 /// let x = ListWorkflowInvocationsResponse::new().set_next_page_token("example");
13790 /// ```
13791 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13792 self.next_page_token = v.into();
13793 self
13794 }
13795
13796 /// Sets the value of [unreachable][crate::model::ListWorkflowInvocationsResponse::unreachable].
13797 ///
13798 /// # Example
13799 /// ```ignore,no_run
13800 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
13801 /// let x = ListWorkflowInvocationsResponse::new().set_unreachable(["a", "b", "c"]);
13802 /// ```
13803 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13804 where
13805 T: std::iter::IntoIterator<Item = V>,
13806 V: std::convert::Into<std::string::String>,
13807 {
13808 use std::iter::Iterator;
13809 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13810 self
13811 }
13812}
13813
13814impl wkt::message::Message for ListWorkflowInvocationsResponse {
13815 fn typename() -> &'static str {
13816 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsResponse"
13817 }
13818}
13819
13820#[doc(hidden)]
13821impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowInvocationsResponse {
13822 type PageItem = crate::model::WorkflowInvocation;
13823
13824 fn items(self) -> std::vec::Vec<Self::PageItem> {
13825 self.workflow_invocations
13826 }
13827
13828 fn next_page_token(&self) -> std::string::String {
13829 use std::clone::Clone;
13830 self.next_page_token.clone()
13831 }
13832}
13833
13834/// `GetWorkflowInvocation` request message.
13835#[derive(Clone, Default, PartialEq)]
13836#[non_exhaustive]
13837pub struct GetWorkflowInvocationRequest {
13838 /// Required. The workflow invocation resource's name.
13839 pub name: std::string::String,
13840
13841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13842}
13843
13844impl GetWorkflowInvocationRequest {
13845 /// Creates a new default instance.
13846 pub fn new() -> Self {
13847 std::default::Default::default()
13848 }
13849
13850 /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
13851 ///
13852 /// # Example
13853 /// ```ignore,no_run
13854 /// # use google_cloud_dataform_v1::model::GetWorkflowInvocationRequest;
13855 /// # let project_id = "project_id";
13856 /// # let location_id = "location_id";
13857 /// # let repository_id = "repository_id";
13858 /// # let workflow_invocation_id = "workflow_invocation_id";
13859 /// let x = GetWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13860 /// ```
13861 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13862 self.name = v.into();
13863 self
13864 }
13865}
13866
13867impl wkt::message::Message for GetWorkflowInvocationRequest {
13868 fn typename() -> &'static str {
13869 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowInvocationRequest"
13870 }
13871}
13872
13873/// `CreateWorkflowInvocation` request message.
13874#[derive(Clone, Default, PartialEq)]
13875#[non_exhaustive]
13876pub struct CreateWorkflowInvocationRequest {
13877 /// Required. The repository in which to create the workflow invocation. Must
13878 /// be in the format `projects/*/locations/*/repositories/*`.
13879 pub parent: std::string::String,
13880
13881 /// Required. The workflow invocation resource to create.
13882 pub workflow_invocation: std::option::Option<crate::model::WorkflowInvocation>,
13883
13884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13885}
13886
13887impl CreateWorkflowInvocationRequest {
13888 /// Creates a new default instance.
13889 pub fn new() -> Self {
13890 std::default::Default::default()
13891 }
13892
13893 /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
13894 ///
13895 /// # Example
13896 /// ```ignore,no_run
13897 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13898 /// # let project_id = "project_id";
13899 /// # let location_id = "location_id";
13900 /// # let repository_id = "repository_id";
13901 /// let x = CreateWorkflowInvocationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
13902 /// ```
13903 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13904 self.parent = v.into();
13905 self
13906 }
13907
13908 /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
13909 ///
13910 /// # Example
13911 /// ```ignore,no_run
13912 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13913 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13914 /// let x = CreateWorkflowInvocationRequest::new().set_workflow_invocation(WorkflowInvocation::default()/* use setters */);
13915 /// ```
13916 pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
13917 where
13918 T: std::convert::Into<crate::model::WorkflowInvocation>,
13919 {
13920 self.workflow_invocation = std::option::Option::Some(v.into());
13921 self
13922 }
13923
13924 /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
13925 ///
13926 /// # Example
13927 /// ```ignore,no_run
13928 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
13929 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
13930 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(Some(WorkflowInvocation::default()/* use setters */));
13931 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(None::<WorkflowInvocation>);
13932 /// ```
13933 pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
13934 where
13935 T: std::convert::Into<crate::model::WorkflowInvocation>,
13936 {
13937 self.workflow_invocation = v.map(|x| x.into());
13938 self
13939 }
13940}
13941
13942impl wkt::message::Message for CreateWorkflowInvocationRequest {
13943 fn typename() -> &'static str {
13944 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowInvocationRequest"
13945 }
13946}
13947
13948/// `DeleteWorkflowInvocation` request message.
13949#[derive(Clone, Default, PartialEq)]
13950#[non_exhaustive]
13951pub struct DeleteWorkflowInvocationRequest {
13952 /// Required. The workflow invocation resource's name.
13953 pub name: std::string::String,
13954
13955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13956}
13957
13958impl DeleteWorkflowInvocationRequest {
13959 /// Creates a new default instance.
13960 pub fn new() -> Self {
13961 std::default::Default::default()
13962 }
13963
13964 /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
13965 ///
13966 /// # Example
13967 /// ```ignore,no_run
13968 /// # use google_cloud_dataform_v1::model::DeleteWorkflowInvocationRequest;
13969 /// # let project_id = "project_id";
13970 /// # let location_id = "location_id";
13971 /// # let repository_id = "repository_id";
13972 /// # let workflow_invocation_id = "workflow_invocation_id";
13973 /// let x = DeleteWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
13974 /// ```
13975 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13976 self.name = v.into();
13977 self
13978 }
13979}
13980
13981impl wkt::message::Message for DeleteWorkflowInvocationRequest {
13982 fn typename() -> &'static str {
13983 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowInvocationRequest"
13984 }
13985}
13986
13987/// `CancelWorkflowInvocation` request message.
13988#[derive(Clone, Default, PartialEq)]
13989#[non_exhaustive]
13990pub struct CancelWorkflowInvocationRequest {
13991 /// Required. The workflow invocation resource's name.
13992 pub name: std::string::String,
13993
13994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13995}
13996
13997impl CancelWorkflowInvocationRequest {
13998 /// Creates a new default instance.
13999 pub fn new() -> Self {
14000 std::default::Default::default()
14001 }
14002
14003 /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_dataform_v1::model::CancelWorkflowInvocationRequest;
14008 /// # let project_id = "project_id";
14009 /// # let location_id = "location_id";
14010 /// # let repository_id = "repository_id";
14011 /// # let workflow_invocation_id = "workflow_invocation_id";
14012 /// let x = CancelWorkflowInvocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
14013 /// ```
14014 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14015 self.name = v.into();
14016 self
14017 }
14018}
14019
14020impl wkt::message::Message for CancelWorkflowInvocationRequest {
14021 fn typename() -> &'static str {
14022 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationRequest"
14023 }
14024}
14025
14026/// `CancelWorkflowInvocation` response message.
14027#[derive(Clone, Default, PartialEq)]
14028#[non_exhaustive]
14029pub struct CancelWorkflowInvocationResponse {
14030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14031}
14032
14033impl CancelWorkflowInvocationResponse {
14034 /// Creates a new default instance.
14035 pub fn new() -> Self {
14036 std::default::Default::default()
14037 }
14038}
14039
14040impl wkt::message::Message for CancelWorkflowInvocationResponse {
14041 fn typename() -> &'static str {
14042 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationResponse"
14043 }
14044}
14045
14046/// Represents a single action in a workflow invocation.
14047#[derive(Clone, Default, PartialEq)]
14048#[non_exhaustive]
14049pub struct WorkflowInvocationAction {
14050 /// Output only. This action's identifier. Unique within the workflow
14051 /// invocation.
14052 pub target: std::option::Option<crate::model::Target>,
14053
14054 /// Output only. The action's identifier if the project had been compiled
14055 /// without any overrides configured. Unique within the compilation result.
14056 pub canonical_target: std::option::Option<crate::model::Target>,
14057
14058 /// Output only. This action's current state.
14059 pub state: crate::model::workflow_invocation_action::State,
14060
14061 /// Output only. If and only if action's state is FAILED a failure reason is
14062 /// set.
14063 pub failure_reason: std::string::String,
14064
14065 /// Output only. This action's timing details.
14066 /// `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
14067 /// CANCELLED, FAILED] state.
14068 /// `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
14069 /// state.
14070 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
14071
14072 /// Output only. All the metadata information that is used internally to serve
14073 /// the resource. For example: timestamps, flags, status fields, etc. The
14074 /// format of this field is a JSON string.
14075 pub internal_metadata: std::option::Option<std::string::String>,
14076
14077 /// The action's details.
14078 pub action: std::option::Option<crate::model::workflow_invocation_action::Action>,
14079
14080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14081}
14082
14083impl WorkflowInvocationAction {
14084 /// Creates a new default instance.
14085 pub fn new() -> Self {
14086 std::default::Default::default()
14087 }
14088
14089 /// Sets the value of [target][crate::model::WorkflowInvocationAction::target].
14090 ///
14091 /// # Example
14092 /// ```ignore,no_run
14093 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14094 /// use google_cloud_dataform_v1::model::Target;
14095 /// let x = WorkflowInvocationAction::new().set_target(Target::default()/* use setters */);
14096 /// ```
14097 pub fn set_target<T>(mut self, v: T) -> Self
14098 where
14099 T: std::convert::Into<crate::model::Target>,
14100 {
14101 self.target = std::option::Option::Some(v.into());
14102 self
14103 }
14104
14105 /// Sets or clears the value of [target][crate::model::WorkflowInvocationAction::target].
14106 ///
14107 /// # Example
14108 /// ```ignore,no_run
14109 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14110 /// use google_cloud_dataform_v1::model::Target;
14111 /// let x = WorkflowInvocationAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
14112 /// let x = WorkflowInvocationAction::new().set_or_clear_target(None::<Target>);
14113 /// ```
14114 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
14115 where
14116 T: std::convert::Into<crate::model::Target>,
14117 {
14118 self.target = v.map(|x| x.into());
14119 self
14120 }
14121
14122 /// Sets the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
14123 ///
14124 /// # Example
14125 /// ```ignore,no_run
14126 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14127 /// use google_cloud_dataform_v1::model::Target;
14128 /// let x = WorkflowInvocationAction::new().set_canonical_target(Target::default()/* use setters */);
14129 /// ```
14130 pub fn set_canonical_target<T>(mut self, v: T) -> Self
14131 where
14132 T: std::convert::Into<crate::model::Target>,
14133 {
14134 self.canonical_target = std::option::Option::Some(v.into());
14135 self
14136 }
14137
14138 /// Sets or clears the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
14139 ///
14140 /// # Example
14141 /// ```ignore,no_run
14142 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14143 /// use google_cloud_dataform_v1::model::Target;
14144 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
14145 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(None::<Target>);
14146 /// ```
14147 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
14148 where
14149 T: std::convert::Into<crate::model::Target>,
14150 {
14151 self.canonical_target = v.map(|x| x.into());
14152 self
14153 }
14154
14155 /// Sets the value of [state][crate::model::WorkflowInvocationAction::state].
14156 ///
14157 /// # Example
14158 /// ```ignore,no_run
14159 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14160 /// use google_cloud_dataform_v1::model::workflow_invocation_action::State;
14161 /// let x0 = WorkflowInvocationAction::new().set_state(State::Running);
14162 /// let x1 = WorkflowInvocationAction::new().set_state(State::Skipped);
14163 /// let x2 = WorkflowInvocationAction::new().set_state(State::Disabled);
14164 /// ```
14165 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation_action::State>>(
14166 mut self,
14167 v: T,
14168 ) -> Self {
14169 self.state = v.into();
14170 self
14171 }
14172
14173 /// Sets the value of [failure_reason][crate::model::WorkflowInvocationAction::failure_reason].
14174 ///
14175 /// # Example
14176 /// ```ignore,no_run
14177 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14178 /// let x = WorkflowInvocationAction::new().set_failure_reason("example");
14179 /// ```
14180 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14181 self.failure_reason = v.into();
14182 self
14183 }
14184
14185 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
14186 ///
14187 /// # Example
14188 /// ```ignore,no_run
14189 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14190 /// use google_cloud_type::model::Interval;
14191 /// let x = WorkflowInvocationAction::new().set_invocation_timing(Interval::default()/* use setters */);
14192 /// ```
14193 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
14194 where
14195 T: std::convert::Into<google_cloud_type::model::Interval>,
14196 {
14197 self.invocation_timing = std::option::Option::Some(v.into());
14198 self
14199 }
14200
14201 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
14202 ///
14203 /// # Example
14204 /// ```ignore,no_run
14205 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14206 /// use google_cloud_type::model::Interval;
14207 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
14208 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(None::<Interval>);
14209 /// ```
14210 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
14211 where
14212 T: std::convert::Into<google_cloud_type::model::Interval>,
14213 {
14214 self.invocation_timing = v.map(|x| x.into());
14215 self
14216 }
14217
14218 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
14219 ///
14220 /// # Example
14221 /// ```ignore,no_run
14222 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14223 /// let x = WorkflowInvocationAction::new().set_internal_metadata("example");
14224 /// ```
14225 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
14226 where
14227 T: std::convert::Into<std::string::String>,
14228 {
14229 self.internal_metadata = std::option::Option::Some(v.into());
14230 self
14231 }
14232
14233 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
14234 ///
14235 /// # Example
14236 /// ```ignore,no_run
14237 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14238 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(Some("example"));
14239 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(None::<String>);
14240 /// ```
14241 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14242 where
14243 T: std::convert::Into<std::string::String>,
14244 {
14245 self.internal_metadata = v.map(|x| x.into());
14246 self
14247 }
14248
14249 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action].
14250 ///
14251 /// Note that all the setters affecting `action` are mutually
14252 /// exclusive.
14253 ///
14254 /// # Example
14255 /// ```ignore,no_run
14256 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14257 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14258 /// let x = WorkflowInvocationAction::new().set_action(Some(
14259 /// google_cloud_dataform_v1::model::workflow_invocation_action::Action::BigqueryAction(BigQueryAction::default().into())));
14260 /// ```
14261 pub fn set_action<
14262 T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::Action>>,
14263 >(
14264 mut self,
14265 v: T,
14266 ) -> Self {
14267 self.action = v.into();
14268 self
14269 }
14270
14271 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14272 /// if it holds a `BigqueryAction`, `None` if the field is not set or
14273 /// holds a different branch.
14274 pub fn bigquery_action(
14275 &self,
14276 ) -> std::option::Option<
14277 &std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
14278 > {
14279 #[allow(unreachable_patterns)]
14280 self.action.as_ref().and_then(|v| match v {
14281 crate::model::workflow_invocation_action::Action::BigqueryAction(v) => {
14282 std::option::Option::Some(v)
14283 }
14284 _ => std::option::Option::None,
14285 })
14286 }
14287
14288 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14289 /// to hold a `BigqueryAction`.
14290 ///
14291 /// Note that all the setters affecting `action` are
14292 /// mutually exclusive.
14293 ///
14294 /// # Example
14295 /// ```ignore,no_run
14296 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14297 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14298 /// let x = WorkflowInvocationAction::new().set_bigquery_action(BigQueryAction::default()/* use setters */);
14299 /// assert!(x.bigquery_action().is_some());
14300 /// assert!(x.notebook_action().is_none());
14301 /// assert!(x.data_preparation_action().is_none());
14302 /// ```
14303 pub fn set_bigquery_action<
14304 T: std::convert::Into<
14305 std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
14306 >,
14307 >(
14308 mut self,
14309 v: T,
14310 ) -> Self {
14311 self.action = std::option::Option::Some(
14312 crate::model::workflow_invocation_action::Action::BigqueryAction(v.into()),
14313 );
14314 self
14315 }
14316
14317 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14318 /// if it holds a `NotebookAction`, `None` if the field is not set or
14319 /// holds a different branch.
14320 pub fn notebook_action(
14321 &self,
14322 ) -> std::option::Option<
14323 &std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
14324 > {
14325 #[allow(unreachable_patterns)]
14326 self.action.as_ref().and_then(|v| match v {
14327 crate::model::workflow_invocation_action::Action::NotebookAction(v) => {
14328 std::option::Option::Some(v)
14329 }
14330 _ => std::option::Option::None,
14331 })
14332 }
14333
14334 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14335 /// to hold a `NotebookAction`.
14336 ///
14337 /// Note that all the setters affecting `action` are
14338 /// mutually exclusive.
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14343 /// use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14344 /// let x = WorkflowInvocationAction::new().set_notebook_action(NotebookAction::default()/* use setters */);
14345 /// assert!(x.notebook_action().is_some());
14346 /// assert!(x.bigquery_action().is_none());
14347 /// assert!(x.data_preparation_action().is_none());
14348 /// ```
14349 pub fn set_notebook_action<
14350 T: std::convert::Into<
14351 std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
14352 >,
14353 >(
14354 mut self,
14355 v: T,
14356 ) -> Self {
14357 self.action = std::option::Option::Some(
14358 crate::model::workflow_invocation_action::Action::NotebookAction(v.into()),
14359 );
14360 self
14361 }
14362
14363 /// The value of [action][crate::model::WorkflowInvocationAction::action]
14364 /// if it holds a `DataPreparationAction`, `None` if the field is not set or
14365 /// holds a different branch.
14366 pub fn data_preparation_action(
14367 &self,
14368 ) -> std::option::Option<
14369 &std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
14370 > {
14371 #[allow(unreachable_patterns)]
14372 self.action.as_ref().and_then(|v| match v {
14373 crate::model::workflow_invocation_action::Action::DataPreparationAction(v) => {
14374 std::option::Option::Some(v)
14375 }
14376 _ => std::option::Option::None,
14377 })
14378 }
14379
14380 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
14381 /// to hold a `DataPreparationAction`.
14382 ///
14383 /// Note that all the setters affecting `action` are
14384 /// mutually exclusive.
14385 ///
14386 /// # Example
14387 /// ```ignore,no_run
14388 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14389 /// use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14390 /// let x = WorkflowInvocationAction::new().set_data_preparation_action(DataPreparationAction::default()/* use setters */);
14391 /// assert!(x.data_preparation_action().is_some());
14392 /// assert!(x.bigquery_action().is_none());
14393 /// assert!(x.notebook_action().is_none());
14394 /// ```
14395 pub fn set_data_preparation_action<
14396 T: std::convert::Into<
14397 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
14398 >,
14399 >(
14400 mut self,
14401 v: T,
14402 ) -> Self {
14403 self.action = std::option::Option::Some(
14404 crate::model::workflow_invocation_action::Action::DataPreparationAction(v.into()),
14405 );
14406 self
14407 }
14408}
14409
14410impl wkt::message::Message for WorkflowInvocationAction {
14411 fn typename() -> &'static str {
14412 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction"
14413 }
14414}
14415
14416/// Defines additional types related to [WorkflowInvocationAction].
14417pub mod workflow_invocation_action {
14418 #[allow(unused_imports)]
14419 use super::*;
14420
14421 /// Represents a workflow action that will run against BigQuery.
14422 #[derive(Clone, Default, PartialEq)]
14423 #[non_exhaustive]
14424 pub struct BigQueryAction {
14425 /// Output only. The generated BigQuery SQL script that will be executed.
14426 pub sql_script: std::string::String,
14427
14428 /// Output only. The ID of the BigQuery job that executed the SQL in
14429 /// sql_script. Only set once the job has started to run.
14430 pub job_id: std::string::String,
14431
14432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14433 }
14434
14435 impl BigQueryAction {
14436 /// Creates a new default instance.
14437 pub fn new() -> Self {
14438 std::default::Default::default()
14439 }
14440
14441 /// Sets the value of [sql_script][crate::model::workflow_invocation_action::BigQueryAction::sql_script].
14442 ///
14443 /// # Example
14444 /// ```ignore,no_run
14445 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14446 /// let x = BigQueryAction::new().set_sql_script("example");
14447 /// ```
14448 pub fn set_sql_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14449 self.sql_script = v.into();
14450 self
14451 }
14452
14453 /// Sets the value of [job_id][crate::model::workflow_invocation_action::BigQueryAction::job_id].
14454 ///
14455 /// # Example
14456 /// ```ignore,no_run
14457 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
14458 /// let x = BigQueryAction::new().set_job_id("example");
14459 /// ```
14460 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14461 self.job_id = v.into();
14462 self
14463 }
14464 }
14465
14466 impl wkt::message::Message for BigQueryAction {
14467 fn typename() -> &'static str {
14468 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.BigQueryAction"
14469 }
14470 }
14471
14472 /// Represents a workflow action that will run against a Notebook runtime.
14473 #[derive(Clone, Default, PartialEq)]
14474 #[non_exhaustive]
14475 pub struct NotebookAction {
14476 /// Output only. The code contents of a Notebook to be run.
14477 pub contents: std::string::String,
14478
14479 /// Output only. The ID of the Gemini Enterprise Agent Platform job that
14480 /// executed the notebook in contents and also the ID used for the outputs
14481 /// created in Google Cloud Storage buckets. Only set once the job has
14482 /// started to run.
14483 pub job_id: std::string::String,
14484
14485 /// Output only. The path to the notebook file in the repository.
14486 pub file_path: std::string::String,
14487
14488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14489 }
14490
14491 impl NotebookAction {
14492 /// Creates a new default instance.
14493 pub fn new() -> Self {
14494 std::default::Default::default()
14495 }
14496
14497 /// Sets the value of [contents][crate::model::workflow_invocation_action::NotebookAction::contents].
14498 ///
14499 /// # Example
14500 /// ```ignore,no_run
14501 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14502 /// let x = NotebookAction::new().set_contents("example");
14503 /// ```
14504 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14505 self.contents = v.into();
14506 self
14507 }
14508
14509 /// Sets the value of [job_id][crate::model::workflow_invocation_action::NotebookAction::job_id].
14510 ///
14511 /// # Example
14512 /// ```ignore,no_run
14513 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14514 /// let x = NotebookAction::new().set_job_id("example");
14515 /// ```
14516 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14517 self.job_id = v.into();
14518 self
14519 }
14520
14521 /// Sets the value of [file_path][crate::model::workflow_invocation_action::NotebookAction::file_path].
14522 ///
14523 /// # Example
14524 /// ```ignore,no_run
14525 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
14526 /// let x = NotebookAction::new().set_file_path("example");
14527 /// ```
14528 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14529 self.file_path = v.into();
14530 self
14531 }
14532 }
14533
14534 impl wkt::message::Message for NotebookAction {
14535 fn typename() -> &'static str {
14536 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.NotebookAction"
14537 }
14538 }
14539
14540 /// Represents a workflow action that will run a Data Preparation.
14541 #[derive(Clone, Default, PartialEq)]
14542 #[non_exhaustive]
14543 pub struct DataPreparationAction {
14544 /// Output only. The generated BigQuery SQL script that will be executed. For
14545 /// reference only.
14546 pub generated_sql: std::string::String,
14547
14548 /// Output only. The ID of the BigQuery job that executed the SQL in
14549 /// sql_script. Only set once the job has started to run.
14550 pub job_id: std::string::String,
14551
14552 /// The definition for the data preparation.
14553 pub definition: std::option::Option<
14554 crate::model::workflow_invocation_action::data_preparation_action::Definition,
14555 >,
14556
14557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14558 }
14559
14560 impl DataPreparationAction {
14561 /// Creates a new default instance.
14562 pub fn new() -> Self {
14563 std::default::Default::default()
14564 }
14565
14566 /// Sets the value of [generated_sql][crate::model::workflow_invocation_action::DataPreparationAction::generated_sql].
14567 ///
14568 /// # Example
14569 /// ```ignore,no_run
14570 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14571 /// let x = DataPreparationAction::new().set_generated_sql("example");
14572 /// ```
14573 pub fn set_generated_sql<T: std::convert::Into<std::string::String>>(
14574 mut self,
14575 v: T,
14576 ) -> Self {
14577 self.generated_sql = v.into();
14578 self
14579 }
14580
14581 /// Sets the value of [job_id][crate::model::workflow_invocation_action::DataPreparationAction::job_id].
14582 ///
14583 /// # Example
14584 /// ```ignore,no_run
14585 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14586 /// let x = DataPreparationAction::new().set_job_id("example");
14587 /// ```
14588 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14589 self.job_id = v.into();
14590 self
14591 }
14592
14593 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition].
14594 ///
14595 /// Note that all the setters affecting `definition` are mutually
14596 /// exclusive.
14597 ///
14598 /// # Example
14599 /// ```ignore,no_run
14600 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14601 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::Definition;
14602 /// let x = DataPreparationAction::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
14603 /// ```
14604 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
14605{
14606 self.definition = v.into();
14607 self
14608 }
14609
14610 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14611 /// if it holds a `ContentsYaml`, `None` if the field is not set or
14612 /// holds a different branch.
14613 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
14614 #[allow(unreachable_patterns)]
14615 self.definition.as_ref().and_then(|v| match v {
14616 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(v) => std::option::Option::Some(v),
14617 _ => std::option::Option::None,
14618 })
14619 }
14620
14621 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14622 /// to hold a `ContentsYaml`.
14623 ///
14624 /// Note that all the setters affecting `definition` are
14625 /// mutually exclusive.
14626 ///
14627 /// # Example
14628 /// ```ignore,no_run
14629 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14630 /// let x = DataPreparationAction::new().set_contents_yaml("example");
14631 /// assert!(x.contents_yaml().is_some());
14632 /// assert!(x.contents_sql().is_none());
14633 /// ```
14634 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
14635 mut self,
14636 v: T,
14637 ) -> Self {
14638 self.definition = std::option::Option::Some(
14639 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(
14640 v.into()
14641 )
14642 );
14643 self
14644 }
14645
14646 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14647 /// if it holds a `ContentsSql`, `None` if the field is not set or
14648 /// holds a different branch.
14649 pub fn contents_sql(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>{
14650 #[allow(unreachable_patterns)]
14651 self.definition.as_ref().and_then(|v| match v {
14652 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(v) => std::option::Option::Some(v),
14653 _ => std::option::Option::None,
14654 })
14655 }
14656
14657 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
14658 /// to hold a `ContentsSql`.
14659 ///
14660 /// Note that all the setters affecting `definition` are
14661 /// mutually exclusive.
14662 ///
14663 /// # Example
14664 /// ```ignore,no_run
14665 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
14666 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14667 /// let x = DataPreparationAction::new().set_contents_sql(ActionSqlDefinition::default()/* use setters */);
14668 /// assert!(x.contents_sql().is_some());
14669 /// assert!(x.contents_yaml().is_none());
14670 /// ```
14671 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{
14672 self.definition = std::option::Option::Some(
14673 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(
14674 v.into()
14675 )
14676 );
14677 self
14678 }
14679 }
14680
14681 impl wkt::message::Message for DataPreparationAction {
14682 fn typename() -> &'static str {
14683 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction"
14684 }
14685 }
14686
14687 /// Defines additional types related to [DataPreparationAction].
14688 pub mod data_preparation_action {
14689 #[allow(unused_imports)]
14690 use super::*;
14691
14692 /// Definition of a SQL Data Preparation
14693 #[derive(Clone, Default, PartialEq)]
14694 #[non_exhaustive]
14695 pub struct ActionSqlDefinition {
14696 /// The SQL query representing the data preparation steps. Formatted as a
14697 /// Pipe SQL query statement.
14698 pub query: std::string::String,
14699
14700 /// Error table configuration,
14701 pub error_table: std::option::Option<
14702 crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable,
14703 >,
14704
14705 /// Load configuration.
14706 pub load_config: std::option::Option<
14707 crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig,
14708 >,
14709
14710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14711 }
14712
14713 impl ActionSqlDefinition {
14714 /// Creates a new default instance.
14715 pub fn new() -> Self {
14716 std::default::Default::default()
14717 }
14718
14719 /// Sets the value of [query][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::query].
14720 ///
14721 /// # Example
14722 /// ```ignore,no_run
14723 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14724 /// let x = ActionSqlDefinition::new().set_query("example");
14725 /// ```
14726 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14727 self.query = v.into();
14728 self
14729 }
14730
14731 /// Sets the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
14732 ///
14733 /// # Example
14734 /// ```ignore,no_run
14735 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14736 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14737 /// let x = ActionSqlDefinition::new().set_error_table(ActionErrorTable::default()/* use setters */);
14738 /// ```
14739 pub fn set_error_table<T>(mut self, v: T) -> Self
14740 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
14741{
14742 self.error_table = std::option::Option::Some(v.into());
14743 self
14744 }
14745
14746 /// Sets or clears the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
14747 ///
14748 /// # Example
14749 /// ```ignore,no_run
14750 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14751 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14752 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(Some(ActionErrorTable::default()/* use setters */));
14753 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(None::<ActionErrorTable>);
14754 /// ```
14755 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
14756 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
14757{
14758 self.error_table = v.map(|x| x.into());
14759 self
14760 }
14761
14762 /// Sets the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
14763 ///
14764 /// # Example
14765 /// ```ignore,no_run
14766 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14767 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14768 /// let x = ActionSqlDefinition::new().set_load_config(ActionLoadConfig::default()/* use setters */);
14769 /// ```
14770 pub fn set_load_config<T>(mut self, v: T) -> Self
14771 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
14772{
14773 self.load_config = std::option::Option::Some(v.into());
14774 self
14775 }
14776
14777 /// Sets or clears the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
14778 ///
14779 /// # Example
14780 /// ```ignore,no_run
14781 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
14782 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14783 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(Some(ActionLoadConfig::default()/* use setters */));
14784 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(None::<ActionLoadConfig>);
14785 /// ```
14786 pub fn set_or_clear_load_config<T>(mut self, v: std::option::Option<T>) -> Self
14787 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
14788{
14789 self.load_config = v.map(|x| x.into());
14790 self
14791 }
14792 }
14793
14794 impl wkt::message::Message for ActionSqlDefinition {
14795 fn typename() -> &'static str {
14796 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition"
14797 }
14798 }
14799
14800 /// Error table information, used to write error data into a BigQuery
14801 /// table.
14802 #[derive(Clone, Default, PartialEq)]
14803 #[non_exhaustive]
14804 pub struct ActionErrorTable {
14805 /// Error Table target.
14806 pub target: std::option::Option<crate::model::Target>,
14807
14808 /// Error table partition expiration in days. Only positive values are
14809 /// allowed.
14810 pub retention_days: i32,
14811
14812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14813 }
14814
14815 impl ActionErrorTable {
14816 /// Creates a new default instance.
14817 pub fn new() -> Self {
14818 std::default::Default::default()
14819 }
14820
14821 /// Sets the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
14822 ///
14823 /// # Example
14824 /// ```ignore,no_run
14825 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14826 /// use google_cloud_dataform_v1::model::Target;
14827 /// let x = ActionErrorTable::new().set_target(Target::default()/* use setters */);
14828 /// ```
14829 pub fn set_target<T>(mut self, v: T) -> Self
14830 where
14831 T: std::convert::Into<crate::model::Target>,
14832 {
14833 self.target = std::option::Option::Some(v.into());
14834 self
14835 }
14836
14837 /// Sets or clears the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
14838 ///
14839 /// # Example
14840 /// ```ignore,no_run
14841 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14842 /// use google_cloud_dataform_v1::model::Target;
14843 /// let x = ActionErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
14844 /// let x = ActionErrorTable::new().set_or_clear_target(None::<Target>);
14845 /// ```
14846 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
14847 where
14848 T: std::convert::Into<crate::model::Target>,
14849 {
14850 self.target = v.map(|x| x.into());
14851 self
14852 }
14853
14854 /// Sets the value of [retention_days][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::retention_days].
14855 ///
14856 /// # Example
14857 /// ```ignore,no_run
14858 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
14859 /// let x = ActionErrorTable::new().set_retention_days(42);
14860 /// ```
14861 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14862 self.retention_days = v.into();
14863 self
14864 }
14865 }
14866
14867 impl wkt::message::Message for ActionErrorTable {
14868 fn typename() -> &'static str {
14869 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable"
14870 }
14871 }
14872
14873 /// Simplified load configuration for actions
14874 #[derive(Clone, Default, PartialEq)]
14875 #[non_exhaustive]
14876 pub struct ActionLoadConfig {
14877
14878 /// Load mode
14879 pub mode: std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>,
14880
14881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14882 }
14883
14884 impl ActionLoadConfig {
14885 /// Creates a new default instance.
14886 pub fn new() -> Self {
14887 std::default::Default::default()
14888 }
14889
14890 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode].
14891 ///
14892 /// Note that all the setters affecting `mode` are mutually
14893 /// exclusive.
14894 ///
14895 /// # Example
14896 /// ```ignore,no_run
14897 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14898 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14899 /// let x = ActionLoadConfig::new().set_mode(Some(
14900 /// google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(ActionSimpleLoadMode::default().into())));
14901 /// ```
14902 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
14903{
14904 self.mode = v.into();
14905 self
14906 }
14907
14908 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14909 /// if it holds a `Replace`, `None` if the field is not set or
14910 /// holds a different branch.
14911 pub fn replace(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
14912 #[allow(unreachable_patterns)]
14913 self.mode.as_ref().and_then(|v| match v {
14914 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(v) => std::option::Option::Some(v),
14915 _ => std::option::Option::None,
14916 })
14917 }
14918
14919 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14920 /// to hold a `Replace`.
14921 ///
14922 /// Note that all the setters affecting `mode` are
14923 /// mutually exclusive.
14924 ///
14925 /// # Example
14926 /// ```ignore,no_run
14927 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14928 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14929 /// let x = ActionLoadConfig::new().set_replace(ActionSimpleLoadMode::default()/* use setters */);
14930 /// assert!(x.replace().is_some());
14931 /// assert!(x.append().is_none());
14932 /// assert!(x.maximum().is_none());
14933 /// assert!(x.unique().is_none());
14934 /// ```
14935 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{
14936 self.mode = std::option::Option::Some(
14937 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(
14938 v.into()
14939 )
14940 );
14941 self
14942 }
14943
14944 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14945 /// if it holds a `Append`, `None` if the field is not set or
14946 /// holds a different branch.
14947 pub fn append(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
14948 #[allow(unreachable_patterns)]
14949 self.mode.as_ref().and_then(|v| match v {
14950 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(v) => std::option::Option::Some(v),
14951 _ => std::option::Option::None,
14952 })
14953 }
14954
14955 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14956 /// to hold a `Append`.
14957 ///
14958 /// Note that all the setters affecting `mode` are
14959 /// mutually exclusive.
14960 ///
14961 /// # Example
14962 /// ```ignore,no_run
14963 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
14964 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
14965 /// let x = ActionLoadConfig::new().set_append(ActionSimpleLoadMode::default()/* use setters */);
14966 /// assert!(x.append().is_some());
14967 /// assert!(x.replace().is_none());
14968 /// assert!(x.maximum().is_none());
14969 /// assert!(x.unique().is_none());
14970 /// ```
14971 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{
14972 self.mode = std::option::Option::Some(
14973 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(
14974 v.into()
14975 )
14976 );
14977 self
14978 }
14979
14980 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14981 /// if it holds a `Maximum`, `None` if the field is not set or
14982 /// holds a different branch.
14983 pub fn maximum(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
14984 #[allow(unreachable_patterns)]
14985 self.mode.as_ref().and_then(|v| match v {
14986 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(v) => std::option::Option::Some(v),
14987 _ => std::option::Option::None,
14988 })
14989 }
14990
14991 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
14992 /// to hold a `Maximum`.
14993 ///
14994 /// Note that all the setters affecting `mode` are
14995 /// mutually exclusive.
14996 ///
14997 /// # Example
14998 /// ```ignore,no_run
14999 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
15000 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
15001 /// let x = ActionLoadConfig::new().set_maximum(ActionIncrementalLoadMode::default()/* use setters */);
15002 /// assert!(x.maximum().is_some());
15003 /// assert!(x.replace().is_none());
15004 /// assert!(x.append().is_none());
15005 /// assert!(x.unique().is_none());
15006 /// ```
15007 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{
15008 self.mode = std::option::Option::Some(
15009 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(
15010 v.into()
15011 )
15012 );
15013 self
15014 }
15015
15016 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
15017 /// if it holds a `Unique`, `None` if the field is not set or
15018 /// holds a different branch.
15019 pub fn unique(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
15020 #[allow(unreachable_patterns)]
15021 self.mode.as_ref().and_then(|v| match v {
15022 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(v) => std::option::Option::Some(v),
15023 _ => std::option::Option::None,
15024 })
15025 }
15026
15027 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
15028 /// to hold a `Unique`.
15029 ///
15030 /// Note that all the setters affecting `mode` are
15031 /// mutually exclusive.
15032 ///
15033 /// # Example
15034 /// ```ignore,no_run
15035 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
15036 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
15037 /// let x = ActionLoadConfig::new().set_unique(ActionIncrementalLoadMode::default()/* use setters */);
15038 /// assert!(x.unique().is_some());
15039 /// assert!(x.replace().is_none());
15040 /// assert!(x.append().is_none());
15041 /// assert!(x.maximum().is_none());
15042 /// ```
15043 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{
15044 self.mode = std::option::Option::Some(
15045 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(
15046 v.into()
15047 )
15048 );
15049 self
15050 }
15051 }
15052
15053 impl wkt::message::Message for ActionLoadConfig {
15054 fn typename() -> &'static str {
15055 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig"
15056 }
15057 }
15058
15059 /// Defines additional types related to [ActionLoadConfig].
15060 pub mod action_load_config {
15061 #[allow(unused_imports)]
15062 use super::*;
15063
15064 /// Load mode
15065 #[derive(Clone, Debug, PartialEq)]
15066 #[non_exhaustive]
15067 pub enum Mode {
15068 /// Replace destination table
15069 Replace(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
15070 /// Append into destination table
15071 Append(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
15072 /// Insert records where the value exceeds the previous maximum value for
15073 /// a column in the destination table
15074 Maximum(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
15075 /// Insert records where the value of a column is not already present in
15076 /// the destination table
15077 Unique(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
15078 }
15079 }
15080
15081 /// Simple load definition
15082 #[derive(Clone, Default, PartialEq)]
15083 #[non_exhaustive]
15084 pub struct ActionSimpleLoadMode {
15085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15086 }
15087
15088 impl ActionSimpleLoadMode {
15089 /// Creates a new default instance.
15090 pub fn new() -> Self {
15091 std::default::Default::default()
15092 }
15093 }
15094
15095 impl wkt::message::Message for ActionSimpleLoadMode {
15096 fn typename() -> &'static str {
15097 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode"
15098 }
15099 }
15100
15101 /// Load definition for incremental load modes
15102 #[derive(Clone, Default, PartialEq)]
15103 #[non_exhaustive]
15104 pub struct ActionIncrementalLoadMode {
15105 /// Column name for incremental load modes
15106 pub column: std::string::String,
15107
15108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15109 }
15110
15111 impl ActionIncrementalLoadMode {
15112 /// Creates a new default instance.
15113 pub fn new() -> Self {
15114 std::default::Default::default()
15115 }
15116
15117 /// Sets the value of [column][crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode::column].
15118 ///
15119 /// # Example
15120 /// ```ignore,no_run
15121 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
15122 /// let x = ActionIncrementalLoadMode::new().set_column("example");
15123 /// ```
15124 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15125 self.column = v.into();
15126 self
15127 }
15128 }
15129
15130 impl wkt::message::Message for ActionIncrementalLoadMode {
15131 fn typename() -> &'static str {
15132 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode"
15133 }
15134 }
15135
15136 /// The definition for the data preparation.
15137 #[derive(Clone, Debug, PartialEq)]
15138 #[non_exhaustive]
15139 pub enum Definition {
15140 /// Output only. YAML representing the contents of the data preparation.
15141 /// Can be used to show the customer what the input was to their workflow.
15142 ContentsYaml(std::string::String),
15143 /// SQL definition for a Data Preparation. Contains a SQL query and
15144 /// additional context information.
15145 ContentsSql(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>),
15146 }
15147 }
15148
15149 /// Represents the current state of a workflow invocation action.
15150 ///
15151 /// # Working with unknown values
15152 ///
15153 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15154 /// additional enum variants at any time. Adding new variants is not considered
15155 /// a breaking change. Applications should write their code in anticipation of:
15156 ///
15157 /// - New values appearing in future releases of the client library, **and**
15158 /// - New values received dynamically, without application changes.
15159 ///
15160 /// Please consult the [Working with enums] section in the user guide for some
15161 /// guidelines.
15162 ///
15163 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15164 #[derive(Clone, Debug, PartialEq)]
15165 #[non_exhaustive]
15166 pub enum State {
15167 /// The action has not yet been considered for invocation.
15168 Pending,
15169 /// The action is currently running.
15170 Running,
15171 /// Execution of the action was skipped because upstream dependencies did not
15172 /// all complete successfully. A terminal state.
15173 Skipped,
15174 /// Execution of the action was disabled as per the configuration of the
15175 /// corresponding compilation result action. A terminal state.
15176 Disabled,
15177 /// The action succeeded. A terminal state.
15178 Succeeded,
15179 /// The action was cancelled. A terminal state.
15180 Cancelled,
15181 /// The action failed. A terminal state.
15182 Failed,
15183 /// If set, the enum was initialized with an unknown value.
15184 ///
15185 /// Applications can examine the value using [State::value] or
15186 /// [State::name].
15187 UnknownValue(state::UnknownValue),
15188 }
15189
15190 #[doc(hidden)]
15191 pub mod state {
15192 #[allow(unused_imports)]
15193 use super::*;
15194 #[derive(Clone, Debug, PartialEq)]
15195 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15196 }
15197
15198 impl State {
15199 /// Gets the enum value.
15200 ///
15201 /// Returns `None` if the enum contains an unknown value deserialized from
15202 /// the string representation of enums.
15203 pub fn value(&self) -> std::option::Option<i32> {
15204 match self {
15205 Self::Pending => std::option::Option::Some(0),
15206 Self::Running => std::option::Option::Some(1),
15207 Self::Skipped => std::option::Option::Some(2),
15208 Self::Disabled => std::option::Option::Some(3),
15209 Self::Succeeded => std::option::Option::Some(4),
15210 Self::Cancelled => std::option::Option::Some(5),
15211 Self::Failed => std::option::Option::Some(6),
15212 Self::UnknownValue(u) => u.0.value(),
15213 }
15214 }
15215
15216 /// Gets the enum value as a string.
15217 ///
15218 /// Returns `None` if the enum contains an unknown value deserialized from
15219 /// the integer representation of enums.
15220 pub fn name(&self) -> std::option::Option<&str> {
15221 match self {
15222 Self::Pending => std::option::Option::Some("PENDING"),
15223 Self::Running => std::option::Option::Some("RUNNING"),
15224 Self::Skipped => std::option::Option::Some("SKIPPED"),
15225 Self::Disabled => std::option::Option::Some("DISABLED"),
15226 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
15227 Self::Cancelled => std::option::Option::Some("CANCELLED"),
15228 Self::Failed => std::option::Option::Some("FAILED"),
15229 Self::UnknownValue(u) => u.0.name(),
15230 }
15231 }
15232 }
15233
15234 impl std::default::Default for State {
15235 fn default() -> Self {
15236 use std::convert::From;
15237 Self::from(0)
15238 }
15239 }
15240
15241 impl std::fmt::Display for State {
15242 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15243 wkt::internal::display_enum(f, self.name(), self.value())
15244 }
15245 }
15246
15247 impl std::convert::From<i32> for State {
15248 fn from(value: i32) -> Self {
15249 match value {
15250 0 => Self::Pending,
15251 1 => Self::Running,
15252 2 => Self::Skipped,
15253 3 => Self::Disabled,
15254 4 => Self::Succeeded,
15255 5 => Self::Cancelled,
15256 6 => Self::Failed,
15257 _ => Self::UnknownValue(state::UnknownValue(
15258 wkt::internal::UnknownEnumValue::Integer(value),
15259 )),
15260 }
15261 }
15262 }
15263
15264 impl std::convert::From<&str> for State {
15265 fn from(value: &str) -> Self {
15266 use std::string::ToString;
15267 match value {
15268 "PENDING" => Self::Pending,
15269 "RUNNING" => Self::Running,
15270 "SKIPPED" => Self::Skipped,
15271 "DISABLED" => Self::Disabled,
15272 "SUCCEEDED" => Self::Succeeded,
15273 "CANCELLED" => Self::Cancelled,
15274 "FAILED" => Self::Failed,
15275 _ => Self::UnknownValue(state::UnknownValue(
15276 wkt::internal::UnknownEnumValue::String(value.to_string()),
15277 )),
15278 }
15279 }
15280 }
15281
15282 impl serde::ser::Serialize for State {
15283 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15284 where
15285 S: serde::Serializer,
15286 {
15287 match self {
15288 Self::Pending => serializer.serialize_i32(0),
15289 Self::Running => serializer.serialize_i32(1),
15290 Self::Skipped => serializer.serialize_i32(2),
15291 Self::Disabled => serializer.serialize_i32(3),
15292 Self::Succeeded => serializer.serialize_i32(4),
15293 Self::Cancelled => serializer.serialize_i32(5),
15294 Self::Failed => serializer.serialize_i32(6),
15295 Self::UnknownValue(u) => u.0.serialize(serializer),
15296 }
15297 }
15298 }
15299
15300 impl<'de> serde::de::Deserialize<'de> for State {
15301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15302 where
15303 D: serde::Deserializer<'de>,
15304 {
15305 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15306 ".google.cloud.dataform.v1.WorkflowInvocationAction.State",
15307 ))
15308 }
15309 }
15310
15311 /// The action's details.
15312 #[derive(Clone, Debug, PartialEq)]
15313 #[non_exhaustive]
15314 pub enum Action {
15315 /// Output only. The workflow action's bigquery action details.
15316 BigqueryAction(std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>),
15317 /// Output only. The workflow action's notebook action details.
15318 NotebookAction(std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>),
15319 /// Output only. The workflow action's data preparation action details.
15320 DataPreparationAction(
15321 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
15322 ),
15323 }
15324}
15325
15326/// `QueryWorkflowInvocationActions` request message.
15327#[derive(Clone, Default, PartialEq)]
15328#[non_exhaustive]
15329pub struct QueryWorkflowInvocationActionsRequest {
15330 /// Required. The workflow invocation's name.
15331 pub name: std::string::String,
15332
15333 /// Optional. Maximum number of workflow invocations to return. The server may
15334 /// return fewer items than requested. If unspecified, the server will pick an
15335 /// appropriate default.
15336 pub page_size: i32,
15337
15338 /// Optional. Page token received from a previous
15339 /// `QueryWorkflowInvocationActions` call. Provide this to retrieve the
15340 /// subsequent page.
15341 ///
15342 /// When paginating, all other parameters provided to
15343 /// `QueryWorkflowInvocationActions`, with the exception of `page_size`, must
15344 /// match the call that provided the page token.
15345 pub page_token: std::string::String,
15346
15347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15348}
15349
15350impl QueryWorkflowInvocationActionsRequest {
15351 /// Creates a new default instance.
15352 pub fn new() -> Self {
15353 std::default::Default::default()
15354 }
15355
15356 /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
15357 ///
15358 /// # Example
15359 /// ```ignore,no_run
15360 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15361 /// # let project_id = "project_id";
15362 /// # let location_id = "location_id";
15363 /// # let repository_id = "repository_id";
15364 /// # let workflow_invocation_id = "workflow_invocation_id";
15365 /// let x = QueryWorkflowInvocationActionsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/workflowInvocations/{workflow_invocation_id}"));
15366 /// ```
15367 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15368 self.name = v.into();
15369 self
15370 }
15371
15372 /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
15373 ///
15374 /// # Example
15375 /// ```ignore,no_run
15376 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15377 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_size(42);
15378 /// ```
15379 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15380 self.page_size = v.into();
15381 self
15382 }
15383
15384 /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
15385 ///
15386 /// # Example
15387 /// ```ignore,no_run
15388 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
15389 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_token("example");
15390 /// ```
15391 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15392 self.page_token = v.into();
15393 self
15394 }
15395}
15396
15397impl wkt::message::Message for QueryWorkflowInvocationActionsRequest {
15398 fn typename() -> &'static str {
15399 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsRequest"
15400 }
15401}
15402
15403/// `QueryWorkflowInvocationActions` response message.
15404#[derive(Clone, Default, PartialEq)]
15405#[non_exhaustive]
15406pub struct QueryWorkflowInvocationActionsResponse {
15407 /// List of workflow invocation actions.
15408 pub workflow_invocation_actions: std::vec::Vec<crate::model::WorkflowInvocationAction>,
15409
15410 /// A token, which can be sent as `page_token` to retrieve the next page.
15411 /// If this field is omitted, there are no subsequent pages.
15412 pub next_page_token: std::string::String,
15413
15414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15415}
15416
15417impl QueryWorkflowInvocationActionsResponse {
15418 /// Creates a new default instance.
15419 pub fn new() -> Self {
15420 std::default::Default::default()
15421 }
15422
15423 /// Sets the value of [workflow_invocation_actions][crate::model::QueryWorkflowInvocationActionsResponse::workflow_invocation_actions].
15424 ///
15425 /// # Example
15426 /// ```ignore,no_run
15427 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
15428 /// use google_cloud_dataform_v1::model::WorkflowInvocationAction;
15429 /// let x = QueryWorkflowInvocationActionsResponse::new()
15430 /// .set_workflow_invocation_actions([
15431 /// WorkflowInvocationAction::default()/* use setters */,
15432 /// WorkflowInvocationAction::default()/* use (different) setters */,
15433 /// ]);
15434 /// ```
15435 pub fn set_workflow_invocation_actions<T, V>(mut self, v: T) -> Self
15436 where
15437 T: std::iter::IntoIterator<Item = V>,
15438 V: std::convert::Into<crate::model::WorkflowInvocationAction>,
15439 {
15440 use std::iter::Iterator;
15441 self.workflow_invocation_actions = v.into_iter().map(|i| i.into()).collect();
15442 self
15443 }
15444
15445 /// Sets the value of [next_page_token][crate::model::QueryWorkflowInvocationActionsResponse::next_page_token].
15446 ///
15447 /// # Example
15448 /// ```ignore,no_run
15449 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
15450 /// let x = QueryWorkflowInvocationActionsResponse::new().set_next_page_token("example");
15451 /// ```
15452 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15453 self.next_page_token = v.into();
15454 self
15455 }
15456}
15457
15458impl wkt::message::Message for QueryWorkflowInvocationActionsResponse {
15459 fn typename() -> &'static str {
15460 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsResponse"
15461 }
15462}
15463
15464#[doc(hidden)]
15465impl google_cloud_gax::paginator::internal::PageableResponse
15466 for QueryWorkflowInvocationActionsResponse
15467{
15468 type PageItem = crate::model::WorkflowInvocationAction;
15469
15470 fn items(self) -> std::vec::Vec<Self::PageItem> {
15471 self.workflow_invocation_actions
15472 }
15473
15474 fn next_page_token(&self) -> std::string::String {
15475 use std::clone::Clone;
15476 self.next_page_token.clone()
15477 }
15478}
15479
15480/// Config for all repositories in a given project and location.
15481#[derive(Clone, Default, PartialEq)]
15482#[non_exhaustive]
15483pub struct Config {
15484 /// Identifier. The config name.
15485 pub name: std::string::String,
15486
15487 /// Optional. The default KMS key that is used if no encryption key is provided
15488 /// when a repository is created.
15489 pub default_kms_key_name: std::string::String,
15490
15491 /// Output only. All the metadata information that is used internally to serve
15492 /// the resource. For example: timestamps, flags, status fields, etc. The
15493 /// format of this field is a JSON string.
15494 pub internal_metadata: std::option::Option<std::string::String>,
15495
15496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15497}
15498
15499impl Config {
15500 /// Creates a new default instance.
15501 pub fn new() -> Self {
15502 std::default::Default::default()
15503 }
15504
15505 /// Sets the value of [name][crate::model::Config::name].
15506 ///
15507 /// # Example
15508 /// ```ignore,no_run
15509 /// # use google_cloud_dataform_v1::model::Config;
15510 /// # let project_id = "project_id";
15511 /// # let location_id = "location_id";
15512 /// let x = Config::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
15513 /// ```
15514 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15515 self.name = v.into();
15516 self
15517 }
15518
15519 /// Sets the value of [default_kms_key_name][crate::model::Config::default_kms_key_name].
15520 ///
15521 /// # Example
15522 /// ```ignore,no_run
15523 /// # use google_cloud_dataform_v1::model::Config;
15524 /// let x = Config::new().set_default_kms_key_name("example");
15525 /// ```
15526 pub fn set_default_kms_key_name<T: std::convert::Into<std::string::String>>(
15527 mut self,
15528 v: T,
15529 ) -> Self {
15530 self.default_kms_key_name = v.into();
15531 self
15532 }
15533
15534 /// Sets the value of [internal_metadata][crate::model::Config::internal_metadata].
15535 ///
15536 /// # Example
15537 /// ```ignore,no_run
15538 /// # use google_cloud_dataform_v1::model::Config;
15539 /// let x = Config::new().set_internal_metadata("example");
15540 /// ```
15541 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
15542 where
15543 T: std::convert::Into<std::string::String>,
15544 {
15545 self.internal_metadata = std::option::Option::Some(v.into());
15546 self
15547 }
15548
15549 /// Sets or clears the value of [internal_metadata][crate::model::Config::internal_metadata].
15550 ///
15551 /// # Example
15552 /// ```ignore,no_run
15553 /// # use google_cloud_dataform_v1::model::Config;
15554 /// let x = Config::new().set_or_clear_internal_metadata(Some("example"));
15555 /// let x = Config::new().set_or_clear_internal_metadata(None::<String>);
15556 /// ```
15557 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15558 where
15559 T: std::convert::Into<std::string::String>,
15560 {
15561 self.internal_metadata = v.map(|x| x.into());
15562 self
15563 }
15564}
15565
15566impl wkt::message::Message for Config {
15567 fn typename() -> &'static str {
15568 "type.googleapis.com/google.cloud.dataform.v1.Config"
15569 }
15570}
15571
15572/// `GetConfig` request message.
15573#[derive(Clone, Default, PartialEq)]
15574#[non_exhaustive]
15575pub struct GetConfigRequest {
15576 /// Required. The config name.
15577 pub name: std::string::String,
15578
15579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15580}
15581
15582impl GetConfigRequest {
15583 /// Creates a new default instance.
15584 pub fn new() -> Self {
15585 std::default::Default::default()
15586 }
15587
15588 /// Sets the value of [name][crate::model::GetConfigRequest::name].
15589 ///
15590 /// # Example
15591 /// ```ignore,no_run
15592 /// # use google_cloud_dataform_v1::model::GetConfigRequest;
15593 /// # let project_id = "project_id";
15594 /// # let location_id = "location_id";
15595 /// let x = GetConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
15596 /// ```
15597 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15598 self.name = v.into();
15599 self
15600 }
15601}
15602
15603impl wkt::message::Message for GetConfigRequest {
15604 fn typename() -> &'static str {
15605 "type.googleapis.com/google.cloud.dataform.v1.GetConfigRequest"
15606 }
15607}
15608
15609/// `UpdateConfig` request message.
15610#[derive(Clone, Default, PartialEq)]
15611#[non_exhaustive]
15612pub struct UpdateConfigRequest {
15613 /// Required. The config to update.
15614 pub config: std::option::Option<crate::model::Config>,
15615
15616 /// Optional. Specifies the fields to be updated in the config.
15617 pub update_mask: std::option::Option<wkt::FieldMask>,
15618
15619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15620}
15621
15622impl UpdateConfigRequest {
15623 /// Creates a new default instance.
15624 pub fn new() -> Self {
15625 std::default::Default::default()
15626 }
15627
15628 /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
15629 ///
15630 /// # Example
15631 /// ```ignore,no_run
15632 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15633 /// use google_cloud_dataform_v1::model::Config;
15634 /// let x = UpdateConfigRequest::new().set_config(Config::default()/* use setters */);
15635 /// ```
15636 pub fn set_config<T>(mut self, v: T) -> Self
15637 where
15638 T: std::convert::Into<crate::model::Config>,
15639 {
15640 self.config = std::option::Option::Some(v.into());
15641 self
15642 }
15643
15644 /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
15645 ///
15646 /// # Example
15647 /// ```ignore,no_run
15648 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15649 /// use google_cloud_dataform_v1::model::Config;
15650 /// let x = UpdateConfigRequest::new().set_or_clear_config(Some(Config::default()/* use setters */));
15651 /// let x = UpdateConfigRequest::new().set_or_clear_config(None::<Config>);
15652 /// ```
15653 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
15654 where
15655 T: std::convert::Into<crate::model::Config>,
15656 {
15657 self.config = v.map(|x| x.into());
15658 self
15659 }
15660
15661 /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
15662 ///
15663 /// # Example
15664 /// ```ignore,no_run
15665 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15666 /// use wkt::FieldMask;
15667 /// let x = UpdateConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15668 /// ```
15669 pub fn set_update_mask<T>(mut self, v: T) -> Self
15670 where
15671 T: std::convert::Into<wkt::FieldMask>,
15672 {
15673 self.update_mask = std::option::Option::Some(v.into());
15674 self
15675 }
15676
15677 /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
15678 ///
15679 /// # Example
15680 /// ```ignore,no_run
15681 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
15682 /// use wkt::FieldMask;
15683 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15684 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15685 /// ```
15686 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15687 where
15688 T: std::convert::Into<wkt::FieldMask>,
15689 {
15690 self.update_mask = v.map(|x| x.into());
15691 self
15692 }
15693}
15694
15695impl wkt::message::Message for UpdateConfigRequest {
15696 fn typename() -> &'static str {
15697 "type.googleapis.com/google.cloud.dataform.v1.UpdateConfigRequest"
15698 }
15699}
15700
15701/// Represents a Dataform Folder. This is a resource that is used to organize
15702/// Files and other Folders and provide hierarchical access controls.
15703#[derive(Clone, Default, PartialEq)]
15704#[non_exhaustive]
15705pub struct Folder {
15706 /// Identifier. The Folder's name.
15707 pub name: std::string::String,
15708
15709 /// Required. The Folder's user-friendly name.
15710 pub display_name: std::string::String,
15711
15712 /// Optional. The containing Folder resource name. This should take
15713 /// the format: projects/{project}/locations/{location}/folders/{folder},
15714 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}, or just
15715 /// "" if this is a root Folder. This field can only be updated through
15716 /// MoveFolder.
15717 pub containing_folder: std::string::String,
15718
15719 /// Output only. The resource name of the TeamFolder that this Folder is
15720 /// associated with. This should take the format:
15721 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this
15722 /// is not set, the Folder is not associated with a TeamFolder and is a
15723 /// UserFolder.
15724 pub team_folder_name: std::string::String,
15725
15726 /// Output only. The timestamp of when the Folder was created.
15727 pub create_time: std::option::Option<wkt::Timestamp>,
15728
15729 /// Output only. The timestamp of when the Folder was last updated.
15730 pub update_time: std::option::Option<wkt::Timestamp>,
15731
15732 /// Output only. All the metadata information that is used internally to serve
15733 /// the resource. For example: timestamps, flags, status fields, etc. The
15734 /// format of this field is a JSON string.
15735 pub internal_metadata: std::option::Option<std::string::String>,
15736
15737 /// Output only. The IAM principal identifier of the creator of the Folder.
15738 pub creator_iam_principal: std::option::Option<std::string::String>,
15739
15740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15741}
15742
15743impl Folder {
15744 /// Creates a new default instance.
15745 pub fn new() -> Self {
15746 std::default::Default::default()
15747 }
15748
15749 /// Sets the value of [name][crate::model::Folder::name].
15750 ///
15751 /// # Example
15752 /// ```ignore,no_run
15753 /// # use google_cloud_dataform_v1::model::Folder;
15754 /// # let project_id = "project_id";
15755 /// # let location_id = "location_id";
15756 /// # let folder_id = "folder_id";
15757 /// let x = Folder::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
15758 /// ```
15759 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15760 self.name = v.into();
15761 self
15762 }
15763
15764 /// Sets the value of [display_name][crate::model::Folder::display_name].
15765 ///
15766 /// # Example
15767 /// ```ignore,no_run
15768 /// # use google_cloud_dataform_v1::model::Folder;
15769 /// let x = Folder::new().set_display_name("example");
15770 /// ```
15771 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15772 self.display_name = v.into();
15773 self
15774 }
15775
15776 /// Sets the value of [containing_folder][crate::model::Folder::containing_folder].
15777 ///
15778 /// # Example
15779 /// ```ignore,no_run
15780 /// # use google_cloud_dataform_v1::model::Folder;
15781 /// let x = Folder::new().set_containing_folder("example");
15782 /// ```
15783 pub fn set_containing_folder<T: std::convert::Into<std::string::String>>(
15784 mut self,
15785 v: T,
15786 ) -> Self {
15787 self.containing_folder = v.into();
15788 self
15789 }
15790
15791 /// Sets the value of [team_folder_name][crate::model::Folder::team_folder_name].
15792 ///
15793 /// # Example
15794 /// ```ignore,no_run
15795 /// # use google_cloud_dataform_v1::model::Folder;
15796 /// let x = Folder::new().set_team_folder_name("example");
15797 /// ```
15798 pub fn set_team_folder_name<T: std::convert::Into<std::string::String>>(
15799 mut self,
15800 v: T,
15801 ) -> Self {
15802 self.team_folder_name = v.into();
15803 self
15804 }
15805
15806 /// Sets the value of [create_time][crate::model::Folder::create_time].
15807 ///
15808 /// # Example
15809 /// ```ignore,no_run
15810 /// # use google_cloud_dataform_v1::model::Folder;
15811 /// use wkt::Timestamp;
15812 /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
15813 /// ```
15814 pub fn set_create_time<T>(mut self, v: T) -> Self
15815 where
15816 T: std::convert::Into<wkt::Timestamp>,
15817 {
15818 self.create_time = std::option::Option::Some(v.into());
15819 self
15820 }
15821
15822 /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
15823 ///
15824 /// # Example
15825 /// ```ignore,no_run
15826 /// # use google_cloud_dataform_v1::model::Folder;
15827 /// use wkt::Timestamp;
15828 /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15829 /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
15830 /// ```
15831 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15832 where
15833 T: std::convert::Into<wkt::Timestamp>,
15834 {
15835 self.create_time = v.map(|x| x.into());
15836 self
15837 }
15838
15839 /// Sets the value of [update_time][crate::model::Folder::update_time].
15840 ///
15841 /// # Example
15842 /// ```ignore,no_run
15843 /// # use google_cloud_dataform_v1::model::Folder;
15844 /// use wkt::Timestamp;
15845 /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
15846 /// ```
15847 pub fn set_update_time<T>(mut self, v: T) -> Self
15848 where
15849 T: std::convert::Into<wkt::Timestamp>,
15850 {
15851 self.update_time = std::option::Option::Some(v.into());
15852 self
15853 }
15854
15855 /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
15856 ///
15857 /// # Example
15858 /// ```ignore,no_run
15859 /// # use google_cloud_dataform_v1::model::Folder;
15860 /// use wkt::Timestamp;
15861 /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15862 /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
15863 /// ```
15864 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15865 where
15866 T: std::convert::Into<wkt::Timestamp>,
15867 {
15868 self.update_time = v.map(|x| x.into());
15869 self
15870 }
15871
15872 /// Sets the value of [internal_metadata][crate::model::Folder::internal_metadata].
15873 ///
15874 /// # Example
15875 /// ```ignore,no_run
15876 /// # use google_cloud_dataform_v1::model::Folder;
15877 /// let x = Folder::new().set_internal_metadata("example");
15878 /// ```
15879 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
15880 where
15881 T: std::convert::Into<std::string::String>,
15882 {
15883 self.internal_metadata = std::option::Option::Some(v.into());
15884 self
15885 }
15886
15887 /// Sets or clears the value of [internal_metadata][crate::model::Folder::internal_metadata].
15888 ///
15889 /// # Example
15890 /// ```ignore,no_run
15891 /// # use google_cloud_dataform_v1::model::Folder;
15892 /// let x = Folder::new().set_or_clear_internal_metadata(Some("example"));
15893 /// let x = Folder::new().set_or_clear_internal_metadata(None::<String>);
15894 /// ```
15895 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15896 where
15897 T: std::convert::Into<std::string::String>,
15898 {
15899 self.internal_metadata = v.map(|x| x.into());
15900 self
15901 }
15902
15903 /// Sets the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
15904 ///
15905 /// # Example
15906 /// ```ignore,no_run
15907 /// # use google_cloud_dataform_v1::model::Folder;
15908 /// let x = Folder::new().set_creator_iam_principal("example");
15909 /// ```
15910 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
15911 where
15912 T: std::convert::Into<std::string::String>,
15913 {
15914 self.creator_iam_principal = std::option::Option::Some(v.into());
15915 self
15916 }
15917
15918 /// Sets or clears the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
15919 ///
15920 /// # Example
15921 /// ```ignore,no_run
15922 /// # use google_cloud_dataform_v1::model::Folder;
15923 /// let x = Folder::new().set_or_clear_creator_iam_principal(Some("example"));
15924 /// let x = Folder::new().set_or_clear_creator_iam_principal(None::<String>);
15925 /// ```
15926 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
15927 where
15928 T: std::convert::Into<std::string::String>,
15929 {
15930 self.creator_iam_principal = v.map(|x| x.into());
15931 self
15932 }
15933}
15934
15935impl wkt::message::Message for Folder {
15936 fn typename() -> &'static str {
15937 "type.googleapis.com/google.cloud.dataform.v1.Folder"
15938 }
15939}
15940
15941/// `CreateFolder` request message.
15942#[derive(Clone, Default, PartialEq)]
15943#[non_exhaustive]
15944pub struct CreateFolderRequest {
15945 /// Required. The location in which to create the Folder. Must be in the format
15946 /// `projects/*/locations/*`.
15947 pub parent: std::string::String,
15948
15949 /// Required. The Folder to create.
15950 pub folder: std::option::Option<crate::model::Folder>,
15951
15952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15953}
15954
15955impl CreateFolderRequest {
15956 /// Creates a new default instance.
15957 pub fn new() -> Self {
15958 std::default::Default::default()
15959 }
15960
15961 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
15962 ///
15963 /// # Example
15964 /// ```ignore,no_run
15965 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15966 /// let x = CreateFolderRequest::new().set_parent("example");
15967 /// ```
15968 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15969 self.parent = v.into();
15970 self
15971 }
15972
15973 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
15974 ///
15975 /// # Example
15976 /// ```ignore,no_run
15977 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15978 /// use google_cloud_dataform_v1::model::Folder;
15979 /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
15980 /// ```
15981 pub fn set_folder<T>(mut self, v: T) -> Self
15982 where
15983 T: std::convert::Into<crate::model::Folder>,
15984 {
15985 self.folder = std::option::Option::Some(v.into());
15986 self
15987 }
15988
15989 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
15990 ///
15991 /// # Example
15992 /// ```ignore,no_run
15993 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
15994 /// use google_cloud_dataform_v1::model::Folder;
15995 /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
15996 /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
15997 /// ```
15998 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
15999 where
16000 T: std::convert::Into<crate::model::Folder>,
16001 {
16002 self.folder = v.map(|x| x.into());
16003 self
16004 }
16005}
16006
16007impl wkt::message::Message for CreateFolderRequest {
16008 fn typename() -> &'static str {
16009 "type.googleapis.com/google.cloud.dataform.v1.CreateFolderRequest"
16010 }
16011}
16012
16013/// `MoveFolder` request message.
16014#[derive(Clone, Default, PartialEq)]
16015#[non_exhaustive]
16016pub struct MoveFolderRequest {
16017 /// Required. The full resource name of the Folder to move.
16018 pub name: std::string::String,
16019
16020 /// Optional. The name of the Folder, TeamFolder, or root location to move the
16021 /// Folder to. Can be in the format of: "" to move into the root User folder,
16022 /// `projects/*/locations/*/folders/*`, `projects/*/locations/*/teamFolders/*`
16023 pub destination_containing_folder: std::option::Option<std::string::String>,
16024
16025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16026}
16027
16028impl MoveFolderRequest {
16029 /// Creates a new default instance.
16030 pub fn new() -> Self {
16031 std::default::Default::default()
16032 }
16033
16034 /// Sets the value of [name][crate::model::MoveFolderRequest::name].
16035 ///
16036 /// # Example
16037 /// ```ignore,no_run
16038 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
16039 /// # let project_id = "project_id";
16040 /// # let location_id = "location_id";
16041 /// # let folder_id = "folder_id";
16042 /// let x = MoveFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16043 /// ```
16044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16045 self.name = v.into();
16046 self
16047 }
16048
16049 /// Sets the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
16050 ///
16051 /// # Example
16052 /// ```ignore,no_run
16053 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
16054 /// let x = MoveFolderRequest::new().set_destination_containing_folder("example");
16055 /// ```
16056 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
16057 where
16058 T: std::convert::Into<std::string::String>,
16059 {
16060 self.destination_containing_folder = std::option::Option::Some(v.into());
16061 self
16062 }
16063
16064 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
16065 ///
16066 /// # Example
16067 /// ```ignore,no_run
16068 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
16069 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(Some("example"));
16070 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(None::<String>);
16071 /// ```
16072 pub fn set_or_clear_destination_containing_folder<T>(
16073 mut self,
16074 v: std::option::Option<T>,
16075 ) -> Self
16076 where
16077 T: std::convert::Into<std::string::String>,
16078 {
16079 self.destination_containing_folder = v.map(|x| x.into());
16080 self
16081 }
16082}
16083
16084impl wkt::message::Message for MoveFolderRequest {
16085 fn typename() -> &'static str {
16086 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderRequest"
16087 }
16088}
16089
16090/// `GetFolder` request message.
16091#[derive(Clone, Default, PartialEq)]
16092#[non_exhaustive]
16093pub struct GetFolderRequest {
16094 /// Required. The Folder's name.
16095 pub name: std::string::String,
16096
16097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16098}
16099
16100impl GetFolderRequest {
16101 /// Creates a new default instance.
16102 pub fn new() -> Self {
16103 std::default::Default::default()
16104 }
16105
16106 /// Sets the value of [name][crate::model::GetFolderRequest::name].
16107 ///
16108 /// # Example
16109 /// ```ignore,no_run
16110 /// # use google_cloud_dataform_v1::model::GetFolderRequest;
16111 /// # let project_id = "project_id";
16112 /// # let location_id = "location_id";
16113 /// # let folder_id = "folder_id";
16114 /// let x = GetFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16115 /// ```
16116 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16117 self.name = v.into();
16118 self
16119 }
16120}
16121
16122impl wkt::message::Message for GetFolderRequest {
16123 fn typename() -> &'static str {
16124 "type.googleapis.com/google.cloud.dataform.v1.GetFolderRequest"
16125 }
16126}
16127
16128/// `UpdateFolder` request message.
16129#[derive(Clone, Default, PartialEq)]
16130#[non_exhaustive]
16131pub struct UpdateFolderRequest {
16132 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
16133 /// all fields that can be updated, will be updated. A few fields cannot be
16134 /// updated and will be ignored if specified in the update_mask (e.g.
16135 /// parent_name, team_folder_name).
16136 pub update_mask: std::option::Option<wkt::FieldMask>,
16137
16138 /// Required. The updated Folder.
16139 pub folder: std::option::Option<crate::model::Folder>,
16140
16141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16142}
16143
16144impl UpdateFolderRequest {
16145 /// Creates a new default instance.
16146 pub fn new() -> Self {
16147 std::default::Default::default()
16148 }
16149
16150 /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
16151 ///
16152 /// # Example
16153 /// ```ignore,no_run
16154 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
16155 /// use wkt::FieldMask;
16156 /// let x = UpdateFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16157 /// ```
16158 pub fn set_update_mask<T>(mut self, v: T) -> Self
16159 where
16160 T: std::convert::Into<wkt::FieldMask>,
16161 {
16162 self.update_mask = std::option::Option::Some(v.into());
16163 self
16164 }
16165
16166 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
16167 ///
16168 /// # Example
16169 /// ```ignore,no_run
16170 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
16171 /// use wkt::FieldMask;
16172 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16173 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16174 /// ```
16175 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16176 where
16177 T: std::convert::Into<wkt::FieldMask>,
16178 {
16179 self.update_mask = v.map(|x| x.into());
16180 self
16181 }
16182
16183 /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
16184 ///
16185 /// # Example
16186 /// ```ignore,no_run
16187 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
16188 /// use google_cloud_dataform_v1::model::Folder;
16189 /// let x = UpdateFolderRequest::new().set_folder(Folder::default()/* use setters */);
16190 /// ```
16191 pub fn set_folder<T>(mut self, v: T) -> Self
16192 where
16193 T: std::convert::Into<crate::model::Folder>,
16194 {
16195 self.folder = std::option::Option::Some(v.into());
16196 self
16197 }
16198
16199 /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
16200 ///
16201 /// # Example
16202 /// ```ignore,no_run
16203 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
16204 /// use google_cloud_dataform_v1::model::Folder;
16205 /// let x = UpdateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
16206 /// let x = UpdateFolderRequest::new().set_or_clear_folder(None::<Folder>);
16207 /// ```
16208 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
16209 where
16210 T: std::convert::Into<crate::model::Folder>,
16211 {
16212 self.folder = v.map(|x| x.into());
16213 self
16214 }
16215}
16216
16217impl wkt::message::Message for UpdateFolderRequest {
16218 fn typename() -> &'static str {
16219 "type.googleapis.com/google.cloud.dataform.v1.UpdateFolderRequest"
16220 }
16221}
16222
16223/// `DeleteFolder` request message.
16224#[derive(Clone, Default, PartialEq)]
16225#[non_exhaustive]
16226pub struct DeleteFolderRequest {
16227 /// Required. The Folder's name.
16228 pub name: std::string::String,
16229
16230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16231}
16232
16233impl DeleteFolderRequest {
16234 /// Creates a new default instance.
16235 pub fn new() -> Self {
16236 std::default::Default::default()
16237 }
16238
16239 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
16240 ///
16241 /// # Example
16242 /// ```ignore,no_run
16243 /// # use google_cloud_dataform_v1::model::DeleteFolderRequest;
16244 /// # let project_id = "project_id";
16245 /// # let location_id = "location_id";
16246 /// # let folder_id = "folder_id";
16247 /// let x = DeleteFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16248 /// ```
16249 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16250 self.name = v.into();
16251 self
16252 }
16253}
16254
16255impl wkt::message::Message for DeleteFolderRequest {
16256 fn typename() -> &'static str {
16257 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderRequest"
16258 }
16259}
16260
16261/// `DeleteFolderTree` request message.
16262#[derive(Clone, Default, PartialEq)]
16263#[non_exhaustive]
16264pub struct DeleteFolderTreeRequest {
16265 /// Required. The Folder's name.
16266 /// Format: projects/{project}/locations/{location}/folders/{folder}
16267 pub name: std::string::String,
16268
16269 /// Optional. If `false` (default): The operation will fail if any
16270 /// Repository within the folder hierarchy has associated Release Configs or
16271 /// Workflow Configs.
16272 ///
16273 /// If `true`: The operation will attempt to delete everything, including any
16274 /// Release Configs and Workflow Configs linked to Repositories within the
16275 /// folder hierarchy. This permanently removes schedules and resources.
16276 pub force: bool,
16277
16278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16279}
16280
16281impl DeleteFolderTreeRequest {
16282 /// Creates a new default instance.
16283 pub fn new() -> Self {
16284 std::default::Default::default()
16285 }
16286
16287 /// Sets the value of [name][crate::model::DeleteFolderTreeRequest::name].
16288 ///
16289 /// # Example
16290 /// ```ignore,no_run
16291 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
16292 /// # let project_id = "project_id";
16293 /// # let location_id = "location_id";
16294 /// # let folder_id = "folder_id";
16295 /// let x = DeleteFolderTreeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16296 /// ```
16297 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16298 self.name = v.into();
16299 self
16300 }
16301
16302 /// Sets the value of [force][crate::model::DeleteFolderTreeRequest::force].
16303 ///
16304 /// # Example
16305 /// ```ignore,no_run
16306 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
16307 /// let x = DeleteFolderTreeRequest::new().set_force(true);
16308 /// ```
16309 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16310 self.force = v.into();
16311 self
16312 }
16313}
16314
16315impl wkt::message::Message for DeleteFolderTreeRequest {
16316 fn typename() -> &'static str {
16317 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeRequest"
16318 }
16319}
16320
16321/// `DeleteTeamFolderTree` request message.
16322#[derive(Clone, Default, PartialEq)]
16323#[non_exhaustive]
16324pub struct DeleteTeamFolderTreeRequest {
16325 /// Required. The TeamFolder's name.
16326 /// Format: projects/{project}/locations/{location}/teamFolders/{team_folder}
16327 pub name: std::string::String,
16328
16329 /// Optional. If `false` (default): The operation will fail if any
16330 /// Repository within the folder hierarchy has associated Release Configs or
16331 /// Workflow Configs.
16332 ///
16333 /// If `true`: The operation will attempt to delete everything, including any
16334 /// Release Configs and Workflow Configs linked to Repositories within the
16335 /// folder hierarchy. This permanently removes schedules and resources.
16336 pub force: bool,
16337
16338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16339}
16340
16341impl DeleteTeamFolderTreeRequest {
16342 /// Creates a new default instance.
16343 pub fn new() -> Self {
16344 std::default::Default::default()
16345 }
16346
16347 /// Sets the value of [name][crate::model::DeleteTeamFolderTreeRequest::name].
16348 ///
16349 /// # Example
16350 /// ```ignore,no_run
16351 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
16352 /// # let project_id = "project_id";
16353 /// # let location_id = "location_id";
16354 /// # let team_folder_id = "team_folder_id";
16355 /// let x = DeleteTeamFolderTreeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
16356 /// ```
16357 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16358 self.name = v.into();
16359 self
16360 }
16361
16362 /// Sets the value of [force][crate::model::DeleteTeamFolderTreeRequest::force].
16363 ///
16364 /// # Example
16365 /// ```ignore,no_run
16366 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
16367 /// let x = DeleteTeamFolderTreeRequest::new().set_force(true);
16368 /// ```
16369 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16370 self.force = v.into();
16371 self
16372 }
16373}
16374
16375impl wkt::message::Message for DeleteTeamFolderTreeRequest {
16376 fn typename() -> &'static str {
16377 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderTreeRequest"
16378 }
16379}
16380
16381/// Contains metadata about the progress of the DeleteFolderTree Long-running
16382/// operations.
16383#[derive(Clone, Default, PartialEq)]
16384#[non_exhaustive]
16385pub struct DeleteFolderTreeMetadata {
16386 /// Output only. The time the operation was created.
16387 pub create_time: std::option::Option<wkt::Timestamp>,
16388
16389 /// Output only. The time the operation finished running.
16390 pub end_time: std::option::Option<wkt::Timestamp>,
16391
16392 /// Output only. Resource name of the target of the operation.
16393 /// Format: projects/{project}/locations/{location}/folders/{folder} or
16394 /// projects/{project}/locations/{location}/teamFolders/{team_folder}
16395 pub target: std::string::String,
16396
16397 /// Output only. The state of the operation.
16398 pub state: crate::model::delete_folder_tree_metadata::State,
16399
16400 /// Output only. Percent complete of the operation [0, 100].
16401 pub percent_complete: i32,
16402
16403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16404}
16405
16406impl DeleteFolderTreeMetadata {
16407 /// Creates a new default instance.
16408 pub fn new() -> Self {
16409 std::default::Default::default()
16410 }
16411
16412 /// Sets the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
16413 ///
16414 /// # Example
16415 /// ```ignore,no_run
16416 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16417 /// use wkt::Timestamp;
16418 /// let x = DeleteFolderTreeMetadata::new().set_create_time(Timestamp::default()/* use setters */);
16419 /// ```
16420 pub fn set_create_time<T>(mut self, v: T) -> Self
16421 where
16422 T: std::convert::Into<wkt::Timestamp>,
16423 {
16424 self.create_time = std::option::Option::Some(v.into());
16425 self
16426 }
16427
16428 /// Sets or clears the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
16429 ///
16430 /// # Example
16431 /// ```ignore,no_run
16432 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16433 /// use wkt::Timestamp;
16434 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16435 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(None::<Timestamp>);
16436 /// ```
16437 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16438 where
16439 T: std::convert::Into<wkt::Timestamp>,
16440 {
16441 self.create_time = v.map(|x| x.into());
16442 self
16443 }
16444
16445 /// Sets the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
16446 ///
16447 /// # Example
16448 /// ```ignore,no_run
16449 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16450 /// use wkt::Timestamp;
16451 /// let x = DeleteFolderTreeMetadata::new().set_end_time(Timestamp::default()/* use setters */);
16452 /// ```
16453 pub fn set_end_time<T>(mut self, v: T) -> Self
16454 where
16455 T: std::convert::Into<wkt::Timestamp>,
16456 {
16457 self.end_time = std::option::Option::Some(v.into());
16458 self
16459 }
16460
16461 /// Sets or clears the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
16462 ///
16463 /// # Example
16464 /// ```ignore,no_run
16465 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16466 /// use wkt::Timestamp;
16467 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16468 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(None::<Timestamp>);
16469 /// ```
16470 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16471 where
16472 T: std::convert::Into<wkt::Timestamp>,
16473 {
16474 self.end_time = v.map(|x| x.into());
16475 self
16476 }
16477
16478 /// Sets the value of [target][crate::model::DeleteFolderTreeMetadata::target].
16479 ///
16480 /// # Example
16481 /// ```ignore,no_run
16482 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16483 /// let x = DeleteFolderTreeMetadata::new().set_target("example");
16484 /// ```
16485 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16486 self.target = v.into();
16487 self
16488 }
16489
16490 /// Sets the value of [state][crate::model::DeleteFolderTreeMetadata::state].
16491 ///
16492 /// # Example
16493 /// ```ignore,no_run
16494 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16495 /// use google_cloud_dataform_v1::model::delete_folder_tree_metadata::State;
16496 /// let x0 = DeleteFolderTreeMetadata::new().set_state(State::Initialized);
16497 /// let x1 = DeleteFolderTreeMetadata::new().set_state(State::InProgress);
16498 /// let x2 = DeleteFolderTreeMetadata::new().set_state(State::Succeeded);
16499 /// ```
16500 pub fn set_state<T: std::convert::Into<crate::model::delete_folder_tree_metadata::State>>(
16501 mut self,
16502 v: T,
16503 ) -> Self {
16504 self.state = v.into();
16505 self
16506 }
16507
16508 /// Sets the value of [percent_complete][crate::model::DeleteFolderTreeMetadata::percent_complete].
16509 ///
16510 /// # Example
16511 /// ```ignore,no_run
16512 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
16513 /// let x = DeleteFolderTreeMetadata::new().set_percent_complete(42);
16514 /// ```
16515 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16516 self.percent_complete = v.into();
16517 self
16518 }
16519}
16520
16521impl wkt::message::Message for DeleteFolderTreeMetadata {
16522 fn typename() -> &'static str {
16523 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeMetadata"
16524 }
16525}
16526
16527/// Defines additional types related to [DeleteFolderTreeMetadata].
16528pub mod delete_folder_tree_metadata {
16529 #[allow(unused_imports)]
16530 use super::*;
16531
16532 /// Different states of the DeleteFolderTree operation.
16533 ///
16534 /// # Working with unknown values
16535 ///
16536 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16537 /// additional enum variants at any time. Adding new variants is not considered
16538 /// a breaking change. Applications should write their code in anticipation of:
16539 ///
16540 /// - New values appearing in future releases of the client library, **and**
16541 /// - New values received dynamically, without application changes.
16542 ///
16543 /// Please consult the [Working with enums] section in the user guide for some
16544 /// guidelines.
16545 ///
16546 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16547 #[derive(Clone, Debug, PartialEq)]
16548 #[non_exhaustive]
16549 pub enum State {
16550 /// The state is unspecified.
16551 Unspecified,
16552 /// The operation was initialized and recorded by the server, but not yet
16553 /// started.
16554 Initialized,
16555 /// The operation is in progress.
16556 InProgress,
16557 /// The operation has completed successfully.
16558 Succeeded,
16559 /// The operation has failed.
16560 Failed,
16561 /// If set, the enum was initialized with an unknown value.
16562 ///
16563 /// Applications can examine the value using [State::value] or
16564 /// [State::name].
16565 UnknownValue(state::UnknownValue),
16566 }
16567
16568 #[doc(hidden)]
16569 pub mod state {
16570 #[allow(unused_imports)]
16571 use super::*;
16572 #[derive(Clone, Debug, PartialEq)]
16573 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16574 }
16575
16576 impl State {
16577 /// Gets the enum value.
16578 ///
16579 /// Returns `None` if the enum contains an unknown value deserialized from
16580 /// the string representation of enums.
16581 pub fn value(&self) -> std::option::Option<i32> {
16582 match self {
16583 Self::Unspecified => std::option::Option::Some(0),
16584 Self::Initialized => std::option::Option::Some(1),
16585 Self::InProgress => std::option::Option::Some(2),
16586 Self::Succeeded => std::option::Option::Some(3),
16587 Self::Failed => std::option::Option::Some(4),
16588 Self::UnknownValue(u) => u.0.value(),
16589 }
16590 }
16591
16592 /// Gets the enum value as a string.
16593 ///
16594 /// Returns `None` if the enum contains an unknown value deserialized from
16595 /// the integer representation of enums.
16596 pub fn name(&self) -> std::option::Option<&str> {
16597 match self {
16598 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16599 Self::Initialized => std::option::Option::Some("INITIALIZED"),
16600 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16601 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16602 Self::Failed => std::option::Option::Some("FAILED"),
16603 Self::UnknownValue(u) => u.0.name(),
16604 }
16605 }
16606 }
16607
16608 impl std::default::Default for State {
16609 fn default() -> Self {
16610 use std::convert::From;
16611 Self::from(0)
16612 }
16613 }
16614
16615 impl std::fmt::Display for State {
16616 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16617 wkt::internal::display_enum(f, self.name(), self.value())
16618 }
16619 }
16620
16621 impl std::convert::From<i32> for State {
16622 fn from(value: i32) -> Self {
16623 match value {
16624 0 => Self::Unspecified,
16625 1 => Self::Initialized,
16626 2 => Self::InProgress,
16627 3 => Self::Succeeded,
16628 4 => Self::Failed,
16629 _ => Self::UnknownValue(state::UnknownValue(
16630 wkt::internal::UnknownEnumValue::Integer(value),
16631 )),
16632 }
16633 }
16634 }
16635
16636 impl std::convert::From<&str> for State {
16637 fn from(value: &str) -> Self {
16638 use std::string::ToString;
16639 match value {
16640 "STATE_UNSPECIFIED" => Self::Unspecified,
16641 "INITIALIZED" => Self::Initialized,
16642 "IN_PROGRESS" => Self::InProgress,
16643 "SUCCEEDED" => Self::Succeeded,
16644 "FAILED" => Self::Failed,
16645 _ => Self::UnknownValue(state::UnknownValue(
16646 wkt::internal::UnknownEnumValue::String(value.to_string()),
16647 )),
16648 }
16649 }
16650 }
16651
16652 impl serde::ser::Serialize for State {
16653 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16654 where
16655 S: serde::Serializer,
16656 {
16657 match self {
16658 Self::Unspecified => serializer.serialize_i32(0),
16659 Self::Initialized => serializer.serialize_i32(1),
16660 Self::InProgress => serializer.serialize_i32(2),
16661 Self::Succeeded => serializer.serialize_i32(3),
16662 Self::Failed => serializer.serialize_i32(4),
16663 Self::UnknownValue(u) => u.0.serialize(serializer),
16664 }
16665 }
16666 }
16667
16668 impl<'de> serde::de::Deserialize<'de> for State {
16669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16670 where
16671 D: serde::Deserializer<'de>,
16672 {
16673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16674 ".google.cloud.dataform.v1.DeleteFolderTreeMetadata.State",
16675 ))
16676 }
16677 }
16678}
16679
16680/// `QueryFolderContents` request message.
16681#[derive(Clone, Default, PartialEq)]
16682#[non_exhaustive]
16683pub struct QueryFolderContentsRequest {
16684 /// Required. Resource name of the Folder to list contents for.
16685 /// Format: projects/*/locations/*/folders/*
16686 pub folder: std::string::String,
16687
16688 /// Optional. Maximum number of paths to return. The server may return fewer
16689 /// items than requested. If unspecified, the server will pick an appropriate
16690 /// default.
16691 pub page_size: i32,
16692
16693 /// Optional. Page token received from a previous `QueryFolderContents` call.
16694 /// Provide this to retrieve the subsequent page.
16695 ///
16696 /// When paginating, all other parameters provided to
16697 /// `QueryFolderContents`, with the exception of `page_size`, must match the
16698 /// call that provided the page token.
16699 pub page_token: std::string::String,
16700
16701 /// Optional. Field to additionally sort results by.
16702 /// Will order Folders before Repositories, and then by `order_by` in ascending
16703 /// order. Supported keywords: display_name (default), create_time,
16704 /// last_modified_time.
16705 /// Examples:
16706 ///
16707 /// * `orderBy="display_name"`
16708 /// * `orderBy="display_name desc"`
16709 pub order_by: std::string::String,
16710
16711 /// Optional. Optional filtering for the returned list. Filtering is currently
16712 /// only supported on the `display_name` field.
16713 ///
16714 /// Example:
16715 ///
16716 /// * `filter="display_name="MyFolder""`
16717 pub filter: std::string::String,
16718
16719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16720}
16721
16722impl QueryFolderContentsRequest {
16723 /// Creates a new default instance.
16724 pub fn new() -> Self {
16725 std::default::Default::default()
16726 }
16727
16728 /// Sets the value of [folder][crate::model::QueryFolderContentsRequest::folder].
16729 ///
16730 /// # Example
16731 /// ```ignore,no_run
16732 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16733 /// # let project_id = "project_id";
16734 /// # let location_id = "location_id";
16735 /// # let folder_id = "folder_id";
16736 /// let x = QueryFolderContentsRequest::new().set_folder(format!("projects/{project_id}/locations/{location_id}/folders/{folder_id}"));
16737 /// ```
16738 pub fn set_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16739 self.folder = v.into();
16740 self
16741 }
16742
16743 /// Sets the value of [page_size][crate::model::QueryFolderContentsRequest::page_size].
16744 ///
16745 /// # Example
16746 /// ```ignore,no_run
16747 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16748 /// let x = QueryFolderContentsRequest::new().set_page_size(42);
16749 /// ```
16750 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16751 self.page_size = v.into();
16752 self
16753 }
16754
16755 /// Sets the value of [page_token][crate::model::QueryFolderContentsRequest::page_token].
16756 ///
16757 /// # Example
16758 /// ```ignore,no_run
16759 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16760 /// let x = QueryFolderContentsRequest::new().set_page_token("example");
16761 /// ```
16762 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16763 self.page_token = v.into();
16764 self
16765 }
16766
16767 /// Sets the value of [order_by][crate::model::QueryFolderContentsRequest::order_by].
16768 ///
16769 /// # Example
16770 /// ```ignore,no_run
16771 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16772 /// let x = QueryFolderContentsRequest::new().set_order_by("example");
16773 /// ```
16774 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16775 self.order_by = v.into();
16776 self
16777 }
16778
16779 /// Sets the value of [filter][crate::model::QueryFolderContentsRequest::filter].
16780 ///
16781 /// # Example
16782 /// ```ignore,no_run
16783 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
16784 /// let x = QueryFolderContentsRequest::new().set_filter("example");
16785 /// ```
16786 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16787 self.filter = v.into();
16788 self
16789 }
16790}
16791
16792impl wkt::message::Message for QueryFolderContentsRequest {
16793 fn typename() -> &'static str {
16794 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsRequest"
16795 }
16796}
16797
16798/// `QueryFolderContents` response message.
16799#[derive(Clone, Default, PartialEq)]
16800#[non_exhaustive]
16801pub struct QueryFolderContentsResponse {
16802 /// List of entries in the folder.
16803 pub entries: std::vec::Vec<crate::model::query_folder_contents_response::FolderContentsEntry>,
16804
16805 /// A token, which can be sent as `page_token` to retrieve the next page.
16806 /// If this field is omitted, there are no subsequent pages.
16807 pub next_page_token: std::string::String,
16808
16809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16810}
16811
16812impl QueryFolderContentsResponse {
16813 /// Creates a new default instance.
16814 pub fn new() -> Self {
16815 std::default::Default::default()
16816 }
16817
16818 /// Sets the value of [entries][crate::model::QueryFolderContentsResponse::entries].
16819 ///
16820 /// # Example
16821 /// ```ignore,no_run
16822 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
16823 /// use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16824 /// let x = QueryFolderContentsResponse::new()
16825 /// .set_entries([
16826 /// FolderContentsEntry::default()/* use setters */,
16827 /// FolderContentsEntry::default()/* use (different) setters */,
16828 /// ]);
16829 /// ```
16830 pub fn set_entries<T, V>(mut self, v: T) -> Self
16831 where
16832 T: std::iter::IntoIterator<Item = V>,
16833 V: std::convert::Into<crate::model::query_folder_contents_response::FolderContentsEntry>,
16834 {
16835 use std::iter::Iterator;
16836 self.entries = v.into_iter().map(|i| i.into()).collect();
16837 self
16838 }
16839
16840 /// Sets the value of [next_page_token][crate::model::QueryFolderContentsResponse::next_page_token].
16841 ///
16842 /// # Example
16843 /// ```ignore,no_run
16844 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
16845 /// let x = QueryFolderContentsResponse::new().set_next_page_token("example");
16846 /// ```
16847 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16848 self.next_page_token = v.into();
16849 self
16850 }
16851}
16852
16853impl wkt::message::Message for QueryFolderContentsResponse {
16854 fn typename() -> &'static str {
16855 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse"
16856 }
16857}
16858
16859#[doc(hidden)]
16860impl google_cloud_gax::paginator::internal::PageableResponse for QueryFolderContentsResponse {
16861 type PageItem = crate::model::query_folder_contents_response::FolderContentsEntry;
16862
16863 fn items(self) -> std::vec::Vec<Self::PageItem> {
16864 self.entries
16865 }
16866
16867 fn next_page_token(&self) -> std::string::String {
16868 use std::clone::Clone;
16869 self.next_page_token.clone()
16870 }
16871}
16872
16873/// Defines additional types related to [QueryFolderContentsResponse].
16874pub mod query_folder_contents_response {
16875 #[allow(unused_imports)]
16876 use super::*;
16877
16878 /// Represents a single content entry.
16879 #[derive(Clone, Default, PartialEq)]
16880 #[non_exhaustive]
16881 pub struct FolderContentsEntry {
16882 /// The content entry.
16883 pub entry: std::option::Option<
16884 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
16885 >,
16886
16887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16888 }
16889
16890 impl FolderContentsEntry {
16891 /// Creates a new default instance.
16892 pub fn new() -> Self {
16893 std::default::Default::default()
16894 }
16895
16896 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry].
16897 ///
16898 /// Note that all the setters affecting `entry` are mutually
16899 /// exclusive.
16900 ///
16901 /// # Example
16902 /// ```ignore,no_run
16903 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16904 /// use google_cloud_dataform_v1::model::Folder;
16905 /// let x = FolderContentsEntry::new().set_entry(Some(
16906 /// google_cloud_dataform_v1::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(Folder::default().into())));
16907 /// ```
16908 pub fn set_entry<
16909 T: std::convert::Into<
16910 std::option::Option<
16911 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
16912 >,
16913 >,
16914 >(
16915 mut self,
16916 v: T,
16917 ) -> Self {
16918 self.entry = v.into();
16919 self
16920 }
16921
16922 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16923 /// if it holds a `Folder`, `None` if the field is not set or
16924 /// holds a different branch.
16925 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
16926 #[allow(unreachable_patterns)]
16927 self.entry.as_ref().and_then(|v| match v {
16928 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
16929 _ => std::option::Option::None,
16930 })
16931 }
16932
16933 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16934 /// to hold a `Folder`.
16935 ///
16936 /// Note that all the setters affecting `entry` are
16937 /// mutually exclusive.
16938 ///
16939 /// # Example
16940 /// ```ignore,no_run
16941 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16942 /// use google_cloud_dataform_v1::model::Folder;
16943 /// let x = FolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
16944 /// assert!(x.folder().is_some());
16945 /// assert!(x.repository().is_none());
16946 /// ```
16947 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
16948 mut self,
16949 v: T,
16950 ) -> Self {
16951 self.entry = std::option::Option::Some(
16952 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(
16953 v.into(),
16954 ),
16955 );
16956 self
16957 }
16958
16959 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16960 /// if it holds a `Repository`, `None` if the field is not set or
16961 /// holds a different branch.
16962 pub fn repository(
16963 &self,
16964 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
16965 #[allow(unreachable_patterns)]
16966 self.entry.as_ref().and_then(|v| match v {
16967 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
16968 _ => std::option::Option::None,
16969 })
16970 }
16971
16972 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
16973 /// to hold a `Repository`.
16974 ///
16975 /// Note that all the setters affecting `entry` are
16976 /// mutually exclusive.
16977 ///
16978 /// # Example
16979 /// ```ignore,no_run
16980 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
16981 /// use google_cloud_dataform_v1::model::Repository;
16982 /// let x = FolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
16983 /// assert!(x.repository().is_some());
16984 /// assert!(x.folder().is_none());
16985 /// ```
16986 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
16987 mut self,
16988 v: T,
16989 ) -> Self {
16990 self.entry = std::option::Option::Some(
16991 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(
16992 v.into()
16993 )
16994 );
16995 self
16996 }
16997 }
16998
16999 impl wkt::message::Message for FolderContentsEntry {
17000 fn typename() -> &'static str {
17001 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry"
17002 }
17003 }
17004
17005 /// Defines additional types related to [FolderContentsEntry].
17006 pub mod folder_contents_entry {
17007 #[allow(unused_imports)]
17008 use super::*;
17009
17010 /// The content entry.
17011 #[derive(Clone, Debug, PartialEq)]
17012 #[non_exhaustive]
17013 pub enum Entry {
17014 /// A subfolder.
17015 Folder(std::boxed::Box<crate::model::Folder>),
17016 /// A repository.
17017 Repository(std::boxed::Box<crate::model::Repository>),
17018 }
17019 }
17020}
17021
17022/// `QueryUserRootContents` request message.
17023#[derive(Clone, Default, PartialEq)]
17024#[non_exhaustive]
17025pub struct QueryUserRootContentsRequest {
17026 /// Required. Location of the user root folder to list contents for.
17027 /// Format: projects/*/locations/*
17028 pub location: std::string::String,
17029
17030 /// Optional. Maximum number of paths to return. The server may return fewer
17031 /// items than requested. If unspecified, the server will pick an appropriate
17032 /// default.
17033 pub page_size: i32,
17034
17035 /// Optional. Page token received from a previous `QueryUserRootContents` call.
17036 /// Provide this to retrieve the subsequent page.
17037 ///
17038 /// When paginating, all other parameters provided to
17039 /// `QueryUserRootFolderContents`, with the exception of `page_size`, must
17040 /// match the call that provided the page token.
17041 pub page_token: std::string::String,
17042
17043 /// Optional. Field to additionally sort results by.
17044 /// Will order Folders before Repositories, and then by `order_by` in ascending
17045 /// order. Supported keywords: display_name (default), created_at,
17046 /// last_modified_at. Examples:
17047 ///
17048 /// * `orderBy="display_name"`
17049 /// * `orderBy="display_name desc"`
17050 pub order_by: std::string::String,
17051
17052 /// Optional. Optional filtering for the returned list. Filtering is currently
17053 /// only supported on the `display_name` field.
17054 ///
17055 /// Example:
17056 ///
17057 /// * `filter="display_name="MyFolder""`
17058 pub filter: std::string::String,
17059
17060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17061}
17062
17063impl QueryUserRootContentsRequest {
17064 /// Creates a new default instance.
17065 pub fn new() -> Self {
17066 std::default::Default::default()
17067 }
17068
17069 /// Sets the value of [location][crate::model::QueryUserRootContentsRequest::location].
17070 ///
17071 /// # Example
17072 /// ```ignore,no_run
17073 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
17074 /// let x = QueryUserRootContentsRequest::new().set_location("example");
17075 /// ```
17076 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17077 self.location = v.into();
17078 self
17079 }
17080
17081 /// Sets the value of [page_size][crate::model::QueryUserRootContentsRequest::page_size].
17082 ///
17083 /// # Example
17084 /// ```ignore,no_run
17085 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
17086 /// let x = QueryUserRootContentsRequest::new().set_page_size(42);
17087 /// ```
17088 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17089 self.page_size = v.into();
17090 self
17091 }
17092
17093 /// Sets the value of [page_token][crate::model::QueryUserRootContentsRequest::page_token].
17094 ///
17095 /// # Example
17096 /// ```ignore,no_run
17097 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
17098 /// let x = QueryUserRootContentsRequest::new().set_page_token("example");
17099 /// ```
17100 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17101 self.page_token = v.into();
17102 self
17103 }
17104
17105 /// Sets the value of [order_by][crate::model::QueryUserRootContentsRequest::order_by].
17106 ///
17107 /// # Example
17108 /// ```ignore,no_run
17109 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
17110 /// let x = QueryUserRootContentsRequest::new().set_order_by("example");
17111 /// ```
17112 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17113 self.order_by = v.into();
17114 self
17115 }
17116
17117 /// Sets the value of [filter][crate::model::QueryUserRootContentsRequest::filter].
17118 ///
17119 /// # Example
17120 /// ```ignore,no_run
17121 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
17122 /// let x = QueryUserRootContentsRequest::new().set_filter("example");
17123 /// ```
17124 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17125 self.filter = v.into();
17126 self
17127 }
17128}
17129
17130impl wkt::message::Message for QueryUserRootContentsRequest {
17131 fn typename() -> &'static str {
17132 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsRequest"
17133 }
17134}
17135
17136/// `QueryUserRootContents` response message.
17137#[derive(Clone, Default, PartialEq)]
17138#[non_exhaustive]
17139pub struct QueryUserRootContentsResponse {
17140 /// List of entries in the folder.
17141 pub entries: std::vec::Vec<crate::model::query_user_root_contents_response::RootContentsEntry>,
17142
17143 /// A token, which can be sent as `page_token` to retrieve the next page.
17144 /// If this field is omitted, there are no subsequent pages.
17145 pub next_page_token: std::string::String,
17146
17147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17148}
17149
17150impl QueryUserRootContentsResponse {
17151 /// Creates a new default instance.
17152 pub fn new() -> Self {
17153 std::default::Default::default()
17154 }
17155
17156 /// Sets the value of [entries][crate::model::QueryUserRootContentsResponse::entries].
17157 ///
17158 /// # Example
17159 /// ```ignore,no_run
17160 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
17161 /// use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17162 /// let x = QueryUserRootContentsResponse::new()
17163 /// .set_entries([
17164 /// RootContentsEntry::default()/* use setters */,
17165 /// RootContentsEntry::default()/* use (different) setters */,
17166 /// ]);
17167 /// ```
17168 pub fn set_entries<T, V>(mut self, v: T) -> Self
17169 where
17170 T: std::iter::IntoIterator<Item = V>,
17171 V: std::convert::Into<crate::model::query_user_root_contents_response::RootContentsEntry>,
17172 {
17173 use std::iter::Iterator;
17174 self.entries = v.into_iter().map(|i| i.into()).collect();
17175 self
17176 }
17177
17178 /// Sets the value of [next_page_token][crate::model::QueryUserRootContentsResponse::next_page_token].
17179 ///
17180 /// # Example
17181 /// ```ignore,no_run
17182 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
17183 /// let x = QueryUserRootContentsResponse::new().set_next_page_token("example");
17184 /// ```
17185 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17186 self.next_page_token = v.into();
17187 self
17188 }
17189}
17190
17191impl wkt::message::Message for QueryUserRootContentsResponse {
17192 fn typename() -> &'static str {
17193 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse"
17194 }
17195}
17196
17197#[doc(hidden)]
17198impl google_cloud_gax::paginator::internal::PageableResponse for QueryUserRootContentsResponse {
17199 type PageItem = crate::model::query_user_root_contents_response::RootContentsEntry;
17200
17201 fn items(self) -> std::vec::Vec<Self::PageItem> {
17202 self.entries
17203 }
17204
17205 fn next_page_token(&self) -> std::string::String {
17206 use std::clone::Clone;
17207 self.next_page_token.clone()
17208 }
17209}
17210
17211/// Defines additional types related to [QueryUserRootContentsResponse].
17212pub mod query_user_root_contents_response {
17213 #[allow(unused_imports)]
17214 use super::*;
17215
17216 /// Represents a single content entry.
17217 #[derive(Clone, Default, PartialEq)]
17218 #[non_exhaustive]
17219 pub struct RootContentsEntry {
17220 /// The content entry.
17221 pub entry: std::option::Option<
17222 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
17223 >,
17224
17225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17226 }
17227
17228 impl RootContentsEntry {
17229 /// Creates a new default instance.
17230 pub fn new() -> Self {
17231 std::default::Default::default()
17232 }
17233
17234 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry].
17235 ///
17236 /// Note that all the setters affecting `entry` are mutually
17237 /// exclusive.
17238 ///
17239 /// # Example
17240 /// ```ignore,no_run
17241 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17242 /// use google_cloud_dataform_v1::model::Folder;
17243 /// let x = RootContentsEntry::new().set_entry(Some(
17244 /// google_cloud_dataform_v1::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(Folder::default().into())));
17245 /// ```
17246 pub fn set_entry<
17247 T: std::convert::Into<
17248 std::option::Option<
17249 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
17250 >,
17251 >,
17252 >(
17253 mut self,
17254 v: T,
17255 ) -> Self {
17256 self.entry = v.into();
17257 self
17258 }
17259
17260 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17261 /// if it holds a `Folder`, `None` if the field is not set or
17262 /// holds a different branch.
17263 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
17264 #[allow(unreachable_patterns)]
17265 self.entry.as_ref().and_then(|v| match v {
17266 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
17267 _ => std::option::Option::None,
17268 })
17269 }
17270
17271 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17272 /// to hold a `Folder`.
17273 ///
17274 /// Note that all the setters affecting `entry` are
17275 /// mutually exclusive.
17276 ///
17277 /// # Example
17278 /// ```ignore,no_run
17279 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17280 /// use google_cloud_dataform_v1::model::Folder;
17281 /// let x = RootContentsEntry::new().set_folder(Folder::default()/* use setters */);
17282 /// assert!(x.folder().is_some());
17283 /// assert!(x.repository().is_none());
17284 /// ```
17285 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
17286 mut self,
17287 v: T,
17288 ) -> Self {
17289 self.entry = std::option::Option::Some(
17290 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(
17291 v.into(),
17292 ),
17293 );
17294 self
17295 }
17296
17297 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17298 /// if it holds a `Repository`, `None` if the field is not set or
17299 /// holds a different branch.
17300 pub fn repository(
17301 &self,
17302 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
17303 #[allow(unreachable_patterns)]
17304 self.entry.as_ref().and_then(|v| match v {
17305 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
17306 _ => std::option::Option::None,
17307 })
17308 }
17309
17310 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
17311 /// to hold a `Repository`.
17312 ///
17313 /// Note that all the setters affecting `entry` are
17314 /// mutually exclusive.
17315 ///
17316 /// # Example
17317 /// ```ignore,no_run
17318 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
17319 /// use google_cloud_dataform_v1::model::Repository;
17320 /// let x = RootContentsEntry::new().set_repository(Repository::default()/* use setters */);
17321 /// assert!(x.repository().is_some());
17322 /// assert!(x.folder().is_none());
17323 /// ```
17324 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
17325 mut self,
17326 v: T,
17327 ) -> Self {
17328 self.entry = std::option::Option::Some(
17329 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(
17330 v.into()
17331 )
17332 );
17333 self
17334 }
17335 }
17336
17337 impl wkt::message::Message for RootContentsEntry {
17338 fn typename() -> &'static str {
17339 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry"
17340 }
17341 }
17342
17343 /// Defines additional types related to [RootContentsEntry].
17344 pub mod root_contents_entry {
17345 #[allow(unused_imports)]
17346 use super::*;
17347
17348 /// The content entry.
17349 #[derive(Clone, Debug, PartialEq)]
17350 #[non_exhaustive]
17351 pub enum Entry {
17352 /// A subfolder.
17353 Folder(std::boxed::Box<crate::model::Folder>),
17354 /// A repository.
17355 Repository(std::boxed::Box<crate::model::Repository>),
17356 }
17357 }
17358}
17359
17360/// Represents a Dataform TeamFolder. This is a resource that sits at the project
17361/// level and is used to organize Repositories and Folders with hierarchical
17362/// access controls. They provide a team context and stricter access controls.
17363#[derive(Clone, Default, PartialEq)]
17364#[non_exhaustive]
17365pub struct TeamFolder {
17366 /// Identifier. The TeamFolder's name.
17367 pub name: std::string::String,
17368
17369 /// Required. The TeamFolder's user-friendly name.
17370 pub display_name: std::string::String,
17371
17372 /// Output only. The timestamp of when the TeamFolder was created.
17373 pub create_time: std::option::Option<wkt::Timestamp>,
17374
17375 /// Output only. The timestamp of when the TeamFolder was last updated.
17376 pub update_time: std::option::Option<wkt::Timestamp>,
17377
17378 /// Output only. All the metadata information that is used internally to serve
17379 /// the resource. For example: timestamps, flags, status fields, etc. The
17380 /// format of this field is a JSON string.
17381 pub internal_metadata: std::option::Option<std::string::String>,
17382
17383 /// Output only. The IAM principal identifier of the creator of the TeamFolder.
17384 pub creator_iam_principal: std::option::Option<std::string::String>,
17385
17386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17387}
17388
17389impl TeamFolder {
17390 /// Creates a new default instance.
17391 pub fn new() -> Self {
17392 std::default::Default::default()
17393 }
17394
17395 /// Sets the value of [name][crate::model::TeamFolder::name].
17396 ///
17397 /// # Example
17398 /// ```ignore,no_run
17399 /// # use google_cloud_dataform_v1::model::TeamFolder;
17400 /// # let project_id = "project_id";
17401 /// # let location_id = "location_id";
17402 /// # let team_folder_id = "team_folder_id";
17403 /// let x = TeamFolder::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17404 /// ```
17405 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17406 self.name = v.into();
17407 self
17408 }
17409
17410 /// Sets the value of [display_name][crate::model::TeamFolder::display_name].
17411 ///
17412 /// # Example
17413 /// ```ignore,no_run
17414 /// # use google_cloud_dataform_v1::model::TeamFolder;
17415 /// let x = TeamFolder::new().set_display_name("example");
17416 /// ```
17417 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17418 self.display_name = v.into();
17419 self
17420 }
17421
17422 /// Sets the value of [create_time][crate::model::TeamFolder::create_time].
17423 ///
17424 /// # Example
17425 /// ```ignore,no_run
17426 /// # use google_cloud_dataform_v1::model::TeamFolder;
17427 /// use wkt::Timestamp;
17428 /// let x = TeamFolder::new().set_create_time(Timestamp::default()/* use setters */);
17429 /// ```
17430 pub fn set_create_time<T>(mut self, v: T) -> Self
17431 where
17432 T: std::convert::Into<wkt::Timestamp>,
17433 {
17434 self.create_time = std::option::Option::Some(v.into());
17435 self
17436 }
17437
17438 /// Sets or clears the value of [create_time][crate::model::TeamFolder::create_time].
17439 ///
17440 /// # Example
17441 /// ```ignore,no_run
17442 /// # use google_cloud_dataform_v1::model::TeamFolder;
17443 /// use wkt::Timestamp;
17444 /// let x = TeamFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17445 /// let x = TeamFolder::new().set_or_clear_create_time(None::<Timestamp>);
17446 /// ```
17447 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17448 where
17449 T: std::convert::Into<wkt::Timestamp>,
17450 {
17451 self.create_time = v.map(|x| x.into());
17452 self
17453 }
17454
17455 /// Sets the value of [update_time][crate::model::TeamFolder::update_time].
17456 ///
17457 /// # Example
17458 /// ```ignore,no_run
17459 /// # use google_cloud_dataform_v1::model::TeamFolder;
17460 /// use wkt::Timestamp;
17461 /// let x = TeamFolder::new().set_update_time(Timestamp::default()/* use setters */);
17462 /// ```
17463 pub fn set_update_time<T>(mut self, v: T) -> Self
17464 where
17465 T: std::convert::Into<wkt::Timestamp>,
17466 {
17467 self.update_time = std::option::Option::Some(v.into());
17468 self
17469 }
17470
17471 /// Sets or clears the value of [update_time][crate::model::TeamFolder::update_time].
17472 ///
17473 /// # Example
17474 /// ```ignore,no_run
17475 /// # use google_cloud_dataform_v1::model::TeamFolder;
17476 /// use wkt::Timestamp;
17477 /// let x = TeamFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17478 /// let x = TeamFolder::new().set_or_clear_update_time(None::<Timestamp>);
17479 /// ```
17480 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17481 where
17482 T: std::convert::Into<wkt::Timestamp>,
17483 {
17484 self.update_time = v.map(|x| x.into());
17485 self
17486 }
17487
17488 /// Sets the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
17489 ///
17490 /// # Example
17491 /// ```ignore,no_run
17492 /// # use google_cloud_dataform_v1::model::TeamFolder;
17493 /// let x = TeamFolder::new().set_internal_metadata("example");
17494 /// ```
17495 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
17496 where
17497 T: std::convert::Into<std::string::String>,
17498 {
17499 self.internal_metadata = std::option::Option::Some(v.into());
17500 self
17501 }
17502
17503 /// Sets or clears the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
17504 ///
17505 /// # Example
17506 /// ```ignore,no_run
17507 /// # use google_cloud_dataform_v1::model::TeamFolder;
17508 /// let x = TeamFolder::new().set_or_clear_internal_metadata(Some("example"));
17509 /// let x = TeamFolder::new().set_or_clear_internal_metadata(None::<String>);
17510 /// ```
17511 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17512 where
17513 T: std::convert::Into<std::string::String>,
17514 {
17515 self.internal_metadata = v.map(|x| x.into());
17516 self
17517 }
17518
17519 /// Sets the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
17520 ///
17521 /// # Example
17522 /// ```ignore,no_run
17523 /// # use google_cloud_dataform_v1::model::TeamFolder;
17524 /// let x = TeamFolder::new().set_creator_iam_principal("example");
17525 /// ```
17526 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
17527 where
17528 T: std::convert::Into<std::string::String>,
17529 {
17530 self.creator_iam_principal = std::option::Option::Some(v.into());
17531 self
17532 }
17533
17534 /// Sets or clears the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
17535 ///
17536 /// # Example
17537 /// ```ignore,no_run
17538 /// # use google_cloud_dataform_v1::model::TeamFolder;
17539 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(Some("example"));
17540 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(None::<String>);
17541 /// ```
17542 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
17543 where
17544 T: std::convert::Into<std::string::String>,
17545 {
17546 self.creator_iam_principal = v.map(|x| x.into());
17547 self
17548 }
17549}
17550
17551impl wkt::message::Message for TeamFolder {
17552 fn typename() -> &'static str {
17553 "type.googleapis.com/google.cloud.dataform.v1.TeamFolder"
17554 }
17555}
17556
17557/// `CreateTeamFolder` request message.
17558#[derive(Clone, Default, PartialEq)]
17559#[non_exhaustive]
17560pub struct CreateTeamFolderRequest {
17561 /// Required. The location in which to create the TeamFolder. Must be in the
17562 /// format `projects/*/locations/*`.
17563 pub parent: std::string::String,
17564
17565 /// Required. The TeamFolder to create.
17566 pub team_folder: std::option::Option<crate::model::TeamFolder>,
17567
17568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17569}
17570
17571impl CreateTeamFolderRequest {
17572 /// Creates a new default instance.
17573 pub fn new() -> Self {
17574 std::default::Default::default()
17575 }
17576
17577 /// Sets the value of [parent][crate::model::CreateTeamFolderRequest::parent].
17578 ///
17579 /// # Example
17580 /// ```ignore,no_run
17581 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17582 /// let x = CreateTeamFolderRequest::new().set_parent("example");
17583 /// ```
17584 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17585 self.parent = v.into();
17586 self
17587 }
17588
17589 /// Sets the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
17590 ///
17591 /// # Example
17592 /// ```ignore,no_run
17593 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17594 /// use google_cloud_dataform_v1::model::TeamFolder;
17595 /// let x = CreateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
17596 /// ```
17597 pub fn set_team_folder<T>(mut self, v: T) -> Self
17598 where
17599 T: std::convert::Into<crate::model::TeamFolder>,
17600 {
17601 self.team_folder = std::option::Option::Some(v.into());
17602 self
17603 }
17604
17605 /// Sets or clears the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
17606 ///
17607 /// # Example
17608 /// ```ignore,no_run
17609 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
17610 /// use google_cloud_dataform_v1::model::TeamFolder;
17611 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
17612 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
17613 /// ```
17614 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
17615 where
17616 T: std::convert::Into<crate::model::TeamFolder>,
17617 {
17618 self.team_folder = v.map(|x| x.into());
17619 self
17620 }
17621}
17622
17623impl wkt::message::Message for CreateTeamFolderRequest {
17624 fn typename() -> &'static str {
17625 "type.googleapis.com/google.cloud.dataform.v1.CreateTeamFolderRequest"
17626 }
17627}
17628
17629/// `GetTeamFolder` request message.
17630#[derive(Clone, Default, PartialEq)]
17631#[non_exhaustive]
17632pub struct GetTeamFolderRequest {
17633 /// Required. The TeamFolder's name.
17634 pub name: std::string::String,
17635
17636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17637}
17638
17639impl GetTeamFolderRequest {
17640 /// Creates a new default instance.
17641 pub fn new() -> Self {
17642 std::default::Default::default()
17643 }
17644
17645 /// Sets the value of [name][crate::model::GetTeamFolderRequest::name].
17646 ///
17647 /// # Example
17648 /// ```ignore,no_run
17649 /// # use google_cloud_dataform_v1::model::GetTeamFolderRequest;
17650 /// # let project_id = "project_id";
17651 /// # let location_id = "location_id";
17652 /// # let team_folder_id = "team_folder_id";
17653 /// let x = GetTeamFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17654 /// ```
17655 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17656 self.name = v.into();
17657 self
17658 }
17659}
17660
17661impl wkt::message::Message for GetTeamFolderRequest {
17662 fn typename() -> &'static str {
17663 "type.googleapis.com/google.cloud.dataform.v1.GetTeamFolderRequest"
17664 }
17665}
17666
17667/// `UpdateTeamFolder` request message.
17668#[derive(Clone, Default, PartialEq)]
17669#[non_exhaustive]
17670pub struct UpdateTeamFolderRequest {
17671 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
17672 /// all fields will be updated.
17673 pub update_mask: std::option::Option<wkt::FieldMask>,
17674
17675 /// Required. The updated TeamFolder.
17676 pub team_folder: std::option::Option<crate::model::TeamFolder>,
17677
17678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17679}
17680
17681impl UpdateTeamFolderRequest {
17682 /// Creates a new default instance.
17683 pub fn new() -> Self {
17684 std::default::Default::default()
17685 }
17686
17687 /// Sets the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
17688 ///
17689 /// # Example
17690 /// ```ignore,no_run
17691 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17692 /// use wkt::FieldMask;
17693 /// let x = UpdateTeamFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17694 /// ```
17695 pub fn set_update_mask<T>(mut self, v: T) -> Self
17696 where
17697 T: std::convert::Into<wkt::FieldMask>,
17698 {
17699 self.update_mask = std::option::Option::Some(v.into());
17700 self
17701 }
17702
17703 /// Sets or clears the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
17704 ///
17705 /// # Example
17706 /// ```ignore,no_run
17707 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17708 /// use wkt::FieldMask;
17709 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17710 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17711 /// ```
17712 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17713 where
17714 T: std::convert::Into<wkt::FieldMask>,
17715 {
17716 self.update_mask = v.map(|x| x.into());
17717 self
17718 }
17719
17720 /// Sets the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
17721 ///
17722 /// # Example
17723 /// ```ignore,no_run
17724 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17725 /// use google_cloud_dataform_v1::model::TeamFolder;
17726 /// let x = UpdateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
17727 /// ```
17728 pub fn set_team_folder<T>(mut self, v: T) -> Self
17729 where
17730 T: std::convert::Into<crate::model::TeamFolder>,
17731 {
17732 self.team_folder = std::option::Option::Some(v.into());
17733 self
17734 }
17735
17736 /// Sets or clears the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
17737 ///
17738 /// # Example
17739 /// ```ignore,no_run
17740 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
17741 /// use google_cloud_dataform_v1::model::TeamFolder;
17742 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
17743 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
17744 /// ```
17745 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
17746 where
17747 T: std::convert::Into<crate::model::TeamFolder>,
17748 {
17749 self.team_folder = v.map(|x| x.into());
17750 self
17751 }
17752}
17753
17754impl wkt::message::Message for UpdateTeamFolderRequest {
17755 fn typename() -> &'static str {
17756 "type.googleapis.com/google.cloud.dataform.v1.UpdateTeamFolderRequest"
17757 }
17758}
17759
17760/// `DeleteTeamFolder` request message.
17761#[derive(Clone, Default, PartialEq)]
17762#[non_exhaustive]
17763pub struct DeleteTeamFolderRequest {
17764 /// Required. The TeamFolder's name.
17765 pub name: std::string::String,
17766
17767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17768}
17769
17770impl DeleteTeamFolderRequest {
17771 /// Creates a new default instance.
17772 pub fn new() -> Self {
17773 std::default::Default::default()
17774 }
17775
17776 /// Sets the value of [name][crate::model::DeleteTeamFolderRequest::name].
17777 ///
17778 /// # Example
17779 /// ```ignore,no_run
17780 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderRequest;
17781 /// # let project_id = "project_id";
17782 /// # let location_id = "location_id";
17783 /// # let team_folder_id = "team_folder_id";
17784 /// let x = DeleteTeamFolderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17785 /// ```
17786 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17787 self.name = v.into();
17788 self
17789 }
17790}
17791
17792impl wkt::message::Message for DeleteTeamFolderRequest {
17793 fn typename() -> &'static str {
17794 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderRequest"
17795 }
17796}
17797
17798/// `QueryTeamFolderContents` request message.
17799#[derive(Clone, Default, PartialEq)]
17800#[non_exhaustive]
17801pub struct QueryTeamFolderContentsRequest {
17802 /// Required. Resource name of the TeamFolder to list contents for.
17803 /// Format: `projects/*/locations/*/teamFolders/*`.
17804 pub team_folder: std::string::String,
17805
17806 /// Optional. Maximum number of paths to return. The server may return fewer
17807 /// items than requested. If unspecified, the server will pick an appropriate
17808 /// default.
17809 pub page_size: i32,
17810
17811 /// Optional. Page token received from a previous `QueryTeamFolderContents`
17812 /// call. Provide this to retrieve the subsequent page.
17813 ///
17814 /// When paginating, all other parameters provided to
17815 /// `QueryTeamFolderContents`, with the exception of `page_size`, must match
17816 /// the call that provided the page token.
17817 pub page_token: std::string::String,
17818
17819 /// Optional. Field to additionally sort results by.
17820 /// Will order Folders before Repositories, and then by `order_by` in ascending
17821 /// order. Supported keywords: `display_name` (default), `create_time`,
17822 /// last_modified_time.
17823 /// Examples:
17824 ///
17825 /// * `orderBy="display_name"`
17826 /// * `orderBy="display_name desc"`
17827 pub order_by: std::string::String,
17828
17829 /// Optional. Optional filtering for the returned list. Filtering is currently
17830 /// only supported on the `display_name` field.
17831 ///
17832 /// Example:
17833 ///
17834 /// * `filter="display_name="MyFolder""`
17835 pub filter: std::string::String,
17836
17837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17838}
17839
17840impl QueryTeamFolderContentsRequest {
17841 /// Creates a new default instance.
17842 pub fn new() -> Self {
17843 std::default::Default::default()
17844 }
17845
17846 /// Sets the value of [team_folder][crate::model::QueryTeamFolderContentsRequest::team_folder].
17847 ///
17848 /// # Example
17849 /// ```ignore,no_run
17850 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17851 /// # let project_id = "project_id";
17852 /// # let location_id = "location_id";
17853 /// # let team_folder_id = "team_folder_id";
17854 /// let x = QueryTeamFolderContentsRequest::new().set_team_folder(format!("projects/{project_id}/locations/{location_id}/teamFolders/{team_folder_id}"));
17855 /// ```
17856 pub fn set_team_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17857 self.team_folder = v.into();
17858 self
17859 }
17860
17861 /// Sets the value of [page_size][crate::model::QueryTeamFolderContentsRequest::page_size].
17862 ///
17863 /// # Example
17864 /// ```ignore,no_run
17865 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17866 /// let x = QueryTeamFolderContentsRequest::new().set_page_size(42);
17867 /// ```
17868 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17869 self.page_size = v.into();
17870 self
17871 }
17872
17873 /// Sets the value of [page_token][crate::model::QueryTeamFolderContentsRequest::page_token].
17874 ///
17875 /// # Example
17876 /// ```ignore,no_run
17877 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17878 /// let x = QueryTeamFolderContentsRequest::new().set_page_token("example");
17879 /// ```
17880 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17881 self.page_token = v.into();
17882 self
17883 }
17884
17885 /// Sets the value of [order_by][crate::model::QueryTeamFolderContentsRequest::order_by].
17886 ///
17887 /// # Example
17888 /// ```ignore,no_run
17889 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17890 /// let x = QueryTeamFolderContentsRequest::new().set_order_by("example");
17891 /// ```
17892 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17893 self.order_by = v.into();
17894 self
17895 }
17896
17897 /// Sets the value of [filter][crate::model::QueryTeamFolderContentsRequest::filter].
17898 ///
17899 /// # Example
17900 /// ```ignore,no_run
17901 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
17902 /// let x = QueryTeamFolderContentsRequest::new().set_filter("example");
17903 /// ```
17904 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17905 self.filter = v.into();
17906 self
17907 }
17908}
17909
17910impl wkt::message::Message for QueryTeamFolderContentsRequest {
17911 fn typename() -> &'static str {
17912 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsRequest"
17913 }
17914}
17915
17916/// `QueryTeamFolderContents` response message.
17917#[derive(Clone, Default, PartialEq)]
17918#[non_exhaustive]
17919pub struct QueryTeamFolderContentsResponse {
17920 /// List of entries in the TeamFolder.
17921 pub entries:
17922 std::vec::Vec<crate::model::query_team_folder_contents_response::TeamFolderContentsEntry>,
17923
17924 /// A token, which can be sent as `page_token` to retrieve the next page.
17925 /// If this field is omitted, there are no subsequent pages.
17926 pub next_page_token: std::string::String,
17927
17928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17929}
17930
17931impl QueryTeamFolderContentsResponse {
17932 /// Creates a new default instance.
17933 pub fn new() -> Self {
17934 std::default::Default::default()
17935 }
17936
17937 /// Sets the value of [entries][crate::model::QueryTeamFolderContentsResponse::entries].
17938 ///
17939 /// # Example
17940 /// ```ignore,no_run
17941 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
17942 /// use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17943 /// let x = QueryTeamFolderContentsResponse::new()
17944 /// .set_entries([
17945 /// TeamFolderContentsEntry::default()/* use setters */,
17946 /// TeamFolderContentsEntry::default()/* use (different) setters */,
17947 /// ]);
17948 /// ```
17949 pub fn set_entries<T, V>(mut self, v: T) -> Self
17950 where
17951 T: std::iter::IntoIterator<Item = V>,
17952 V: std::convert::Into<
17953 crate::model::query_team_folder_contents_response::TeamFolderContentsEntry,
17954 >,
17955 {
17956 use std::iter::Iterator;
17957 self.entries = v.into_iter().map(|i| i.into()).collect();
17958 self
17959 }
17960
17961 /// Sets the value of [next_page_token][crate::model::QueryTeamFolderContentsResponse::next_page_token].
17962 ///
17963 /// # Example
17964 /// ```ignore,no_run
17965 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
17966 /// let x = QueryTeamFolderContentsResponse::new().set_next_page_token("example");
17967 /// ```
17968 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17969 self.next_page_token = v.into();
17970 self
17971 }
17972}
17973
17974impl wkt::message::Message for QueryTeamFolderContentsResponse {
17975 fn typename() -> &'static str {
17976 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse"
17977 }
17978}
17979
17980#[doc(hidden)]
17981impl google_cloud_gax::paginator::internal::PageableResponse for QueryTeamFolderContentsResponse {
17982 type PageItem = crate::model::query_team_folder_contents_response::TeamFolderContentsEntry;
17983
17984 fn items(self) -> std::vec::Vec<Self::PageItem> {
17985 self.entries
17986 }
17987
17988 fn next_page_token(&self) -> std::string::String {
17989 use std::clone::Clone;
17990 self.next_page_token.clone()
17991 }
17992}
17993
17994/// Defines additional types related to [QueryTeamFolderContentsResponse].
17995pub mod query_team_folder_contents_response {
17996 #[allow(unused_imports)]
17997 use super::*;
17998
17999 /// Represents a single content entry.
18000 #[derive(Clone, Default, PartialEq)]
18001 #[non_exhaustive]
18002 pub struct TeamFolderContentsEntry {
18003 /// The content entry.
18004 pub entry: std::option::Option<
18005 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry,
18006 >,
18007
18008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18009 }
18010
18011 impl TeamFolderContentsEntry {
18012 /// Creates a new default instance.
18013 pub fn new() -> Self {
18014 std::default::Default::default()
18015 }
18016
18017 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry].
18018 ///
18019 /// Note that all the setters affecting `entry` are mutually
18020 /// exclusive.
18021 ///
18022 /// # Example
18023 /// ```ignore,no_run
18024 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
18025 /// use google_cloud_dataform_v1::model::Folder;
18026 /// let x = TeamFolderContentsEntry::new().set_entry(Some(
18027 /// google_cloud_dataform_v1::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(Folder::default().into())));
18028 /// ```
18029 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
18030{
18031 self.entry = v.into();
18032 self
18033 }
18034
18035 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
18036 /// if it holds a `Folder`, `None` if the field is not set or
18037 /// holds a different branch.
18038 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
18039 #[allow(unreachable_patterns)]
18040 self.entry.as_ref().and_then(|v| match v {
18041 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
18042 _ => std::option::Option::None,
18043 })
18044 }
18045
18046 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
18047 /// to hold a `Folder`.
18048 ///
18049 /// Note that all the setters affecting `entry` are
18050 /// mutually exclusive.
18051 ///
18052 /// # Example
18053 /// ```ignore,no_run
18054 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
18055 /// use google_cloud_dataform_v1::model::Folder;
18056 /// let x = TeamFolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
18057 /// assert!(x.folder().is_some());
18058 /// assert!(x.repository().is_none());
18059 /// ```
18060 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
18061 mut self,
18062 v: T,
18063 ) -> Self {
18064 self.entry = std::option::Option::Some(
18065 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(
18066 v.into()
18067 )
18068 );
18069 self
18070 }
18071
18072 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
18073 /// if it holds a `Repository`, `None` if the field is not set or
18074 /// holds a different branch.
18075 pub fn repository(
18076 &self,
18077 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
18078 #[allow(unreachable_patterns)]
18079 self.entry.as_ref().and_then(|v| match v {
18080 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
18081 _ => std::option::Option::None,
18082 })
18083 }
18084
18085 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
18086 /// to hold a `Repository`.
18087 ///
18088 /// Note that all the setters affecting `entry` are
18089 /// mutually exclusive.
18090 ///
18091 /// # Example
18092 /// ```ignore,no_run
18093 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
18094 /// use google_cloud_dataform_v1::model::Repository;
18095 /// let x = TeamFolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
18096 /// assert!(x.repository().is_some());
18097 /// assert!(x.folder().is_none());
18098 /// ```
18099 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
18100 mut self,
18101 v: T,
18102 ) -> Self {
18103 self.entry = std::option::Option::Some(
18104 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(
18105 v.into()
18106 )
18107 );
18108 self
18109 }
18110 }
18111
18112 impl wkt::message::Message for TeamFolderContentsEntry {
18113 fn typename() -> &'static str {
18114 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry"
18115 }
18116 }
18117
18118 /// Defines additional types related to [TeamFolderContentsEntry].
18119 pub mod team_folder_contents_entry {
18120 #[allow(unused_imports)]
18121 use super::*;
18122
18123 /// The content entry.
18124 #[derive(Clone, Debug, PartialEq)]
18125 #[non_exhaustive]
18126 pub enum Entry {
18127 /// A subfolder.
18128 Folder(std::boxed::Box<crate::model::Folder>),
18129 /// A repository.
18130 Repository(std::boxed::Box<crate::model::Repository>),
18131 }
18132 }
18133}
18134
18135/// `SearchTeamFolders` request message.
18136#[derive(Clone, Default, PartialEq)]
18137#[non_exhaustive]
18138pub struct SearchTeamFoldersRequest {
18139 /// Required. Location in which to query TeamFolders.
18140 /// Format: `projects/*/locations/*`.
18141 pub location: std::string::String,
18142
18143 /// Optional. Maximum number of `TeamFolders` to return. The server may return
18144 /// fewer items than requested. If unspecified, the server will pick a default
18145 /// of `page_size` = 50.
18146 pub page_size: i32,
18147
18148 /// Optional. Page token received from a previous `SearchTeamFolders` call.
18149 /// Provide this to retrieve the subsequent page.
18150 ///
18151 /// When paginating, all other parameters provided to
18152 /// `SearchTeamFolders`, with the exception of `page_size`, must
18153 /// match the call that provided the page token.
18154 pub page_token: std::string::String,
18155
18156 /// Optional. Field to additionally sort results by.
18157 /// Supported keywords: `display_name` (default), `create_time`,
18158 /// `last_modified_time`. Examples:
18159 ///
18160 /// * `orderBy="display_name"`
18161 /// * `orderBy="display_name desc"`
18162 pub order_by: std::string::String,
18163
18164 /// Optional. Optional filtering for the returned list. Filtering is currently
18165 /// only supported on the `display_name` field.
18166 ///
18167 /// Example:
18168 ///
18169 /// * `filter="display_name="MyFolder""`
18170 pub filter: std::string::String,
18171
18172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18173}
18174
18175impl SearchTeamFoldersRequest {
18176 /// Creates a new default instance.
18177 pub fn new() -> Self {
18178 std::default::Default::default()
18179 }
18180
18181 /// Sets the value of [location][crate::model::SearchTeamFoldersRequest::location].
18182 ///
18183 /// # Example
18184 /// ```ignore,no_run
18185 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
18186 /// let x = SearchTeamFoldersRequest::new().set_location("example");
18187 /// ```
18188 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18189 self.location = v.into();
18190 self
18191 }
18192
18193 /// Sets the value of [page_size][crate::model::SearchTeamFoldersRequest::page_size].
18194 ///
18195 /// # Example
18196 /// ```ignore,no_run
18197 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
18198 /// let x = SearchTeamFoldersRequest::new().set_page_size(42);
18199 /// ```
18200 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18201 self.page_size = v.into();
18202 self
18203 }
18204
18205 /// Sets the value of [page_token][crate::model::SearchTeamFoldersRequest::page_token].
18206 ///
18207 /// # Example
18208 /// ```ignore,no_run
18209 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
18210 /// let x = SearchTeamFoldersRequest::new().set_page_token("example");
18211 /// ```
18212 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18213 self.page_token = v.into();
18214 self
18215 }
18216
18217 /// Sets the value of [order_by][crate::model::SearchTeamFoldersRequest::order_by].
18218 ///
18219 /// # Example
18220 /// ```ignore,no_run
18221 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
18222 /// let x = SearchTeamFoldersRequest::new().set_order_by("example");
18223 /// ```
18224 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18225 self.order_by = v.into();
18226 self
18227 }
18228
18229 /// Sets the value of [filter][crate::model::SearchTeamFoldersRequest::filter].
18230 ///
18231 /// # Example
18232 /// ```ignore,no_run
18233 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
18234 /// let x = SearchTeamFoldersRequest::new().set_filter("example");
18235 /// ```
18236 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18237 self.filter = v.into();
18238 self
18239 }
18240}
18241
18242impl wkt::message::Message for SearchTeamFoldersRequest {
18243 fn typename() -> &'static str {
18244 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersRequest"
18245 }
18246}
18247
18248/// `SearchTeamFolders` response message.
18249#[derive(Clone, Default, PartialEq)]
18250#[non_exhaustive]
18251pub struct SearchTeamFoldersResponse {
18252 /// List of TeamFolders that match the search query.
18253 pub results: std::vec::Vec<crate::model::search_team_folders_response::TeamFolderSearchResult>,
18254
18255 /// A token, which can be sent as `page_token` to retrieve the next page.
18256 /// If this field is omitted, there are no subsequent pages.
18257 pub next_page_token: std::string::String,
18258
18259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18260}
18261
18262impl SearchTeamFoldersResponse {
18263 /// Creates a new default instance.
18264 pub fn new() -> Self {
18265 std::default::Default::default()
18266 }
18267
18268 /// Sets the value of [results][crate::model::SearchTeamFoldersResponse::results].
18269 ///
18270 /// # Example
18271 /// ```ignore,no_run
18272 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
18273 /// use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18274 /// let x = SearchTeamFoldersResponse::new()
18275 /// .set_results([
18276 /// TeamFolderSearchResult::default()/* use setters */,
18277 /// TeamFolderSearchResult::default()/* use (different) setters */,
18278 /// ]);
18279 /// ```
18280 pub fn set_results<T, V>(mut self, v: T) -> Self
18281 where
18282 T: std::iter::IntoIterator<Item = V>,
18283 V: std::convert::Into<crate::model::search_team_folders_response::TeamFolderSearchResult>,
18284 {
18285 use std::iter::Iterator;
18286 self.results = v.into_iter().map(|i| i.into()).collect();
18287 self
18288 }
18289
18290 /// Sets the value of [next_page_token][crate::model::SearchTeamFoldersResponse::next_page_token].
18291 ///
18292 /// # Example
18293 /// ```ignore,no_run
18294 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
18295 /// let x = SearchTeamFoldersResponse::new().set_next_page_token("example");
18296 /// ```
18297 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18298 self.next_page_token = v.into();
18299 self
18300 }
18301}
18302
18303impl wkt::message::Message for SearchTeamFoldersResponse {
18304 fn typename() -> &'static str {
18305 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse"
18306 }
18307}
18308
18309#[doc(hidden)]
18310impl google_cloud_gax::paginator::internal::PageableResponse for SearchTeamFoldersResponse {
18311 type PageItem = crate::model::search_team_folders_response::TeamFolderSearchResult;
18312
18313 fn items(self) -> std::vec::Vec<Self::PageItem> {
18314 self.results
18315 }
18316
18317 fn next_page_token(&self) -> std::string::String {
18318 use std::clone::Clone;
18319 self.next_page_token.clone()
18320 }
18321}
18322
18323/// Defines additional types related to [SearchTeamFoldersResponse].
18324pub mod search_team_folders_response {
18325 #[allow(unused_imports)]
18326 use super::*;
18327
18328 /// Represents a single content entry.
18329 #[derive(Clone, Default, PartialEq)]
18330 #[non_exhaustive]
18331 pub struct TeamFolderSearchResult {
18332 /// The content entry.
18333 pub entry: std::option::Option<
18334 crate::model::search_team_folders_response::team_folder_search_result::Entry,
18335 >,
18336
18337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18338 }
18339
18340 impl TeamFolderSearchResult {
18341 /// Creates a new default instance.
18342 pub fn new() -> Self {
18343 std::default::Default::default()
18344 }
18345
18346 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry].
18347 ///
18348 /// Note that all the setters affecting `entry` are mutually
18349 /// exclusive.
18350 ///
18351 /// # Example
18352 /// ```ignore,no_run
18353 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18354 /// use google_cloud_dataform_v1::model::TeamFolder;
18355 /// let x = TeamFolderSearchResult::new().set_entry(Some(
18356 /// google_cloud_dataform_v1::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(TeamFolder::default().into())));
18357 /// ```
18358 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
18359{
18360 self.entry = v.into();
18361 self
18362 }
18363
18364 /// The value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
18365 /// if it holds a `TeamFolder`, `None` if the field is not set or
18366 /// holds a different branch.
18367 pub fn team_folder(
18368 &self,
18369 ) -> std::option::Option<&std::boxed::Box<crate::model::TeamFolder>> {
18370 #[allow(unreachable_patterns)]
18371 self.entry.as_ref().and_then(|v| match v {
18372 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(v) => std::option::Option::Some(v),
18373 _ => std::option::Option::None,
18374 })
18375 }
18376
18377 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
18378 /// to hold a `TeamFolder`.
18379 ///
18380 /// Note that all the setters affecting `entry` are
18381 /// mutually exclusive.
18382 ///
18383 /// # Example
18384 /// ```ignore,no_run
18385 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
18386 /// use google_cloud_dataform_v1::model::TeamFolder;
18387 /// let x = TeamFolderSearchResult::new().set_team_folder(TeamFolder::default()/* use setters */);
18388 /// assert!(x.team_folder().is_some());
18389 /// ```
18390 pub fn set_team_folder<T: std::convert::Into<std::boxed::Box<crate::model::TeamFolder>>>(
18391 mut self,
18392 v: T,
18393 ) -> Self {
18394 self.entry = std::option::Option::Some(
18395 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(
18396 v.into()
18397 )
18398 );
18399 self
18400 }
18401 }
18402
18403 impl wkt::message::Message for TeamFolderSearchResult {
18404 fn typename() -> &'static str {
18405 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse.TeamFolderSearchResult"
18406 }
18407 }
18408
18409 /// Defines additional types related to [TeamFolderSearchResult].
18410 pub mod team_folder_search_result {
18411 #[allow(unused_imports)]
18412 use super::*;
18413
18414 /// The content entry.
18415 #[derive(Clone, Debug, PartialEq)]
18416 #[non_exhaustive]
18417 pub enum Entry {
18418 /// A TeamFolder resource that is in the project / location.
18419 TeamFolder(std::boxed::Box<crate::model::TeamFolder>),
18420 }
18421 }
18422}
18423
18424/// Contains metadata about the progress of the MoveFolder Long-running
18425/// operations.
18426#[derive(Clone, Default, PartialEq)]
18427#[non_exhaustive]
18428pub struct MoveFolderMetadata {
18429 /// Output only. The time the operation was created.
18430 pub create_time: std::option::Option<wkt::Timestamp>,
18431
18432 /// Output only. The time the operation finished running.
18433 pub end_time: std::option::Option<wkt::Timestamp>,
18434
18435 /// Output only. Server-defined resource path for the target of the operation.
18436 pub target: std::string::String,
18437
18438 /// The state of the move.
18439 pub state: crate::model::move_folder_metadata::State,
18440
18441 /// Percent complete of the move [0, 100].
18442 pub percent_complete: i32,
18443
18444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18445}
18446
18447impl MoveFolderMetadata {
18448 /// Creates a new default instance.
18449 pub fn new() -> Self {
18450 std::default::Default::default()
18451 }
18452
18453 /// Sets the value of [create_time][crate::model::MoveFolderMetadata::create_time].
18454 ///
18455 /// # Example
18456 /// ```ignore,no_run
18457 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18458 /// use wkt::Timestamp;
18459 /// let x = MoveFolderMetadata::new().set_create_time(Timestamp::default()/* use setters */);
18460 /// ```
18461 pub fn set_create_time<T>(mut self, v: T) -> Self
18462 where
18463 T: std::convert::Into<wkt::Timestamp>,
18464 {
18465 self.create_time = std::option::Option::Some(v.into());
18466 self
18467 }
18468
18469 /// Sets or clears the value of [create_time][crate::model::MoveFolderMetadata::create_time].
18470 ///
18471 /// # Example
18472 /// ```ignore,no_run
18473 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18474 /// use wkt::Timestamp;
18475 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18476 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(None::<Timestamp>);
18477 /// ```
18478 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18479 where
18480 T: std::convert::Into<wkt::Timestamp>,
18481 {
18482 self.create_time = v.map(|x| x.into());
18483 self
18484 }
18485
18486 /// Sets the value of [end_time][crate::model::MoveFolderMetadata::end_time].
18487 ///
18488 /// # Example
18489 /// ```ignore,no_run
18490 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18491 /// use wkt::Timestamp;
18492 /// let x = MoveFolderMetadata::new().set_end_time(Timestamp::default()/* use setters */);
18493 /// ```
18494 pub fn set_end_time<T>(mut self, v: T) -> Self
18495 where
18496 T: std::convert::Into<wkt::Timestamp>,
18497 {
18498 self.end_time = std::option::Option::Some(v.into());
18499 self
18500 }
18501
18502 /// Sets or clears the value of [end_time][crate::model::MoveFolderMetadata::end_time].
18503 ///
18504 /// # Example
18505 /// ```ignore,no_run
18506 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18507 /// use wkt::Timestamp;
18508 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
18509 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(None::<Timestamp>);
18510 /// ```
18511 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18512 where
18513 T: std::convert::Into<wkt::Timestamp>,
18514 {
18515 self.end_time = v.map(|x| x.into());
18516 self
18517 }
18518
18519 /// Sets the value of [target][crate::model::MoveFolderMetadata::target].
18520 ///
18521 /// # Example
18522 /// ```ignore,no_run
18523 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18524 /// let x = MoveFolderMetadata::new().set_target("example");
18525 /// ```
18526 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18527 self.target = v.into();
18528 self
18529 }
18530
18531 /// Sets the value of [state][crate::model::MoveFolderMetadata::state].
18532 ///
18533 /// # Example
18534 /// ```ignore,no_run
18535 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18536 /// use google_cloud_dataform_v1::model::move_folder_metadata::State;
18537 /// let x0 = MoveFolderMetadata::new().set_state(State::Initialized);
18538 /// let x1 = MoveFolderMetadata::new().set_state(State::InProgress);
18539 /// let x2 = MoveFolderMetadata::new().set_state(State::Success);
18540 /// ```
18541 pub fn set_state<T: std::convert::Into<crate::model::move_folder_metadata::State>>(
18542 mut self,
18543 v: T,
18544 ) -> Self {
18545 self.state = v.into();
18546 self
18547 }
18548
18549 /// Sets the value of [percent_complete][crate::model::MoveFolderMetadata::percent_complete].
18550 ///
18551 /// # Example
18552 /// ```ignore,no_run
18553 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
18554 /// let x = MoveFolderMetadata::new().set_percent_complete(42);
18555 /// ```
18556 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18557 self.percent_complete = v.into();
18558 self
18559 }
18560}
18561
18562impl wkt::message::Message for MoveFolderMetadata {
18563 fn typename() -> &'static str {
18564 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderMetadata"
18565 }
18566}
18567
18568/// Defines additional types related to [MoveFolderMetadata].
18569pub mod move_folder_metadata {
18570 #[allow(unused_imports)]
18571 use super::*;
18572
18573 /// Different states of the move.
18574 ///
18575 /// # Working with unknown values
18576 ///
18577 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18578 /// additional enum variants at any time. Adding new variants is not considered
18579 /// a breaking change. Applications should write their code in anticipation of:
18580 ///
18581 /// - New values appearing in future releases of the client library, **and**
18582 /// - New values received dynamically, without application changes.
18583 ///
18584 /// Please consult the [Working with enums] section in the user guide for some
18585 /// guidelines.
18586 ///
18587 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18588 #[derive(Clone, Debug, PartialEq)]
18589 #[non_exhaustive]
18590 pub enum State {
18591 /// The state is unspecified.
18592 Unspecified,
18593 /// The move was initialized and recorded by the server, but not yet started.
18594 Initialized,
18595 /// The move is in progress.
18596 InProgress,
18597 /// The move has completed successfully.
18598 Success,
18599 /// The move has failed.
18600 Failed,
18601 /// If set, the enum was initialized with an unknown value.
18602 ///
18603 /// Applications can examine the value using [State::value] or
18604 /// [State::name].
18605 UnknownValue(state::UnknownValue),
18606 }
18607
18608 #[doc(hidden)]
18609 pub mod state {
18610 #[allow(unused_imports)]
18611 use super::*;
18612 #[derive(Clone, Debug, PartialEq)]
18613 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18614 }
18615
18616 impl State {
18617 /// Gets the enum value.
18618 ///
18619 /// Returns `None` if the enum contains an unknown value deserialized from
18620 /// the string representation of enums.
18621 pub fn value(&self) -> std::option::Option<i32> {
18622 match self {
18623 Self::Unspecified => std::option::Option::Some(0),
18624 Self::Initialized => std::option::Option::Some(1),
18625 Self::InProgress => std::option::Option::Some(2),
18626 Self::Success => std::option::Option::Some(3),
18627 Self::Failed => std::option::Option::Some(4),
18628 Self::UnknownValue(u) => u.0.value(),
18629 }
18630 }
18631
18632 /// Gets the enum value as a string.
18633 ///
18634 /// Returns `None` if the enum contains an unknown value deserialized from
18635 /// the integer representation of enums.
18636 pub fn name(&self) -> std::option::Option<&str> {
18637 match self {
18638 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18639 Self::Initialized => std::option::Option::Some("INITIALIZED"),
18640 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18641 Self::Success => std::option::Option::Some("SUCCESS"),
18642 Self::Failed => std::option::Option::Some("FAILED"),
18643 Self::UnknownValue(u) => u.0.name(),
18644 }
18645 }
18646 }
18647
18648 impl std::default::Default for State {
18649 fn default() -> Self {
18650 use std::convert::From;
18651 Self::from(0)
18652 }
18653 }
18654
18655 impl std::fmt::Display for State {
18656 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18657 wkt::internal::display_enum(f, self.name(), self.value())
18658 }
18659 }
18660
18661 impl std::convert::From<i32> for State {
18662 fn from(value: i32) -> Self {
18663 match value {
18664 0 => Self::Unspecified,
18665 1 => Self::Initialized,
18666 2 => Self::InProgress,
18667 3 => Self::Success,
18668 4 => Self::Failed,
18669 _ => Self::UnknownValue(state::UnknownValue(
18670 wkt::internal::UnknownEnumValue::Integer(value),
18671 )),
18672 }
18673 }
18674 }
18675
18676 impl std::convert::From<&str> for State {
18677 fn from(value: &str) -> Self {
18678 use std::string::ToString;
18679 match value {
18680 "STATE_UNSPECIFIED" => Self::Unspecified,
18681 "INITIALIZED" => Self::Initialized,
18682 "IN_PROGRESS" => Self::InProgress,
18683 "SUCCESS" => Self::Success,
18684 "FAILED" => Self::Failed,
18685 _ => Self::UnknownValue(state::UnknownValue(
18686 wkt::internal::UnknownEnumValue::String(value.to_string()),
18687 )),
18688 }
18689 }
18690 }
18691
18692 impl serde::ser::Serialize for State {
18693 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18694 where
18695 S: serde::Serializer,
18696 {
18697 match self {
18698 Self::Unspecified => serializer.serialize_i32(0),
18699 Self::Initialized => serializer.serialize_i32(1),
18700 Self::InProgress => serializer.serialize_i32(2),
18701 Self::Success => serializer.serialize_i32(3),
18702 Self::Failed => serializer.serialize_i32(4),
18703 Self::UnknownValue(u) => u.0.serialize(serializer),
18704 }
18705 }
18706 }
18707
18708 impl<'de> serde::de::Deserialize<'de> for State {
18709 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18710 where
18711 D: serde::Deserializer<'de>,
18712 {
18713 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18714 ".google.cloud.dataform.v1.MoveFolderMetadata.State",
18715 ))
18716 }
18717 }
18718}
18719
18720/// Contains metadata about the progress of the MoveRepository Long-running
18721/// operations.
18722#[derive(Clone, Default, PartialEq)]
18723#[non_exhaustive]
18724pub struct MoveRepositoryMetadata {
18725 /// Output only. The time the operation was created.
18726 pub create_time: std::option::Option<wkt::Timestamp>,
18727
18728 /// Output only. The time the operation finished running.
18729 pub end_time: std::option::Option<wkt::Timestamp>,
18730
18731 /// Output only. Server-defined resource path for the target of the operation.
18732 pub target: std::string::String,
18733
18734 /// The state of the move.
18735 pub state: crate::model::move_repository_metadata::State,
18736
18737 /// Percent complete of the move [0, 100].
18738 pub percent_complete: i32,
18739
18740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18741}
18742
18743impl MoveRepositoryMetadata {
18744 /// Creates a new default instance.
18745 pub fn new() -> Self {
18746 std::default::Default::default()
18747 }
18748
18749 /// Sets the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
18750 ///
18751 /// # Example
18752 /// ```ignore,no_run
18753 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18754 /// use wkt::Timestamp;
18755 /// let x = MoveRepositoryMetadata::new().set_create_time(Timestamp::default()/* use setters */);
18756 /// ```
18757 pub fn set_create_time<T>(mut self, v: T) -> Self
18758 where
18759 T: std::convert::Into<wkt::Timestamp>,
18760 {
18761 self.create_time = std::option::Option::Some(v.into());
18762 self
18763 }
18764
18765 /// Sets or clears the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
18766 ///
18767 /// # Example
18768 /// ```ignore,no_run
18769 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18770 /// use wkt::Timestamp;
18771 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18772 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(None::<Timestamp>);
18773 /// ```
18774 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18775 where
18776 T: std::convert::Into<wkt::Timestamp>,
18777 {
18778 self.create_time = v.map(|x| x.into());
18779 self
18780 }
18781
18782 /// Sets the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
18783 ///
18784 /// # Example
18785 /// ```ignore,no_run
18786 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18787 /// use wkt::Timestamp;
18788 /// let x = MoveRepositoryMetadata::new().set_end_time(Timestamp::default()/* use setters */);
18789 /// ```
18790 pub fn set_end_time<T>(mut self, v: T) -> Self
18791 where
18792 T: std::convert::Into<wkt::Timestamp>,
18793 {
18794 self.end_time = std::option::Option::Some(v.into());
18795 self
18796 }
18797
18798 /// Sets or clears the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
18799 ///
18800 /// # Example
18801 /// ```ignore,no_run
18802 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18803 /// use wkt::Timestamp;
18804 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
18805 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(None::<Timestamp>);
18806 /// ```
18807 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18808 where
18809 T: std::convert::Into<wkt::Timestamp>,
18810 {
18811 self.end_time = v.map(|x| x.into());
18812 self
18813 }
18814
18815 /// Sets the value of [target][crate::model::MoveRepositoryMetadata::target].
18816 ///
18817 /// # Example
18818 /// ```ignore,no_run
18819 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18820 /// let x = MoveRepositoryMetadata::new().set_target("example");
18821 /// ```
18822 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18823 self.target = v.into();
18824 self
18825 }
18826
18827 /// Sets the value of [state][crate::model::MoveRepositoryMetadata::state].
18828 ///
18829 /// # Example
18830 /// ```ignore,no_run
18831 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18832 /// use google_cloud_dataform_v1::model::move_repository_metadata::State;
18833 /// let x0 = MoveRepositoryMetadata::new().set_state(State::Initialized);
18834 /// let x1 = MoveRepositoryMetadata::new().set_state(State::InProgress);
18835 /// let x2 = MoveRepositoryMetadata::new().set_state(State::Success);
18836 /// ```
18837 pub fn set_state<T: std::convert::Into<crate::model::move_repository_metadata::State>>(
18838 mut self,
18839 v: T,
18840 ) -> Self {
18841 self.state = v.into();
18842 self
18843 }
18844
18845 /// Sets the value of [percent_complete][crate::model::MoveRepositoryMetadata::percent_complete].
18846 ///
18847 /// # Example
18848 /// ```ignore,no_run
18849 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
18850 /// let x = MoveRepositoryMetadata::new().set_percent_complete(42);
18851 /// ```
18852 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18853 self.percent_complete = v.into();
18854 self
18855 }
18856}
18857
18858impl wkt::message::Message for MoveRepositoryMetadata {
18859 fn typename() -> &'static str {
18860 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryMetadata"
18861 }
18862}
18863
18864/// Defines additional types related to [MoveRepositoryMetadata].
18865pub mod move_repository_metadata {
18866 #[allow(unused_imports)]
18867 use super::*;
18868
18869 /// Different states of the move.
18870 ///
18871 /// # Working with unknown values
18872 ///
18873 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18874 /// additional enum variants at any time. Adding new variants is not considered
18875 /// a breaking change. Applications should write their code in anticipation of:
18876 ///
18877 /// - New values appearing in future releases of the client library, **and**
18878 /// - New values received dynamically, without application changes.
18879 ///
18880 /// Please consult the [Working with enums] section in the user guide for some
18881 /// guidelines.
18882 ///
18883 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18884 #[derive(Clone, Debug, PartialEq)]
18885 #[non_exhaustive]
18886 pub enum State {
18887 /// The state is unspecified.
18888 Unspecified,
18889 /// The move was initialized and recorded by the server, but not yet started.
18890 Initialized,
18891 /// The move is in progress.
18892 InProgress,
18893 /// The move has completed successfully.
18894 Success,
18895 /// The move has failed.
18896 Failed,
18897 /// If set, the enum was initialized with an unknown value.
18898 ///
18899 /// Applications can examine the value using [State::value] or
18900 /// [State::name].
18901 UnknownValue(state::UnknownValue),
18902 }
18903
18904 #[doc(hidden)]
18905 pub mod state {
18906 #[allow(unused_imports)]
18907 use super::*;
18908 #[derive(Clone, Debug, PartialEq)]
18909 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18910 }
18911
18912 impl State {
18913 /// Gets the enum value.
18914 ///
18915 /// Returns `None` if the enum contains an unknown value deserialized from
18916 /// the string representation of enums.
18917 pub fn value(&self) -> std::option::Option<i32> {
18918 match self {
18919 Self::Unspecified => std::option::Option::Some(0),
18920 Self::Initialized => std::option::Option::Some(1),
18921 Self::InProgress => std::option::Option::Some(2),
18922 Self::Success => std::option::Option::Some(3),
18923 Self::Failed => std::option::Option::Some(4),
18924 Self::UnknownValue(u) => u.0.value(),
18925 }
18926 }
18927
18928 /// Gets the enum value as a string.
18929 ///
18930 /// Returns `None` if the enum contains an unknown value deserialized from
18931 /// the integer representation of enums.
18932 pub fn name(&self) -> std::option::Option<&str> {
18933 match self {
18934 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18935 Self::Initialized => std::option::Option::Some("INITIALIZED"),
18936 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18937 Self::Success => std::option::Option::Some("SUCCESS"),
18938 Self::Failed => std::option::Option::Some("FAILED"),
18939 Self::UnknownValue(u) => u.0.name(),
18940 }
18941 }
18942 }
18943
18944 impl std::default::Default for State {
18945 fn default() -> Self {
18946 use std::convert::From;
18947 Self::from(0)
18948 }
18949 }
18950
18951 impl std::fmt::Display for State {
18952 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18953 wkt::internal::display_enum(f, self.name(), self.value())
18954 }
18955 }
18956
18957 impl std::convert::From<i32> for State {
18958 fn from(value: i32) -> Self {
18959 match value {
18960 0 => Self::Unspecified,
18961 1 => Self::Initialized,
18962 2 => Self::InProgress,
18963 3 => Self::Success,
18964 4 => Self::Failed,
18965 _ => Self::UnknownValue(state::UnknownValue(
18966 wkt::internal::UnknownEnumValue::Integer(value),
18967 )),
18968 }
18969 }
18970 }
18971
18972 impl std::convert::From<&str> for State {
18973 fn from(value: &str) -> Self {
18974 use std::string::ToString;
18975 match value {
18976 "STATE_UNSPECIFIED" => Self::Unspecified,
18977 "INITIALIZED" => Self::Initialized,
18978 "IN_PROGRESS" => Self::InProgress,
18979 "SUCCESS" => Self::Success,
18980 "FAILED" => Self::Failed,
18981 _ => Self::UnknownValue(state::UnknownValue(
18982 wkt::internal::UnknownEnumValue::String(value.to_string()),
18983 )),
18984 }
18985 }
18986 }
18987
18988 impl serde::ser::Serialize for State {
18989 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18990 where
18991 S: serde::Serializer,
18992 {
18993 match self {
18994 Self::Unspecified => serializer.serialize_i32(0),
18995 Self::Initialized => serializer.serialize_i32(1),
18996 Self::InProgress => serializer.serialize_i32(2),
18997 Self::Success => serializer.serialize_i32(3),
18998 Self::Failed => serializer.serialize_i32(4),
18999 Self::UnknownValue(u) => u.0.serialize(serializer),
19000 }
19001 }
19002 }
19003
19004 impl<'de> serde::de::Deserialize<'de> for State {
19005 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19006 where
19007 D: serde::Deserializer<'de>,
19008 {
19009 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19010 ".google.cloud.dataform.v1.MoveRepositoryMetadata.State",
19011 ))
19012 }
19013 }
19014}
19015
19016/// Represents the level of detail to return for directory contents.
19017///
19018/// # Working with unknown values
19019///
19020/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19021/// additional enum variants at any time. Adding new variants is not considered
19022/// a breaking change. Applications should write their code in anticipation of:
19023///
19024/// - New values appearing in future releases of the client library, **and**
19025/// - New values received dynamically, without application changes.
19026///
19027/// Please consult the [Working with enums] section in the user guide for some
19028/// guidelines.
19029///
19030/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19031#[derive(Clone, Debug, PartialEq)]
19032#[non_exhaustive]
19033pub enum DirectoryContentsView {
19034 /// The default unset value. Defaults to DIRECTORY_CONTENTS_VIEW_BASIC.
19035 Unspecified,
19036 /// Includes only the file or directory name. This is the default behavior.
19037 Basic,
19038 /// Includes all metadata for each file or directory. Currently not supported
19039 /// by CMEK-protected workspaces.
19040 Metadata,
19041 /// If set, the enum was initialized with an unknown value.
19042 ///
19043 /// Applications can examine the value using [DirectoryContentsView::value] or
19044 /// [DirectoryContentsView::name].
19045 UnknownValue(directory_contents_view::UnknownValue),
19046}
19047
19048#[doc(hidden)]
19049pub mod directory_contents_view {
19050 #[allow(unused_imports)]
19051 use super::*;
19052 #[derive(Clone, Debug, PartialEq)]
19053 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19054}
19055
19056impl DirectoryContentsView {
19057 /// Gets the enum value.
19058 ///
19059 /// Returns `None` if the enum contains an unknown value deserialized from
19060 /// the string representation of enums.
19061 pub fn value(&self) -> std::option::Option<i32> {
19062 match self {
19063 Self::Unspecified => std::option::Option::Some(0),
19064 Self::Basic => std::option::Option::Some(1),
19065 Self::Metadata => std::option::Option::Some(2),
19066 Self::UnknownValue(u) => u.0.value(),
19067 }
19068 }
19069
19070 /// Gets the enum value as a string.
19071 ///
19072 /// Returns `None` if the enum contains an unknown value deserialized from
19073 /// the integer representation of enums.
19074 pub fn name(&self) -> std::option::Option<&str> {
19075 match self {
19076 Self::Unspecified => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_UNSPECIFIED"),
19077 Self::Basic => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_BASIC"),
19078 Self::Metadata => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_METADATA"),
19079 Self::UnknownValue(u) => u.0.name(),
19080 }
19081 }
19082}
19083
19084impl std::default::Default for DirectoryContentsView {
19085 fn default() -> Self {
19086 use std::convert::From;
19087 Self::from(0)
19088 }
19089}
19090
19091impl std::fmt::Display for DirectoryContentsView {
19092 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19093 wkt::internal::display_enum(f, self.name(), self.value())
19094 }
19095}
19096
19097impl std::convert::From<i32> for DirectoryContentsView {
19098 fn from(value: i32) -> Self {
19099 match value {
19100 0 => Self::Unspecified,
19101 1 => Self::Basic,
19102 2 => Self::Metadata,
19103 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
19104 wkt::internal::UnknownEnumValue::Integer(value),
19105 )),
19106 }
19107 }
19108}
19109
19110impl std::convert::From<&str> for DirectoryContentsView {
19111 fn from(value: &str) -> Self {
19112 use std::string::ToString;
19113 match value {
19114 "DIRECTORY_CONTENTS_VIEW_UNSPECIFIED" => Self::Unspecified,
19115 "DIRECTORY_CONTENTS_VIEW_BASIC" => Self::Basic,
19116 "DIRECTORY_CONTENTS_VIEW_METADATA" => Self::Metadata,
19117 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
19118 wkt::internal::UnknownEnumValue::String(value.to_string()),
19119 )),
19120 }
19121 }
19122}
19123
19124impl serde::ser::Serialize for DirectoryContentsView {
19125 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19126 where
19127 S: serde::Serializer,
19128 {
19129 match self {
19130 Self::Unspecified => serializer.serialize_i32(0),
19131 Self::Basic => serializer.serialize_i32(1),
19132 Self::Metadata => serializer.serialize_i32(2),
19133 Self::UnknownValue(u) => u.0.serialize(serializer),
19134 }
19135 }
19136}
19137
19138impl<'de> serde::de::Deserialize<'de> for DirectoryContentsView {
19139 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19140 where
19141 D: serde::Deserializer<'de>,
19142 {
19143 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryContentsView>::new(
19144 ".google.cloud.dataform.v1.DirectoryContentsView",
19145 ))
19146 }
19147}