#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Endpoint {
pub r#type: ::std::option::Option<crate::types::EndpointType>,
pub address: ::std::option::Option<::std::string::String>,
}
impl Endpoint {
pub fn r#type(&self) -> ::std::option::Option<&crate::types::EndpointType> {
self.r#type.as_ref()
}
pub fn address(&self) -> ::std::option::Option<&str> {
self.address.as_deref()
}
}
impl Endpoint {
pub fn builder() -> crate::types::builders::EndpointBuilder {
crate::types::builders::EndpointBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EndpointBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::EndpointType>,
pub(crate) address: ::std::option::Option<::std::string::String>,
}
impl EndpointBuilder {
pub fn r#type(mut self, input: crate::types::EndpointType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::EndpointType>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::EndpointType> {
&self.r#type
}
pub fn address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.address = ::std::option::Option::Some(input.into());
self
}
pub fn set_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.address = input;
self
}
pub fn get_address(&self) -> &::std::option::Option<::std::string::String> {
&self.address
}
pub fn build(self) -> crate::types::Endpoint {
crate::types::Endpoint {
r#type: self.r#type,
address: self.address,
}
}
}