aws_sdk_codepipeline/operation/put_webhook/_put_webhook_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutWebhookInput {
6 /// <p>The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name that helps you identify it. You might name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.</p>
7 pub webhook: ::std::option::Option<crate::types::WebhookDefinition>,
8 /// <p>The tags for the webhook.</p>
9 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
10}
11impl PutWebhookInput {
12 /// <p>The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name that helps you identify it. You might name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.</p>
13 pub fn webhook(&self) -> ::std::option::Option<&crate::types::WebhookDefinition> {
14 self.webhook.as_ref()
15 }
16 /// <p>The tags for the webhook.</p>
17 ///
18 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
19 pub fn tags(&self) -> &[crate::types::Tag] {
20 self.tags.as_deref().unwrap_or_default()
21 }
22}
23impl PutWebhookInput {
24 /// Creates a new builder-style object to manufacture [`PutWebhookInput`](crate::operation::put_webhook::PutWebhookInput).
25 pub fn builder() -> crate::operation::put_webhook::builders::PutWebhookInputBuilder {
26 crate::operation::put_webhook::builders::PutWebhookInputBuilder::default()
27 }
28}
29
30/// A builder for [`PutWebhookInput`](crate::operation::put_webhook::PutWebhookInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct PutWebhookInputBuilder {
34 pub(crate) webhook: ::std::option::Option<crate::types::WebhookDefinition>,
35 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
36}
37impl PutWebhookInputBuilder {
38 /// <p>The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name that helps you identify it. You might name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.</p>
39 /// This field is required.
40 pub fn webhook(mut self, input: crate::types::WebhookDefinition) -> Self {
41 self.webhook = ::std::option::Option::Some(input);
42 self
43 }
44 /// <p>The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name that helps you identify it. You might name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.</p>
45 pub fn set_webhook(mut self, input: ::std::option::Option<crate::types::WebhookDefinition>) -> Self {
46 self.webhook = input;
47 self
48 }
49 /// <p>The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name that helps you identify it. You might name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.</p>
50 pub fn get_webhook(&self) -> &::std::option::Option<crate::types::WebhookDefinition> {
51 &self.webhook
52 }
53 /// Appends an item to `tags`.
54 ///
55 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
56 ///
57 /// <p>The tags for the webhook.</p>
58 pub fn tags(mut self, input: crate::types::Tag) -> Self {
59 let mut v = self.tags.unwrap_or_default();
60 v.push(input);
61 self.tags = ::std::option::Option::Some(v);
62 self
63 }
64 /// <p>The tags for the webhook.</p>
65 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
66 self.tags = input;
67 self
68 }
69 /// <p>The tags for the webhook.</p>
70 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
71 &self.tags
72 }
73 /// Consumes the builder and constructs a [`PutWebhookInput`](crate::operation::put_webhook::PutWebhookInput).
74 pub fn build(self) -> ::std::result::Result<crate::operation::put_webhook::PutWebhookInput, ::aws_smithy_types::error::operation::BuildError> {
75 ::std::result::Result::Ok(crate::operation::put_webhook::PutWebhookInput {
76 webhook: self.webhook,
77 tags: self.tags,
78 })
79 }
80}