#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Webhook {
pub webhook_url: ::std::string::String,
pub webhook_type: ::std::option::Option<crate::types::WebhookType>,
pub webhook_id: ::std::string::String,
}
impl Webhook {
pub fn webhook_url(&self) -> &str {
use std::ops::Deref;
self.webhook_url.deref()
}
pub fn webhook_type(&self) -> ::std::option::Option<&crate::types::WebhookType> {
self.webhook_type.as_ref()
}
pub fn webhook_id(&self) -> &str {
use std::ops::Deref;
self.webhook_id.deref()
}
}
impl Webhook {
pub fn builder() -> crate::types::builders::WebhookBuilder {
crate::types::builders::WebhookBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct WebhookBuilder {
pub(crate) webhook_url: ::std::option::Option<::std::string::String>,
pub(crate) webhook_type: ::std::option::Option<crate::types::WebhookType>,
pub(crate) webhook_id: ::std::option::Option<::std::string::String>,
}
impl WebhookBuilder {
pub fn webhook_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.webhook_url = ::std::option::Option::Some(input.into());
self
}
pub fn set_webhook_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.webhook_url = input;
self
}
pub fn get_webhook_url(&self) -> &::std::option::Option<::std::string::String> {
&self.webhook_url
}
pub fn webhook_type(mut self, input: crate::types::WebhookType) -> Self {
self.webhook_type = ::std::option::Option::Some(input);
self
}
pub fn set_webhook_type(mut self, input: ::std::option::Option<crate::types::WebhookType>) -> Self {
self.webhook_type = input;
self
}
pub fn get_webhook_type(&self) -> &::std::option::Option<crate::types::WebhookType> {
&self.webhook_type
}
pub fn webhook_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.webhook_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_webhook_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.webhook_id = input;
self
}
pub fn get_webhook_id(&self) -> &::std::option::Option<::std::string::String> {
&self.webhook_id
}
pub fn build(self) -> ::std::result::Result<crate::types::Webhook, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Webhook {
webhook_url: self.webhook_url.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"webhook_url",
"webhook_url was not specified but it is required when building Webhook",
)
})?,
webhook_type: self.webhook_type,
webhook_id: self.webhook_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"webhook_id",
"webhook_id was not specified but it is required when building Webhook",
)
})?,
})
}
}