#[derive(Debug, Default)]
pub struct Connection {
properties: ConnectionProperties
}
#[derive(Debug, Default)]
pub struct ConnectionProperties {
pub connection_name: ::Value<String>,
pub host_arn: Option<::Value<String>>,
pub provider_type: Option<::Value<String>>,
pub tags: Option<::ValueList<::Tag>>,
}
impl ::serde::Serialize for ConnectionProperties {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
let mut map = ::serde::Serializer::serialize_map(s, None)?;
::serde::ser::SerializeMap::serialize_entry(&mut map, "ConnectionName", &self.connection_name)?;
if let Some(ref host_arn) = self.host_arn {
::serde::ser::SerializeMap::serialize_entry(&mut map, "HostArn", host_arn)?;
}
if let Some(ref provider_type) = self.provider_type {
::serde::ser::SerializeMap::serialize_entry(&mut map, "ProviderType", provider_type)?;
}
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_entry(&mut map, "Tags", tags)?;
}
::serde::ser::SerializeMap::end(map)
}
}
impl<'de> ::serde::Deserialize<'de> for ConnectionProperties {
fn deserialize<D: ::serde::Deserializer<'de>>(d: D) -> Result<ConnectionProperties, D::Error> {
struct Visitor;
impl<'de> ::serde::de::Visitor<'de> for Visitor {
type Value = ConnectionProperties;
fn expecting(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
write!(f, "a struct of type ConnectionProperties")
}
fn visit_map<A: ::serde::de::MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let mut connection_name: Option<::Value<String>> = None;
let mut host_arn: Option<::Value<String>> = None;
let mut provider_type: Option<::Value<String>> = None;
let mut tags: Option<::ValueList<::Tag>> = None;
while let Some(__cfn_key) = ::serde::de::MapAccess::next_key::<String>(&mut map)? {
match __cfn_key.as_ref() {
"ConnectionName" => {
connection_name = ::serde::de::MapAccess::next_value(&mut map)?;
}
"HostArn" => {
host_arn = ::serde::de::MapAccess::next_value(&mut map)?;
}
"ProviderType" => {
provider_type = ::serde::de::MapAccess::next_value(&mut map)?;
}
"Tags" => {
tags = ::serde::de::MapAccess::next_value(&mut map)?;
}
_ => {}
}
}
Ok(ConnectionProperties {
connection_name: connection_name.ok_or(::serde::de::Error::missing_field("ConnectionName"))?,
host_arn: host_arn,
provider_type: provider_type,
tags: tags,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ::Resource for Connection {
type Properties = ConnectionProperties;
const TYPE: &'static str = "AWS::CodeStarConnections::Connection";
fn properties(&self) -> &ConnectionProperties {
&self.properties
}
fn properties_mut(&mut self) -> &mut ConnectionProperties {
&mut self.properties
}
}
impl ::private::Sealed for Connection {}
impl From<ConnectionProperties> for Connection {
fn from(properties: ConnectionProperties) -> Connection {
Connection { properties }
}
}