#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Api {
pub api_id: ::std::option::Option<::std::string::String>,
pub name: ::std::option::Option<::std::string::String>,
pub owner_contact: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub dns: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub api_arn: ::std::option::Option<::std::string::String>,
pub created: ::std::option::Option<::aws_smithy_types::DateTime>,
pub xray_enabled: bool,
pub waf_web_acl_arn: ::std::option::Option<::std::string::String>,
pub event_config: ::std::option::Option<crate::types::EventConfig>,
}
impl Api {
pub fn api_id(&self) -> ::std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
pub fn owner_contact(&self) -> ::std::option::Option<&str> {
self.owner_contact.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
pub fn dns(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.dns.as_ref()
}
pub fn api_arn(&self) -> ::std::option::Option<&str> {
self.api_arn.as_deref()
}
pub fn created(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created.as_ref()
}
pub fn xray_enabled(&self) -> bool {
self.xray_enabled
}
pub fn waf_web_acl_arn(&self) -> ::std::option::Option<&str> {
self.waf_web_acl_arn.as_deref()
}
pub fn event_config(&self) -> ::std::option::Option<&crate::types::EventConfig> {
self.event_config.as_ref()
}
}
impl Api {
pub fn builder() -> crate::types::builders::ApiBuilder {
crate::types::builders::ApiBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ApiBuilder {
pub(crate) api_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) owner_contact: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) dns: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) api_arn: ::std::option::Option<::std::string::String>,
pub(crate) created: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) xray_enabled: ::std::option::Option<bool>,
pub(crate) waf_web_acl_arn: ::std::option::Option<::std::string::String>,
pub(crate) event_config: ::std::option::Option<crate::types::EventConfig>,
}
impl ApiBuilder {
pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.api_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
&self.api_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 owner_contact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner_contact = ::std::option::Option::Some(input.into());
self
}
pub fn set_owner_contact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner_contact = input;
self
}
pub fn get_owner_contact(&self) -> &::std::option::Option<::std::string::String> {
&self.owner_contact
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
pub fn dns(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.dns.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.dns = ::std::option::Option::Some(hash_map);
self
}
pub fn set_dns(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.dns = input;
self
}
pub fn get_dns(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.dns
}
pub fn api_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.api_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_api_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.api_arn = input;
self
}
pub fn get_api_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.api_arn
}
pub fn created(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created = ::std::option::Option::Some(input);
self
}
pub fn set_created(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created = input;
self
}
pub fn get_created(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created
}
pub fn xray_enabled(mut self, input: bool) -> Self {
self.xray_enabled = ::std::option::Option::Some(input);
self
}
pub fn set_xray_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.xray_enabled = input;
self
}
pub fn get_xray_enabled(&self) -> &::std::option::Option<bool> {
&self.xray_enabled
}
pub fn waf_web_acl_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.waf_web_acl_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_waf_web_acl_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.waf_web_acl_arn = input;
self
}
pub fn get_waf_web_acl_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.waf_web_acl_arn
}
pub fn event_config(mut self, input: crate::types::EventConfig) -> Self {
self.event_config = ::std::option::Option::Some(input);
self
}
pub fn set_event_config(mut self, input: ::std::option::Option<crate::types::EventConfig>) -> Self {
self.event_config = input;
self
}
pub fn get_event_config(&self) -> &::std::option::Option<crate::types::EventConfig> {
&self.event_config
}
pub fn build(self) -> crate::types::Api {
crate::types::Api {
api_id: self.api_id,
name: self.name,
owner_contact: self.owner_contact,
tags: self.tags,
dns: self.dns,
api_arn: self.api_arn,
created: self.created,
xray_enabled: self.xray_enabled.unwrap_or_default(),
waf_web_acl_arn: self.waf_web_acl_arn,
event_config: self.event_config,
}
}
}