aws_sdk_codegurureviewer/operation/list_repository_associations/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_repository_associations::_list_repository_associations_output::ListRepositoryAssociationsOutputBuilder;
3
4pub use crate::operation::list_repository_associations::_list_repository_associations_input::ListRepositoryAssociationsInputBuilder;
5
6impl crate::operation::list_repository_associations::builders::ListRepositoryAssociationsInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::list_repository_associations::ListRepositoryAssociationsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_repository_associations::ListRepositoryAssociationsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_repository_associations();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListRepositoryAssociations`.
24///
25/// <p>Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html">RepositoryAssociationSummary</a> objects that contain summary information about a repository association. You can filter the returned list by <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-ProviderType">ProviderType</a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name">Name</a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State">State</a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner">Owner</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListRepositoryAssociationsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_repository_associations::builders::ListRepositoryAssociationsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_repository_associations::ListRepositoryAssociationsOutput,
35 crate::operation::list_repository_associations::ListRepositoryAssociationsError,
36 > for ListRepositoryAssociationsFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::list_repository_associations::ListRepositoryAssociationsOutput,
44 crate::operation::list_repository_associations::ListRepositoryAssociationsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ListRepositoryAssociationsFluentBuilder {
51 /// Creates a new `ListRepositoryAssociationsFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the ListRepositoryAssociations as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_repository_associations::builders::ListRepositoryAssociationsInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::list_repository_associations::ListRepositoryAssociationsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::list_repository_associations::ListRepositoryAssociationsError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::list_repository_associations::ListRepositoryAssociations::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::list_repository_associations::ListRepositoryAssociations::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::list_repository_associations::ListRepositoryAssociationsOutput,
97 crate::operation::list_repository_associations::ListRepositoryAssociationsError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// Create a paginator for this request
112 ///
113 /// Paginators are used by calling [`send().await`](crate::operation::list_repository_associations::paginator::ListRepositoryAssociationsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::list_repository_associations::paginator::ListRepositoryAssociationsPaginator {
115 crate::operation::list_repository_associations::paginator::ListRepositoryAssociationsPaginator::new(self.handle, self.inner)
116 }
117 ///
118 /// Appends an item to `ProviderTypes`.
119 ///
120 /// To override the contents of this collection use [`set_provider_types`](Self::set_provider_types).
121 ///
122 /// <p>List of provider types to use as a filter.</p>
123 pub fn provider_types(mut self, input: crate::types::ProviderType) -> Self {
124 self.inner = self.inner.provider_types(input);
125 self
126 }
127 /// <p>List of provider types to use as a filter.</p>
128 pub fn set_provider_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProviderType>>) -> Self {
129 self.inner = self.inner.set_provider_types(input);
130 self
131 }
132 /// <p>List of provider types to use as a filter.</p>
133 pub fn get_provider_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProviderType>> {
134 self.inner.get_provider_types()
135 }
136 ///
137 /// Appends an item to `States`.
138 ///
139 /// To override the contents of this collection use [`set_states`](Self::set_states).
140 ///
141 /// <p>List of repository association states to use as a filter.</p>
142 /// <p>The valid repository association states are:</p>
143 /// <ul>
144 /// <li>
145 /// <p><b>Associated</b>: The repository association is complete.</p></li>
146 /// <li>
147 /// <p><b>Associating</b>: CodeGuru Reviewer is:</p>
148 /// <ul>
149 /// <li>
150 /// <p>Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.</p><note>
151 /// <p>If your repository <code>ProviderType</code> is <code>GitHub</code>, <code>GitHub Enterprise Server</code>, or <code>Bitbucket</code>, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.</p>
152 /// </note></li>
153 /// <li>
154 /// <p>Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.</p></li>
155 /// </ul></li>
156 /// <li>
157 /// <p><b>Failed</b>: The repository failed to associate or disassociate.</p></li>
158 /// <li>
159 /// <p><b>Disassociating</b>: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.</p></li>
160 /// <li>
161 /// <p><b>Disassociated</b>: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html">Using tags to control access to associated repositories</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.</p></li>
162 /// </ul>
163 pub fn states(mut self, input: crate::types::RepositoryAssociationState) -> Self {
164 self.inner = self.inner.states(input);
165 self
166 }
167 /// <p>List of repository association states to use as a filter.</p>
168 /// <p>The valid repository association states are:</p>
169 /// <ul>
170 /// <li>
171 /// <p><b>Associated</b>: The repository association is complete.</p></li>
172 /// <li>
173 /// <p><b>Associating</b>: CodeGuru Reviewer is:</p>
174 /// <ul>
175 /// <li>
176 /// <p>Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.</p><note>
177 /// <p>If your repository <code>ProviderType</code> is <code>GitHub</code>, <code>GitHub Enterprise Server</code>, or <code>Bitbucket</code>, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.</p>
178 /// </note></li>
179 /// <li>
180 /// <p>Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.</p></li>
181 /// </ul></li>
182 /// <li>
183 /// <p><b>Failed</b>: The repository failed to associate or disassociate.</p></li>
184 /// <li>
185 /// <p><b>Disassociating</b>: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.</p></li>
186 /// <li>
187 /// <p><b>Disassociated</b>: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html">Using tags to control access to associated repositories</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.</p></li>
188 /// </ul>
189 pub fn set_states(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RepositoryAssociationState>>) -> Self {
190 self.inner = self.inner.set_states(input);
191 self
192 }
193 /// <p>List of repository association states to use as a filter.</p>
194 /// <p>The valid repository association states are:</p>
195 /// <ul>
196 /// <li>
197 /// <p><b>Associated</b>: The repository association is complete.</p></li>
198 /// <li>
199 /// <p><b>Associating</b>: CodeGuru Reviewer is:</p>
200 /// <ul>
201 /// <li>
202 /// <p>Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.</p><note>
203 /// <p>If your repository <code>ProviderType</code> is <code>GitHub</code>, <code>GitHub Enterprise Server</code>, or <code>Bitbucket</code>, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.</p>
204 /// </note></li>
205 /// <li>
206 /// <p>Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.</p></li>
207 /// </ul></li>
208 /// <li>
209 /// <p><b>Failed</b>: The repository failed to associate or disassociate.</p></li>
210 /// <li>
211 /// <p><b>Disassociating</b>: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.</p></li>
212 /// <li>
213 /// <p><b>Disassociated</b>: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html">Using tags to control access to associated repositories</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.</p></li>
214 /// </ul>
215 pub fn get_states(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RepositoryAssociationState>> {
216 self.inner.get_states()
217 }
218 ///
219 /// Appends an item to `Names`.
220 ///
221 /// To override the contents of this collection use [`set_names`](Self::set_names).
222 ///
223 /// <p>List of repository names to use as a filter.</p>
224 pub fn names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225 self.inner = self.inner.names(input.into());
226 self
227 }
228 /// <p>List of repository names to use as a filter.</p>
229 pub fn set_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
230 self.inner = self.inner.set_names(input);
231 self
232 }
233 /// <p>List of repository names to use as a filter.</p>
234 pub fn get_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
235 self.inner.get_names()
236 }
237 ///
238 /// Appends an item to `Owners`.
239 ///
240 /// To override the contents of this collection use [`set_owners`](Self::set_owners).
241 ///
242 /// <p>List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository.</p>
243 pub fn owners(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.owners(input.into());
245 self
246 }
247 /// <p>List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository.</p>
248 pub fn set_owners(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
249 self.inner = self.inner.set_owners(input);
250 self
251 }
252 /// <p>List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository.</p>
253 pub fn get_owners(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
254 self.inner.get_owners()
255 }
256 /// <p>The maximum number of repository association results returned by <code>ListRepositoryAssociations</code> in paginated output. When this parameter is used, <code>ListRepositoryAssociations</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListRepositoryAssociations</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, <code>ListRepositoryAssociations</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
257 pub fn max_results(mut self, input: i32) -> Self {
258 self.inner = self.inner.max_results(input);
259 self
260 }
261 /// <p>The maximum number of repository association results returned by <code>ListRepositoryAssociations</code> in paginated output. When this parameter is used, <code>ListRepositoryAssociations</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListRepositoryAssociations</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, <code>ListRepositoryAssociations</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
262 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
263 self.inner = self.inner.set_max_results(input);
264 self
265 }
266 /// <p>The maximum number of repository association results returned by <code>ListRepositoryAssociations</code> in paginated output. When this parameter is used, <code>ListRepositoryAssociations</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListRepositoryAssociations</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, <code>ListRepositoryAssociations</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
267 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
268 self.inner.get_max_results()
269 }
270 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListRepositoryAssociations</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p><note>
271 /// <p>Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p>
272 /// </note>
273 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274 self.inner = self.inner.next_token(input.into());
275 self
276 }
277 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListRepositoryAssociations</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p><note>
278 /// <p>Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p>
279 /// </note>
280 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
281 self.inner = self.inner.set_next_token(input);
282 self
283 }
284 /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListRepositoryAssociations</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p><note>
285 /// <p>Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p>
286 /// </note>
287 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
288 self.inner.get_next_token()
289 }
290}