#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateWebhookInput {
#[allow(missing_docs)] pub workspace_id: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub org_id: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub name: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub description: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub enabled: ::std::option::Option<bool>,
#[allow(missing_docs)] pub url: ::std::option::Option<::std::string::String>,
#[allow(missing_docs)] pub method: ::std::option::Option<crate::types::HttpMethod>,
#[allow(missing_docs)] pub version: ::std::option::Option<crate::types::Version>,
pub custom_headers: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
#[allow(missing_docs)] pub events: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
#[allow(missing_docs)] pub change_reason: ::std::option::Option<::std::string::String>,
}
impl CreateWebhookInput {
#[allow(missing_docs)] pub fn workspace_id(&self) -> ::std::option::Option<&str> {
self.workspace_id.as_deref()
}
#[allow(missing_docs)] pub fn org_id(&self) -> ::std::option::Option<&str> {
self.org_id.as_deref()
}
#[allow(missing_docs)] pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
#[allow(missing_docs)] pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
#[allow(missing_docs)] pub fn enabled(&self) -> ::std::option::Option<bool> {
self.enabled
}
#[allow(missing_docs)] pub fn url(&self) -> ::std::option::Option<&str> {
self.url.as_deref()
}
#[allow(missing_docs)] pub fn method(&self) -> ::std::option::Option<&crate::types::HttpMethod> {
self.method.as_ref()
}
#[allow(missing_docs)] pub fn version(&self) -> ::std::option::Option<&crate::types::Version> {
self.version.as_ref()
}
pub fn custom_headers(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
self.custom_headers.as_ref()
}
#[allow(missing_docs)] pub fn events(&self) -> &[::std::string::String] {
self.events.as_deref()
.unwrap_or_default()
}
#[allow(missing_docs)] pub fn change_reason(&self) -> ::std::option::Option<&str> {
self.change_reason.as_deref()
}
}
impl CreateWebhookInput {
pub fn builder() -> crate::operation::create_webhook::builders::CreateWebhookInputBuilder {
crate::operation::create_webhook::builders::CreateWebhookInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateWebhookInputBuilder {
pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
pub(crate) org_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) enabled: ::std::option::Option<bool>,
pub(crate) url: ::std::option::Option<::std::string::String>,
pub(crate) method: ::std::option::Option<crate::types::HttpMethod>,
pub(crate) version: ::std::option::Option<crate::types::Version>,
pub(crate) custom_headers: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
pub(crate) events: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
pub(crate) change_reason: ::std::option::Option<::std::string::String>,
}
impl CreateWebhookInputBuilder {
#[allow(missing_docs)] pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.workspace_id = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.workspace_id = input; self
}
#[allow(missing_docs)] pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
&self.workspace_id
}
#[allow(missing_docs)] pub fn org_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.org_id = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_org_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.org_id = input; self
}
#[allow(missing_docs)] pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> {
&self.org_id
}
#[allow(missing_docs)] pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input; self
}
#[allow(missing_docs)] pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
#[allow(missing_docs)] pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input; self
}
#[allow(missing_docs)] pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
#[allow(missing_docs)] pub fn enabled(mut self, input: bool) -> Self {
self.enabled = ::std::option::Option::Some(input);
self
}
#[allow(missing_docs)] pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.enabled = input; self
}
#[allow(missing_docs)] pub fn get_enabled(&self) -> &::std::option::Option<bool> {
&self.enabled
}
#[allow(missing_docs)] pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url = input; self
}
#[allow(missing_docs)] pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
&self.url
}
#[allow(missing_docs)] pub fn method(mut self, input: crate::types::HttpMethod) -> Self {
self.method = ::std::option::Option::Some(input);
self
}
#[allow(missing_docs)] pub fn set_method(mut self, input: ::std::option::Option<crate::types::HttpMethod>) -> Self {
self.method = input; self
}
#[allow(missing_docs)] pub fn get_method(&self) -> &::std::option::Option<crate::types::HttpMethod> {
&self.method
}
#[allow(missing_docs)] pub fn version(mut self, input: crate::types::Version) -> Self {
self.version = ::std::option::Option::Some(input);
self
}
#[allow(missing_docs)] pub fn set_version(mut self, input: ::std::option::Option<crate::types::Version>) -> Self {
self.version = input; self
}
#[allow(missing_docs)] pub fn get_version(&self) -> &::std::option::Option<crate::types::Version> {
&self.version
}
pub fn custom_headers(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
let mut hash_map = self.custom_headers.unwrap_or_default();
hash_map.insert(k.into(), v);
self.custom_headers = ::std::option::Option::Some(hash_map);
self
}
pub fn set_custom_headers(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>) -> Self {
self.custom_headers = input; self
}
pub fn get_custom_headers(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
&self.custom_headers
}
pub fn events(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.events.unwrap_or_default();
v.push(input.into());
self.events = ::std::option::Option::Some(v);
self
}
#[allow(missing_docs)] pub fn set_events(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
self.events = input; self
}
#[allow(missing_docs)] pub fn get_events(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
&self.events
}
#[allow(missing_docs)] pub fn change_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.change_reason = ::std::option::Option::Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_change_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.change_reason = input; self
}
#[allow(missing_docs)] pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.change_reason
}
pub fn build(self) -> ::std::result::Result<crate::operation::create_webhook::CreateWebhookInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(
crate::operation::create_webhook::CreateWebhookInput {
workspace_id: self.workspace_id
,
org_id: self.org_id
,
name: self.name
,
description: self.description
,
enabled: self.enabled
,
url: self.url
,
method: self.method
,
version: self.version
,
custom_headers: self.custom_headers
,
events: self.events
,
change_reason: self.change_reason
,
}
)
}
}