aws_sdk_datazone/operation/create_connection/
_create_connection_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateConnectionOutput {
pub connection_id: ::std::string::String,
pub description: ::std::option::Option<::std::string::String>,
pub domain_id: ::std::string::String,
pub domain_unit_id: ::std::string::String,
pub environment_id: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
pub physical_endpoints: ::std::vec::Vec<crate::types::PhysicalEndpoint>,
pub project_id: ::std::option::Option<::std::string::String>,
pub props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
pub r#type: crate::types::ConnectionType,
_request_id: Option<String>,
}
impl CreateConnectionOutput {
pub fn connection_id(&self) -> &str {
use std::ops::Deref;
self.connection_id.deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn domain_id(&self) -> &str {
use std::ops::Deref;
self.domain_id.deref()
}
pub fn domain_unit_id(&self) -> &str {
use std::ops::Deref;
self.domain_unit_id.deref()
}
pub fn environment_id(&self) -> ::std::option::Option<&str> {
self.environment_id.as_deref()
}
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn physical_endpoints(&self) -> &[crate::types::PhysicalEndpoint] {
use std::ops::Deref;
self.physical_endpoints.deref()
}
pub fn project_id(&self) -> ::std::option::Option<&str> {
self.project_id.as_deref()
}
pub fn props(&self) -> ::std::option::Option<&crate::types::ConnectionPropertiesOutput> {
self.props.as_ref()
}
pub fn r#type(&self) -> &crate::types::ConnectionType {
&self.r#type
}
}
impl ::std::fmt::Debug for CreateConnectionOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateConnectionOutput");
formatter.field("connection_id", &self.connection_id);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("domain_id", &self.domain_id);
formatter.field("domain_unit_id", &self.domain_unit_id);
formatter.field("environment_id", &self.environment_id);
formatter.field("name", &self.name);
formatter.field("physical_endpoints", &self.physical_endpoints);
formatter.field("project_id", &self.project_id);
formatter.field("props", &self.props);
formatter.field("r#type", &self.r#type);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for CreateConnectionOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateConnectionOutput {
pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionOutputBuilder {
crate::operation::create_connection::builders::CreateConnectionOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateConnectionOutputBuilder {
pub(crate) connection_id: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) domain_id: ::std::option::Option<::std::string::String>,
pub(crate) domain_unit_id: ::std::option::Option<::std::string::String>,
pub(crate) environment_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) physical_endpoints: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>,
pub(crate) project_id: ::std::option::Option<::std::string::String>,
pub(crate) props: ::std::option::Option<crate::types::ConnectionPropertiesOutput>,
pub(crate) r#type: ::std::option::Option<crate::types::ConnectionType>,
_request_id: Option<String>,
}
impl CreateConnectionOutputBuilder {
pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.connection_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.connection_id = input;
self
}
pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
&self.connection_id
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.domain_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.domain_id = input;
self
}
pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
&self.domain_id
}
pub fn domain_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.domain_unit_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_domain_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.domain_unit_id = input;
self
}
pub fn get_domain_unit_id(&self) -> &::std::option::Option<::std::string::String> {
&self.domain_unit_id
}
pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.environment_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.environment_id = input;
self
}
pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.environment_id
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn physical_endpoints(mut self, input: crate::types::PhysicalEndpoint) -> Self {
let mut v = self.physical_endpoints.unwrap_or_default();
v.push(input);
self.physical_endpoints = ::std::option::Option::Some(v);
self
}
pub fn set_physical_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>>) -> Self {
self.physical_endpoints = input;
self
}
pub fn get_physical_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhysicalEndpoint>> {
&self.physical_endpoints
}
pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.project_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.project_id = input;
self
}
pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
&self.project_id
}
pub fn props(mut self, input: crate::types::ConnectionPropertiesOutput) -> Self {
self.props = ::std::option::Option::Some(input);
self
}
pub fn set_props(mut self, input: ::std::option::Option<crate::types::ConnectionPropertiesOutput>) -> Self {
self.props = input;
self
}
pub fn get_props(&self) -> &::std::option::Option<crate::types::ConnectionPropertiesOutput> {
&self.props
}
pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
&self.r#type
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionOutput {
connection_id: self.connection_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"connection_id",
"connection_id was not specified but it is required when building CreateConnectionOutput",
)
})?,
description: self.description,
domain_id: self.domain_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"domain_id",
"domain_id was not specified but it is required when building CreateConnectionOutput",
)
})?,
domain_unit_id: self.domain_unit_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"domain_unit_id",
"domain_unit_id was not specified but it is required when building CreateConnectionOutput",
)
})?,
environment_id: self.environment_id,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building CreateConnectionOutput",
)
})?,
physical_endpoints: self.physical_endpoints.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"physical_endpoints",
"physical_endpoints was not specified but it is required when building CreateConnectionOutput",
)
})?,
project_id: self.project_id,
props: self.props,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building CreateConnectionOutput",
)
})?,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for CreateConnectionOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateConnectionOutputBuilder");
formatter.field("connection_id", &self.connection_id);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("domain_id", &self.domain_id);
formatter.field("domain_unit_id", &self.domain_unit_id);
formatter.field("environment_id", &self.environment_id);
formatter.field("name", &self.name);
formatter.field("physical_endpoints", &self.physical_endpoints);
formatter.field("project_id", &self.project_id);
formatter.field("props", &self.props);
formatter.field("r#type", &self.r#type);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}