#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct HttpRoute {
pub r#match: ::std::option::Option<crate::types::HttpRouteMatch>,
pub action: ::std::option::Option<crate::types::HttpRouteAction>,
pub retry_policy: ::std::option::Option<crate::types::HttpRetryPolicy>,
pub timeout: ::std::option::Option<crate::types::HttpTimeout>,
}
impl HttpRoute {
pub fn r#match(&self) -> ::std::option::Option<&crate::types::HttpRouteMatch> {
self.r#match.as_ref()
}
pub fn action(&self) -> ::std::option::Option<&crate::types::HttpRouteAction> {
self.action.as_ref()
}
pub fn retry_policy(&self) -> ::std::option::Option<&crate::types::HttpRetryPolicy> {
self.retry_policy.as_ref()
}
pub fn timeout(&self) -> ::std::option::Option<&crate::types::HttpTimeout> {
self.timeout.as_ref()
}
}
impl HttpRoute {
pub fn builder() -> crate::types::builders::HttpRouteBuilder {
crate::types::builders::HttpRouteBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct HttpRouteBuilder {
pub(crate) r#match: ::std::option::Option<crate::types::HttpRouteMatch>,
pub(crate) action: ::std::option::Option<crate::types::HttpRouteAction>,
pub(crate) retry_policy: ::std::option::Option<crate::types::HttpRetryPolicy>,
pub(crate) timeout: ::std::option::Option<crate::types::HttpTimeout>,
}
impl HttpRouteBuilder {
pub fn r#match(mut self, input: crate::types::HttpRouteMatch) -> Self {
self.r#match = ::std::option::Option::Some(input);
self
}
pub fn set_match(mut self, input: ::std::option::Option<crate::types::HttpRouteMatch>) -> Self {
self.r#match = input;
self
}
pub fn get_match(&self) -> &::std::option::Option<crate::types::HttpRouteMatch> {
&self.r#match
}
pub fn action(mut self, input: crate::types::HttpRouteAction) -> Self {
self.action = ::std::option::Option::Some(input);
self
}
pub fn set_action(mut self, input: ::std::option::Option<crate::types::HttpRouteAction>) -> Self {
self.action = input;
self
}
pub fn get_action(&self) -> &::std::option::Option<crate::types::HttpRouteAction> {
&self.action
}
pub fn retry_policy(mut self, input: crate::types::HttpRetryPolicy) -> Self {
self.retry_policy = ::std::option::Option::Some(input);
self
}
pub fn set_retry_policy(mut self, input: ::std::option::Option<crate::types::HttpRetryPolicy>) -> Self {
self.retry_policy = input;
self
}
pub fn get_retry_policy(&self) -> &::std::option::Option<crate::types::HttpRetryPolicy> {
&self.retry_policy
}
pub fn timeout(mut self, input: crate::types::HttpTimeout) -> Self {
self.timeout = ::std::option::Option::Some(input);
self
}
pub fn set_timeout(mut self, input: ::std::option::Option<crate::types::HttpTimeout>) -> Self {
self.timeout = input;
self
}
pub fn get_timeout(&self) -> &::std::option::Option<crate::types::HttpTimeout> {
&self.timeout
}
pub fn build(self) -> crate::types::HttpRoute {
crate::types::HttpRoute {
r#match: self.r#match,
action: self.action,
retry_policy: self.retry_policy,
timeout: self.timeout,
}
}
}