#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListWebhooksOutput {
pub webhooks: ::std::vec::Vec<crate::types::Webhook>,
_request_id: Option<String>,
}
impl ListWebhooksOutput {
pub fn webhooks(&self) -> &[crate::types::Webhook] {
use std::ops::Deref;
self.webhooks.deref()
}
}
impl ::aws_types::request_id::RequestId for ListWebhooksOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl ListWebhooksOutput {
pub fn builder() -> crate::operation::list_webhooks::builders::ListWebhooksOutputBuilder {
crate::operation::list_webhooks::builders::ListWebhooksOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListWebhooksOutputBuilder {
pub(crate) webhooks: ::std::option::Option<::std::vec::Vec<crate::types::Webhook>>,
_request_id: Option<String>,
}
impl ListWebhooksOutputBuilder {
pub fn webhooks(mut self, input: crate::types::Webhook) -> Self {
let mut v = self.webhooks.unwrap_or_default();
v.push(input);
self.webhooks = ::std::option::Option::Some(v);
self
}
pub fn set_webhooks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Webhook>>) -> Self {
self.webhooks = input;
self
}
pub fn get_webhooks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Webhook>> {
&self.webhooks
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::list_webhooks::ListWebhooksOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::list_webhooks::ListWebhooksOutput {
webhooks: self.webhooks.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"webhooks",
"webhooks was not specified but it is required when building ListWebhooksOutput",
)
})?,
_request_id: self._request_id,
})
}
}