Preview

Struct Preview 

Source
#[non_exhaustive]
pub struct Preview {
Show 21 fields pub name: String, pub create_time: Option<Timestamp>, pub labels: HashMap<String, String>, pub state: State, pub deployment: String, pub preview_mode: PreviewMode, pub service_account: String, pub artifacts_gcs_bucket: Option<String>, pub worker_pool: Option<String>, pub error_code: ErrorCode, pub error_status: Option<Status>, pub build: String, pub tf_errors: Vec<TerraformError>, pub error_logs: String, pub preview_artifacts: Option<PreviewArtifacts>, pub logs: String, pub tf_version: String, pub tf_version_constraint: Option<String>, pub annotations: HashMap<String, String>, pub provider_config: Option<ProviderConfig>, pub blueprint: Option<Blueprint>, /* private fields */
}
Expand description

A preview represents a set of actions Infra Manager would perform to move the resources towards the desired state as specified in the configuration.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Identifier. Resource name of the preview. Resource name can be user provided or server generated ID if unspecified. Format: projects/{project}/locations/{location}/previews/{preview}

§create_time: Option<Timestamp>

Output only. Time the preview was created.

§labels: HashMap<String, String>

Optional. User-defined labels for the preview.

§state: State

Output only. Current state of the preview.

§deployment: String

Optional. Optional deployment reference. If specified, the preview will be performed using the provided deployment’s current state and use any relevant fields from the deployment unless explicitly specified in the preview create request.

§preview_mode: PreviewMode

Optional. Current mode of preview.

§service_account: String

Required. User-specified Service Account (SA) credentials to be used when previewing resources. Format: projects/{projectID}/serviceAccounts/{serviceAccount}

§artifacts_gcs_bucket: Option<String>

Optional. User-defined location of Cloud Build logs, artifacts, and in Google Cloud Storage. Format: gs://{bucket}/{folder} A default bucket will be bootstrapped if the field is not set or empty Default Bucket Format: gs://<project number>-<region>-blueprint-config Constraints:

  • The bucket needs to be in the same project as the deployment
  • The path cannot be within the path of gcs_source If omitted and deployment resource ref provided has artifacts_gcs_bucket defined, that artifact bucket is used.
§worker_pool: Option<String>

Optional. The user-specified Worker Pool resource in which the Cloud Build job will execute. Format projects/{project}/locations/{location}/workerPools/{workerPoolId} If this field is unspecified, the default Cloud Build worker pool will be used. If omitted and deployment resource ref provided has worker_pool defined, that worker pool is used.

§error_code: ErrorCode

Output only. Code describing any errors that may have occurred.

§error_status: Option<Status>

Output only. Additional information regarding the current state.

§build: String

Output only. Cloud Build instance UUID associated with this preview.

§tf_errors: Vec<TerraformError>

Output only. Summary of errors encountered during Terraform preview. It has a size limit of 10, i.e. only top 10 errors will be summarized here.

§error_logs: String

Output only. Link to tf-error.ndjson file, which contains the full list of the errors encountered during a Terraform preview. Format: gs://{bucket}/{object}.

§preview_artifacts: Option<PreviewArtifacts>

Output only. Artifacts from preview.

§logs: String

Output only. Location of preview logs in gs://{bucket}/{object} format.

§tf_version: String

Output only. The current Terraform version set on the preview. It is in the format of “Major.Minor.Patch”, for example, “1.3.10”.

§tf_version_constraint: Option<String>

Optional. The user-specified Terraform version constraint. Example: “=1.3.10”.

§annotations: HashMap<String, String>

Optional. Arbitrary key-value metadata storage e.g. to help client tools identify preview during automation. See https://google.aip.dev/148#annotations for details on format and size limitations.

§provider_config: Option<ProviderConfig>

Optional. This field specifies the provider configurations.

§blueprint: Option<Blueprint>

Blueprint to preview.

Implementations§

Source§

impl Preview

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Preview::new().set_name("example");
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = Preview::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_config_v1::model::preview::State;
let x0 = Preview::new().set_state(State::Creating);
let x1 = Preview::new().set_state(State::Succeeded);
let x2 = Preview::new().set_state(State::Applying);
Source

pub fn set_deployment<T: Into<String>>(self, v: T) -> Self

Sets the value of deployment.

§Example
let x = Preview::new().set_deployment("example");
Source

pub fn set_preview_mode<T: Into<PreviewMode>>(self, v: T) -> Self

Sets the value of preview_mode.

§Example
use google_cloud_config_v1::model::preview::PreviewMode;
let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
Source

pub fn set_service_account<T: Into<String>>(self, v: T) -> Self

Sets the value of service_account.

§Example
let x = Preview::new().set_service_account("example");
Source

