#[non_exhaustive]pub struct CopyModelRequest {
pub parent: String,
pub source_model: String,
pub encryption_spec: Option<EncryptionSpec>,
pub custom_service_account: String,
pub destination_model: Option<DestinationModel>,
/* private fields */
}model-service only.Expand description
Request message for ModelService.CopyModel.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. The resource name of the Location into which to copy the Model.
Format: projects/{project}/locations/{location}
source_model: StringRequired. The resource name of the Model to copy. That Model must be in the
same Project. Format:
projects/{project}/locations/{location}/models/{model}
encryption_spec: Option<EncryptionSpec>Customer-managed encryption key options. If this is set, then the Model copy will be encrypted with the provided encryption key.
custom_service_account: StringOptional. The user-provided custom service account to use to do the copy
model. If empty, Vertex AI Service
Agent
will be used to access resources needed to upload the model. This account
must belong to the destination project where the model is copied to,
i.e., the project specified in the parent field of this request and
have the Vertex AI Service Agent role in the source project.
Requires the user copying the Model to have the
iam.serviceAccounts.actAs permission on this service account.
destination_model: Option<DestinationModel>If both fields are unset, a new Model will be created with a generated ID.
Implementations§
Source§impl CopyModelRequest
impl CopyModelRequest
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_source_model<T: Into<String>>(self, v: T) -> Self
pub fn set_source_model<T: Into<String>>(self, v: T) -> Self
Sets the value of source_model.
§Example
let x = CopyModelRequest::new().set_source_model("example");Sourcepub fn set_encryption_spec<T>(self, v: T) -> Selfwhere
T: Into<EncryptionSpec>,
pub fn set_encryption_spec<T>(self, v: T) -> Selfwhere
T: Into<EncryptionSpec>,
Sets the value of encryption_spec.
§Example
use google_cloud_aiplatform_v1::model::EncryptionSpec;
let x = CopyModelRequest::new().set_encryption_spec(EncryptionSpec::default()/* use setters */);Sourcepub fn set_or_clear_encryption_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionSpec>,
pub fn set_or_clear_encryption_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionSpec>,
Sets or clears the value of encryption_spec.
§Example
use google_cloud_aiplatform_v1::model::EncryptionSpec;
let x = CopyModelRequest::new().set_or_clear_encryption_spec(Some(EncryptionSpec::default()/* use setters */));
let x = CopyModelRequest::new().set_or_clear_encryption_spec(None::<EncryptionSpec>);Sourcepub fn set_custom_service_account<T: Into<String>>(self, v: T) -> Self
pub fn set_custom_service_account<T: Into<String>>(self, v: T) -> Self
Sets the value of custom_service_account.
§Example
let x = CopyModelRequest::new().set_custom_service_account("example");Sourcepub fn set_destination_model<T: Into<Option<DestinationModel>>>(
self,
v: T,
) -> Self
pub fn set_destination_model<T: Into<Option<DestinationModel>>>( self, v: T, ) -> Self
Sets the value of destination_model.
Note that all the setters affecting destination_model are mutually
exclusive.
§Example
use google_cloud_aiplatform_v1::model::copy_model_request::DestinationModel;
let x = CopyModelRequest::new().set_destination_model(Some(DestinationModel::ModelId("example".to_string())));Sourcepub fn model_id(&self) -> Option<&String>
pub fn model_id(&self) -> Option<&String>
The value of destination_model
if it holds a ModelId, None if the field is not set or
holds a different branch.
Sourcepub fn set_model_id<T: Into<String>>(self, v: T) -> Self
pub fn set_model_id<T: Into<String>>(self, v: T) -> Self
Sets the value of destination_model
to hold a ModelId.
Note that all the setters affecting destination_model are
mutually exclusive.
§Example
let x = CopyModelRequest::new().set_model_id("example");
assert!(x.model_id().is_some());
assert!(x.parent_model().is_none());Sourcepub fn parent_model(&self) -> Option<&String>
pub fn parent_model(&self) -> Option<&String>
The value of destination_model
if it holds a ParentModel, None if the field is not set or
holds a different branch.
Sourcepub fn set_parent_model<T: Into<String>>(self, v: T) -> Self
pub fn set_parent_model<T: Into<String>>(self, v: T) -> Self
Sets the value of destination_model
to hold a ParentModel.
Note that all the setters affecting destination_model are
mutually exclusive.
§Example
let x = CopyModelRequest::new().set_parent_model("example");
assert!(x.parent_model().is_some());
assert!(x.model_id().is_none());Trait Implementations§
Source§impl Clone for CopyModelRequest
impl Clone for CopyModelRequest
Source§fn clone(&self) -> CopyModelRequest
fn clone(&self) -> CopyModelRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more