#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Webhook {
pub webhook_arn: ::std::string::String,
pub webhook_id: ::std::string::String,
pub webhook_url: ::std::string::String,
pub app_id: ::std::option::Option<::std::string::String>,
pub branch_name: ::std::string::String,
pub description: ::std::string::String,
pub create_time: ::aws_smithy_types::DateTime,
pub update_time: ::aws_smithy_types::DateTime,
}
impl Webhook {
pub fn webhook_arn(&self) -> &str {
use std::ops::Deref;
self.webhook_arn.deref()
}
pub fn webhook_id(&self) -> &str {
use std::ops::Deref;
self.webhook_id.deref()
}
pub fn webhook_url(&self) -> &str {
use std::ops::Deref;
self.webhook_url.deref()
}
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> &str {
use std::ops::Deref;
self.branch_name.deref()
}
pub fn description(&self) -> &str {
use std::ops::Deref;
self.description.deref()
}
pub fn create_time(&self) -> &::aws_smithy_types::DateTime {
&self.create_time
}
pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
&self.update_time
}
}
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_arn: ::std::option::Option<::std::string::String>,
pub(crate) webhook_id: ::std::option::Option<::std::string::String>,
pub(crate) webhook_url: ::std::option::Option<::std::string::String>,
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) branch_name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl WebhookBuilder {
pub fn webhook_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.webhook_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_webhook_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.webhook_arn = input;
self
}
pub fn get_webhook_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.webhook_arn
}
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 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 app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.branch_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
&self.branch_name
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.create_time = ::std::option::Option::Some(input);
self
}
pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.create_time = input;
self
}
pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.create_time
}
pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.update_time = ::std::option::Option::Some(input);
self
}
pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.update_time = input;
self
}
pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.update_time
}
pub fn build(self) -> ::std::result::Result<crate::types::Webhook, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Webhook {
webhook_arn: self.webhook_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"webhook_arn",
"webhook_arn was not specified but it is required when building Webhook",
)
})?,
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",
)
})?,
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",
)
})?,
app_id: self.app_id,
branch_name: self.branch_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"branch_name",
"branch_name was not specified but it is required when building Webhook",
)
})?,
description: self.description.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"description",
"description was not specified but it is required when building Webhook",
)
})?,
create_time: self.create_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"create_time",
"create_time was not specified but it is required when building Webhook",
)
})?,
update_time: self.update_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"update_time",
"update_time was not specified but it is required when building Webhook",
)
})?,
})
}
}