pub fn set_artifacts_gcs_bucket<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of artifacts_gcs_bucket.

§Example
let x = Preview::new().set_artifacts_gcs_bucket("example");
Source

pub fn set_or_clear_artifacts_gcs_bucket<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of artifacts_gcs_bucket.

§Example
let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
Source

pub fn set_worker_pool<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of worker_pool.

§Example
let x = Preview::new().set_worker_pool("example");
Source

pub fn set_or_clear_worker_pool<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of worker_pool.

§Example
let x = Preview::new().set_or_clear_worker_pool(Some("example"));
let x = Preview::new().set_or_clear_worker_pool(None::<String>);
Source

pub fn set_error_code<T: Into<ErrorCode>>(self, v: T) -> Self

Sets the value of error_code.

§Example
use google_cloud_config_v1::model::preview::ErrorCode;
let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
Source

pub fn set_error_status<T>(self, v: T) -> Self
where T: Into<Status>,

Sets the value of error_status.

§Example
use rpc::model::Status;
let x = Preview::new().set_error_status(Status::default()/* use setters */);
Source

pub fn set_or_clear_error_status<T>(self, v: Option<T>) -> Self
where T: Into<Status>,

Sets or clears the value of error_status.

§Example
use rpc::model::Status;
let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
let x = Preview::new().set_or_clear_error_status(None::<Status>);
Source

pub fn set_build<T: Into<String>>(self, v: T) -> Self

Sets the value of build.

§Example
let x = Preview::new().set_build("example");
Source

pub fn set_tf_errors<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<TerraformError>,

Sets the value of tf_errors.

§Example
use google_cloud_config_v1::model::TerraformError;
let x = Preview::new()
    .set_tf_errors([
        TerraformError::default()/* use setters */,
        TerraformError::default()/* use (different) setters */,
    ]);
Source

pub fn set_error_logs<T: Into<String>>(self, v: T) -> Self

Sets the value of error_logs.

§Example
let x = Preview::new().set_error_logs("example");
Source

pub fn set_preview_artifacts<T>(self, v: T) -> Self

Sets the value of preview_artifacts.

§Example
use google_cloud_config_v1::model::PreviewArtifacts;
let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
Source

pub fn set_or_clear_preview_artifacts<T>(self, v: Option<T>) -> Self

Sets or clears the value of preview_artifacts.

§Example
use google_cloud_config_v1::model::PreviewArtifacts;
let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
Source

pub fn set_logs<T: Into<String>>(self, v: T) -> Self

Sets the value of logs.

§Example
let x = Preview::new().set_logs("example");
Source

pub fn set_tf_version<T: Into<String>>(self, v: T) -> Self

Sets the value of tf_version.

§Example
let x = Preview::new().set_tf_version("example");
Source

pub fn set_tf_version_constraint<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of tf_version_constraint.

§Example
let x = Preview::new().set_tf_version_constraint("example");
Source

pub fn set_or_clear_tf_version_constraint<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of tf_version_constraint.

§Example
let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
Source

pub fn set_annotations<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of annotations.

§Example
let x = Preview::new().set_annotations([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_provider_config<T>(self, v: T) -> Self
where T: Into<ProviderConfig>,

Sets the value of provider_config.

§Example
use google_cloud_config_v1::model::ProviderConfig;
let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
Source

pub fn set_or_clear_provider_config<T>(self, v: Option<T>) -> Self
where T: Into<ProviderConfig>,

Sets or clears the value of provider_config.

§Example
use google_cloud_config_v1::model::ProviderConfig;
let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
Source

pub fn set_blueprint<T: Into<Option<Blueprint>>>(self, v: T) -> Self

Sets the value of blueprint.

Note that all the setters affecting blueprint are mutually exclusive.

§Example
use google_cloud_config_v1::model::TerraformBlueprint;
let x = Preview::new().set_blueprint(Some(
    google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
Source

pub fn terraform_blueprint(&self) -> Option<&Box<TerraformBlueprint>>

The value of blueprint if it holds a TerraformBlueprint, None if the field is not set or holds a different branch.

Source

pub fn set_terraform_blueprint<T: Into<Box<TerraformBlueprint>>>( self, v: T, ) -> Self

Sets the value of blueprint to hold a TerraformBlueprint.

Note that all the setters affecting blueprint are mutually exclusive.

§Example
use google_cloud_config_v1::model::TerraformBlueprint;
let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
assert!(x.terraform_blueprint().is_some());

Trait Implementations§

Source§

impl Clone for Preview

Source§

fn clone(&self) -> Preview

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Preview

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Preview

Source§

fn default() -> Preview

Returns the “default value” for a type. Read more
Source§

impl Message for Preview

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Preview

Source§

fn eq(&self, other: &Preview) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Preview

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,