aws_sdk_codeconnections/operation/list_repository_links/
_list_repository_links_output.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 ListRepositoryLinksOutput {
6    /// <p>Lists the repository links called by the list repository links operation.</p>
7    pub repository_links: ::std::vec::Vec<crate::types::RepositoryLinkInfo>,
8    /// <p>An enumeration token that allows the operation to batch the results of the operation.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl ListRepositoryLinksOutput {
13    /// <p>Lists the repository links called by the list repository links operation.</p>
14    pub fn repository_links(&self) -> &[crate::types::RepositoryLinkInfo] {
15        use std::ops::Deref;
16        self.repository_links.deref()
17    }
18    /// <p>An enumeration token that allows the operation to batch the results of the operation.</p>
19    pub fn next_token(&self) -> ::std::option::Option<&str> {
20        self.next_token.as_deref()
21    }
22}
23impl ::aws_types::request_id::RequestId for ListRepositoryLinksOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl ListRepositoryLinksOutput {
29    /// Creates a new builder-style object to manufacture [`ListRepositoryLinksOutput`](crate::operation::list_repository_links::ListRepositoryLinksOutput).
30    pub fn builder() -> crate::operation::list_repository_links::builders::ListRepositoryLinksOutputBuilder {
31        crate::operation::list_repository_links::builders::ListRepositoryLinksOutputBuilder::default()
32    }
33}
34
35/// A builder for [`ListRepositoryLinksOutput`](crate::operation::list_repository_links::ListRepositoryLinksOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ListRepositoryLinksOutputBuilder {
39    pub(crate) repository_links: ::std::option::Option<::std::vec::Vec<crate::types::RepositoryLinkInfo>>,
40    pub(crate) next_token: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl ListRepositoryLinksOutputBuilder {
44    /// Appends an item to `repository_links`.
45    ///
46    /// To override the contents of this collection use [`set_repository_links`](Self::set_repository_links).
47    ///
48    /// <p>Lists the repository links called by the list repository links operation.</p>
49    pub fn repository_links(mut self, input: crate::types::RepositoryLinkInfo) -> Self {
50        let mut v = self.repository_links.unwrap_or_default();
51        v.push(input);
52        self.repository_links = ::std::option::Option::Some(v);
53        self
54    }
55    /// <p>Lists the repository links called by the list repository links operation.</p>
56    pub fn set_repository_links(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RepositoryLinkInfo>>) -> Self {
57        self.repository_links = input;
58        self
59    }
60    /// <p>Lists the repository links called by the list repository links operation.</p>
61    pub fn get_repository_links(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RepositoryLinkInfo>> {
62        &self.repository_links
63    }
64    /// <p>An enumeration token that allows the operation to batch the results of the operation.</p>
65    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.next_token = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>An enumeration token that allows the operation to batch the results of the operation.</p>
70    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.next_token = input;
72        self
73    }
74    /// <p>An enumeration token that allows the operation to batch the results of the operation.</p>
75    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
76        &self.next_token
77    }
78    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
79        self._request_id = Some(request_id.into());
80        self
81    }
82
83    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
84        self._request_id = request_id;
85        self
86    }
87    /// Consumes the builder and constructs a [`ListRepositoryLinksOutput`](crate::operation::list_repository_links::ListRepositoryLinksOutput).
88    /// This method will fail if any of the following fields are not set:
89    /// - [`repository_links`](crate::operation::list_repository_links::builders::ListRepositoryLinksOutputBuilder::repository_links)
90    pub fn build(
91        self,
92    ) -> ::std::result::Result<crate::operation::list_repository_links::ListRepositoryLinksOutput, ::aws_smithy_types::error::operation::BuildError>
93    {
94        ::std::result::Result::Ok(crate::operation::list_repository_links::ListRepositoryLinksOutput {
95            repository_links: self.repository_links.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "repository_links",
98                    "repository_links was not specified but it is required when building ListRepositoryLinksOutput",
99                )
100            })?,
101            next_token: self.next_token,
102            _request_id: self._request_id,
103        })
104    }
105}