rusoto_codeguru_reviewer/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28#[derive(Clone, Debug, Default, PartialEq, Serialize)]
29#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
30pub struct AssociateRepositoryRequest {
31    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p> <p>To add a new repository association, this parameter specifies a unique identifier for the new repository association that helps ensure idempotency.</p> <p>If you use the AWS CLI or one of the AWS SDKs to call this operation, you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, you must generate a ClientRequestToken yourself for new versions and include that value in the request.</p> <p>You typically interact with this value if you implement your own retry logic and want to ensure that a given repository association is not created twice. We recommend that you generate a UUID-type value to ensure uniqueness within the specified repository association.</p> <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate repository associations if there are failures and retries. </p>
32    #[serde(rename = "ClientRequestToken")]
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub client_request_token: Option<String>,
35    /// <p>The repository to associate.</p>
36    #[serde(rename = "Repository")]
37    pub repository: Repository,
38}
39
40#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
41#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
42pub struct AssociateRepositoryResponse {
43    /// <p>Information about the repository association.</p>
44    #[serde(rename = "RepositoryAssociation")]
45    #[serde(skip_serializing_if = "Option::is_none")]
46    pub repository_association: Option<RepositoryAssociation>,
47}
48
49/// <p>Information about an AWS CodeCommit repository. The CodeCommit repository must be in the same AWS Region and AWS account where its CodeGuru Reviewer code reviews are configured. </p>
50#[derive(Clone, Debug, Default, PartialEq, Serialize)]
51#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
52pub struct CodeCommitRepository {
53    /// <p>The name of the AWS CodeCommit repository. For more information, see <a href="https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetRepository.html#CodeCommit-GetRepository-request-repositoryName">repositoryName</a> in the <i>AWS CodeCommit API Reference</i>.</p>
54    #[serde(rename = "Name")]
55    pub name: String,
56}
57
58/// <p> Information about a code review. </p>
59#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
60#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
61pub struct CodeReview {
62    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
63    #[serde(rename = "CodeReviewArn")]
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub code_review_arn: Option<String>,
66    /// <p> The time, in milliseconds since the epoch, when the code review was created. </p>
67    #[serde(rename = "CreatedTimeStamp")]
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub created_time_stamp: Option<f64>,
70    /// <p> The time, in milliseconds since the epoch, when the code review was last updated. </p>
71    #[serde(rename = "LastUpdatedTimeStamp")]
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub last_updated_time_stamp: Option<f64>,
74    /// <p> The statistics from the code review. </p>
75    #[serde(rename = "Metrics")]
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub metrics: Option<Metrics>,
78    /// <p> The name of the code review. </p>
79    #[serde(rename = "Name")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub name: Option<String>,
82    /// <p>The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub or Bitbucket repository, this is the username for the account that owns the repository.</p>
83    #[serde(rename = "Owner")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub owner: Option<String>,
86    /// <p> The type of repository that contains the reviewed code (for example, GitHub or Bitbucket). </p>
87    #[serde(rename = "ProviderType")]
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub provider_type: Option<String>,
90    /// <p> The pull request ID for the code review. </p>
91    #[serde(rename = "PullRequestId")]
92    #[serde(skip_serializing_if = "Option::is_none")]
93    pub pull_request_id: Option<String>,
94    /// <p> The name of the repository. </p>
95    #[serde(rename = "RepositoryName")]
96    #[serde(skip_serializing_if = "Option::is_none")]
97    pub repository_name: Option<String>,
98    /// <p> The type of the source code for the code review. </p>
99    #[serde(rename = "SourceCodeType")]
100    #[serde(skip_serializing_if = "Option::is_none")]
101    pub source_code_type: Option<SourceCodeType>,
102    /// <p><p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete. </p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed. </p> </li> <li> <p> <code>Failed</code>: The code review failed. </p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted. </p> </li> </ul></p>
103    #[serde(rename = "State")]
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub state: Option<String>,
106    /// <p> The reason for the state of the code review. </p>
107    #[serde(rename = "StateReason")]
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub state_reason: Option<String>,
110    /// <p> The type of code review. </p>
111    #[serde(rename = "Type")]
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub type_: Option<String>,
114}
115
116/// <p> Information about the summary of the code review. </p>
117#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
118#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
119pub struct CodeReviewSummary {
120    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
121    #[serde(rename = "CodeReviewArn")]
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub code_review_arn: Option<String>,
124    /// <p> The time, in milliseconds since the epoch, when the code review was created. </p>
125    #[serde(rename = "CreatedTimeStamp")]
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub created_time_stamp: Option<f64>,
128    /// <p> The time, in milliseconds since the epoch, when the code review was last updated. </p>
129    #[serde(rename = "LastUpdatedTimeStamp")]
130    #[serde(skip_serializing_if = "Option::is_none")]
131    pub last_updated_time_stamp: Option<f64>,
132    /// <p> The statistics from the code review. </p>
133    #[serde(rename = "MetricsSummary")]
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub metrics_summary: Option<MetricsSummary>,
136    /// <p> The name of the code review. </p>
137    #[serde(rename = "Name")]
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub name: Option<String>,
140    /// <p>The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub or Bitbucket repository, this is the username for the account that owns the repository.</p>
141    #[serde(rename = "Owner")]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    pub owner: Option<String>,
144    /// <p> The provider type of the repository association. </p>
145    #[serde(rename = "ProviderType")]
146    #[serde(skip_serializing_if = "Option::is_none")]
147    pub provider_type: Option<String>,
148    /// <p> The pull request ID for the code review. </p>
149    #[serde(rename = "PullRequestId")]
150    #[serde(skip_serializing_if = "Option::is_none")]
151    pub pull_request_id: Option<String>,
152    /// <p> The name of the repository. </p>
153    #[serde(rename = "RepositoryName")]
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub repository_name: Option<String>,
156    /// <p><p> The state of the code review. </p> <p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete. </p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed. </p> </li> <li> <p> <code>Failed</code>: The code review failed. </p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted. </p> </li> </ul></p>
157    #[serde(rename = "State")]
158    #[serde(skip_serializing_if = "Option::is_none")]
159    pub state: Option<String>,
160    /// <p> The type of the code review. </p>
161    #[serde(rename = "Type")]
162    #[serde(skip_serializing_if = "Option::is_none")]
163    pub type_: Option<String>,
164}
165
166/// <p> The commit diff for the pull request. </p>
167#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
168#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
169pub struct CommitDiffSourceCodeType {
170    /// <p> The SHA of the destination commit. </p>
171    #[serde(rename = "DestinationCommit")]
172    #[serde(skip_serializing_if = "Option::is_none")]
173    pub destination_commit: Option<String>,
174    /// <p> The SHA of the source commit. </p>
175    #[serde(rename = "SourceCommit")]
176    #[serde(skip_serializing_if = "Option::is_none")]
177    pub source_commit: Option<String>,
178}
179
180#[derive(Clone, Debug, Default, PartialEq, Serialize)]
181#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
182pub struct DescribeCodeReviewRequest {
183    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
184    #[serde(rename = "CodeReviewArn")]
185    pub code_review_arn: String,
186}
187
188#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
189#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
190pub struct DescribeCodeReviewResponse {
191    /// <p> Information about the code review. </p>
192    #[serde(rename = "CodeReview")]
193    #[serde(skip_serializing_if = "Option::is_none")]
194    pub code_review: Option<CodeReview>,
195}
196
197#[derive(Clone, Debug, Default, PartialEq, Serialize)]
198#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
199pub struct DescribeRecommendationFeedbackRequest {
200    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
201    #[serde(rename = "CodeReviewArn")]
202    pub code_review_arn: String,
203    /// <p> The recommendation ID that can be used to track the provided recommendations and then to collect the feedback. </p>
204    #[serde(rename = "RecommendationId")]
205    pub recommendation_id: String,
206    /// <p> Optional parameter to describe the feedback for a given user. If this is not supplied, it defaults to the user making the request. </p> <p> The <code>UserId</code> is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying"> Specifying a Principal</a> in the <i>AWS Identity and Access Management User Guide</i>. </p>
207    #[serde(rename = "UserId")]
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub user_id: Option<String>,
210}
211
212#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
213#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
214pub struct DescribeRecommendationFeedbackResponse {
215    /// <p> The recommendation feedback given by the user. </p>
216    #[serde(rename = "RecommendationFeedback")]
217    #[serde(skip_serializing_if = "Option::is_none")]
218    pub recommendation_feedback: Option<RecommendationFeedback>,
219}
220
221#[derive(Clone, Debug, Default, PartialEq, Serialize)]
222#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
223pub struct DescribeRepositoryAssociationRequest {
224    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html"> <code>RepositoryAssociation</code> </a> object. You can retrieve this ARN by calling <code>ListRepositories</code>.</p>
225    #[serde(rename = "AssociationArn")]
226    pub association_arn: String,
227}
228
229#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
230#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
231pub struct DescribeRepositoryAssociationResponse {
232    /// <p>Information about the repository association.</p>
233    #[serde(rename = "RepositoryAssociation")]
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub repository_association: Option<RepositoryAssociation>,
236}
237
238#[derive(Clone, Debug, Default, PartialEq, Serialize)]
239#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
240pub struct DisassociateRepositoryRequest {
241    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html"> <code>RepositoryAssociation</code> </a> object. </p>
242    #[serde(rename = "AssociationArn")]
243    pub association_arn: String,
244}
245
246#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
247#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
248pub struct DisassociateRepositoryResponse {
249    /// <p>Information about the disassociated repository.</p>
250    #[serde(rename = "RepositoryAssociation")]
251    #[serde(skip_serializing_if = "Option::is_none")]
252    pub repository_association: Option<RepositoryAssociation>,
253}
254
255#[derive(Clone, Debug, Default, PartialEq, Serialize)]
256#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
257pub struct ListCodeReviewsRequest {
258    /// <p> The maximum number of results that are returned per call. The default is 100. </p>
259    #[serde(rename = "MaxResults")]
260    #[serde(skip_serializing_if = "Option::is_none")]
261    pub max_results: Option<i64>,
262    /// <p> If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. </p>
263    #[serde(rename = "NextToken")]
264    #[serde(skip_serializing_if = "Option::is_none")]
265    pub next_token: Option<String>,
266    /// <p> List of provider types for filtering that needs to be applied before displaying the result. For example, <code>providerTypes=[GitHub]</code> lists code reviews from GitHub. </p>
267    #[serde(rename = "ProviderTypes")]
268    #[serde(skip_serializing_if = "Option::is_none")]
269    pub provider_types: Option<Vec<String>>,
270    /// <p> List of repository names for filtering that needs to be applied before displaying the result. </p>
271    #[serde(rename = "RepositoryNames")]
272    #[serde(skip_serializing_if = "Option::is_none")]
273    pub repository_names: Option<Vec<String>>,
274    /// <p><p> List of states for filtering that needs to be applied before displaying the result. For example, <code>states=[Pending]</code> lists code reviews in the Pending state. </p> <p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete. </p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed. </p> </li> <li> <p> <code>Failed</code>: The code review failed. </p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted. </p> </li> </ul></p>
275    #[serde(rename = "States")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub states: Option<Vec<String>>,
278    /// <p> The type of code reviews to list in the response. </p>
279    #[serde(rename = "Type")]
280    pub type_: String,
281}
282
283#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
284#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
285pub struct ListCodeReviewsResponse {
286    /// <p> A list of code reviews that meet the criteria of the request. </p>
287    #[serde(rename = "CodeReviewSummaries")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub code_review_summaries: Option<Vec<CodeReviewSummary>>,
290    /// <p> Pagination token. </p>
291    #[serde(rename = "NextToken")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub next_token: Option<String>,
294}
295
296#[derive(Clone, Debug, Default, PartialEq, Serialize)]
297#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
298pub struct ListRecommendationFeedbackRequest {
299    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
300    #[serde(rename = "CodeReviewArn")]
301    pub code_review_arn: String,
302    /// <p> The maximum number of results that are returned per call. The default is 100. </p>
303    #[serde(rename = "MaxResults")]
304    #[serde(skip_serializing_if = "Option::is_none")]
305    pub max_results: Option<i64>,
306    /// <p> If <code>nextToken</code> is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. </p>
307    #[serde(rename = "NextToken")]
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub next_token: Option<String>,
310    /// <p> Used to query the recommendation feedback for a given recommendation. </p>
311    #[serde(rename = "RecommendationIds")]
312    #[serde(skip_serializing_if = "Option::is_none")]
313    pub recommendation_ids: Option<Vec<String>>,
314    /// <p> An AWS user's account ID or Amazon Resource Name (ARN). Use this ID to query the recommendation feedback for a code review from that user. </p> <p> The <code>UserId</code> is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying"> Specifying a Principal</a> in the <i>AWS Identity and Access Management User Guide</i>. </p>
315    #[serde(rename = "UserIds")]
316    #[serde(skip_serializing_if = "Option::is_none")]
317    pub user_ids: Option<Vec<String>>,
318}
319
320#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
321#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
322pub struct ListRecommendationFeedbackResponse {
323    /// <p> If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. </p>
324    #[serde(rename = "NextToken")]
325    #[serde(skip_serializing_if = "Option::is_none")]
326    pub next_token: Option<String>,
327    /// <p> Recommendation feedback summaries corresponding to the code review ARN. </p>
328    #[serde(rename = "RecommendationFeedbackSummaries")]
329    #[serde(skip_serializing_if = "Option::is_none")]
330    pub recommendation_feedback_summaries: Option<Vec<RecommendationFeedbackSummary>>,
331}
332
333#[derive(Clone, Debug, Default, PartialEq, Serialize)]
334#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
335pub struct ListRecommendationsRequest {
336    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
337    #[serde(rename = "CodeReviewArn")]
338    pub code_review_arn: String,
339    /// <p> The maximum number of results that are returned per call. The default is 100. </p>
340    #[serde(rename = "MaxResults")]
341    #[serde(skip_serializing_if = "Option::is_none")]
342    pub max_results: Option<i64>,
343    /// <p> Pagination token. </p>
344    #[serde(rename = "NextToken")]
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub next_token: Option<String>,
347}
348
349#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
350#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
351pub struct ListRecommendationsResponse {
352    /// <p> Pagination token. </p>
353    #[serde(rename = "NextToken")]
354    #[serde(skip_serializing_if = "Option::is_none")]
355    pub next_token: Option<String>,
356    /// <p> List of recommendations for the requested code review. </p>
357    #[serde(rename = "RecommendationSummaries")]
358    #[serde(skip_serializing_if = "Option::is_none")]
359    pub recommendation_summaries: Option<Vec<RecommendationSummary>>,
360}
361
362#[derive(Clone, Debug, Default, PartialEq, Serialize)]
363#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
364pub struct ListRepositoryAssociationsRequest {
365    /// <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>
366    #[serde(rename = "MaxResults")]
367    #[serde(skip_serializing_if = "Option::is_none")]
368    pub max_results: Option<i64>,
369    /// <p>List of repository names to use as a filter.</p>
370    #[serde(rename = "Names")]
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub names: Option<Vec<String>>,
373    /// <p><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> <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> </note></p>
374    #[serde(rename = "NextToken")]
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub next_token: Option<String>,
377    /// <p>List of owners to use as a filter. For AWS CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket, this is name of the account that was used to associate the repository. </p>
378    #[serde(rename = "Owners")]
379    #[serde(skip_serializing_if = "Option::is_none")]
380    pub owners: Option<Vec<String>>,
381    /// <p>List of provider types to use as a filter.</p>
382    #[serde(rename = "ProviderTypes")]
383    #[serde(skip_serializing_if = "Option::is_none")]
384    pub provider_types: Option<Vec<String>>,
385    /// <p><p>List of repository association states to use as a filter.</p> <p>The valid repository association states are:</p> <ul> <li> <p> <b>Associated</b>: The repository association is complete. </p> </li> <li> <p> <b>Associating</b>: CodeGuru Reviewer is: </p> <ul> <li> <p> Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review. </p> <note> <p> If your repository <code>ProviderType</code> is <code>GitHub</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> </note> </li> <li> <p> Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository. </p> </li> </ul> </li> <li> <p> <b>Failed</b>: The repository failed to associate or disassociate. </p> </li> <li> <p> <b>Disassociating</b>: CodeGuru Reviewer is removing the repository&#39;s pull request notifications and source code access. </p> </li> </ul></p>
386    #[serde(rename = "States")]
387    #[serde(skip_serializing_if = "Option::is_none")]
388    pub states: Option<Vec<String>>,
389}
390
391#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
392#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
393pub struct ListRepositoryAssociationsResponse {
394    /// <p>The <code>nextToken</code> value to include in a future <code>ListRecommendations</code> request. When the results of a <code>ListRecommendations</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return. </p>
395    #[serde(rename = "NextToken")]
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub next_token: Option<String>,
398    /// <p>A list of repository associations that meet the criteria of the request.</p>
399    #[serde(rename = "RepositoryAssociationSummaries")]
400    #[serde(skip_serializing_if = "Option::is_none")]
401    pub repository_association_summaries: Option<Vec<RepositoryAssociationSummary>>,
402}
403
404/// <p> Information about the statistics from the code review. </p>
405#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
406#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
407pub struct Metrics {
408    /// <p> Total number of recommendations found in the code review. </p>
409    #[serde(rename = "FindingsCount")]
410    #[serde(skip_serializing_if = "Option::is_none")]
411    pub findings_count: Option<i64>,
412    /// <p> Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, <code>MeteredLinesOfCodeCount</code> includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code for a total of 2,725 lines of code. </p>
413    #[serde(rename = "MeteredLinesOfCodeCount")]
414    #[serde(skip_serializing_if = "Option::is_none")]
415    pub metered_lines_of_code_count: Option<i64>,
416}
417
418/// <p> Information about metrics summaries. </p>
419#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
420#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
421pub struct MetricsSummary {
422    /// <p> Total number of recommendations found in the code review. </p>
423    #[serde(rename = "FindingsCount")]
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub findings_count: Option<i64>,
426    /// <p> Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, <code>MeteredLinesOfCodeCount</code> includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code for a total of 2,725 lines of code. </p>
427    #[serde(rename = "MeteredLinesOfCodeCount")]
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub metered_lines_of_code_count: Option<i64>,
430}
431
432#[derive(Clone, Debug, Default, PartialEq, Serialize)]
433#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
434pub struct PutRecommendationFeedbackRequest {
435    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
436    #[serde(rename = "CodeReviewArn")]
437    pub code_review_arn: String,
438    /// <p> List for storing reactions. Reactions are utf-8 text code for emojis. If you send an empty list it clears all your feedback. </p>
439    #[serde(rename = "Reactions")]
440    pub reactions: Vec<String>,
441    /// <p> The recommendation ID that can be used to track the provided recommendations and then to collect the feedback. </p>
442    #[serde(rename = "RecommendationId")]
443    pub recommendation_id: String,
444}
445
446#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
447#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
448pub struct PutRecommendationFeedbackResponse {}
449
450/// <p> Information about the recommendation feedback. </p>
451#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
452#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
453pub struct RecommendationFeedback {
454    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html"> <code>CodeReview</code> </a> object. </p>
455    #[serde(rename = "CodeReviewArn")]
456    #[serde(skip_serializing_if = "Option::is_none")]
457    pub code_review_arn: Option<String>,
458    /// <p> The time at which the feedback was created. </p>
459    #[serde(rename = "CreatedTimeStamp")]
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub created_time_stamp: Option<f64>,
462    /// <p> The time at which the feedback was last updated. </p>
463    #[serde(rename = "LastUpdatedTimeStamp")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub last_updated_time_stamp: Option<f64>,
466    /// <p> List for storing reactions. Reactions are utf-8 text code for emojis. You can send an empty list to clear off all your feedback. </p>
467    #[serde(rename = "Reactions")]
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub reactions: Option<Vec<String>>,
470    /// <p> The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback. </p>
471    #[serde(rename = "RecommendationId")]
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub recommendation_id: Option<String>,
474    /// <p> The ID of the user that made the API call. </p> <p> The <code>UserId</code> is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying"> Specifying a Principal</a> in the <i>AWS Identity and Access Management User Guide</i>. </p>
475    #[serde(rename = "UserId")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub user_id: Option<String>,
478}
479
480/// <p> Information about recommendation feedback summaries. </p>
481#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
482#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
483pub struct RecommendationFeedbackSummary {
484    /// <p> List for storing reactions. Reactions are utf-8 text code for emojis. </p>
485    #[serde(rename = "Reactions")]
486    #[serde(skip_serializing_if = "Option::is_none")]
487    pub reactions: Option<Vec<String>>,
488    /// <p> The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback. </p>
489    #[serde(rename = "RecommendationId")]
490    #[serde(skip_serializing_if = "Option::is_none")]
491    pub recommendation_id: Option<String>,
492    /// <p> The ID of the user that gave the feedback. </p> <p> The <code>UserId</code> is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying"> Specifying a Principal</a> in the <i>AWS Identity and Access Management User Guide</i>. </p>
493    #[serde(rename = "UserId")]
494    #[serde(skip_serializing_if = "Option::is_none")]
495    pub user_id: Option<String>,
496}
497
498/// <p> Information about recommendations. </p>
499#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
500#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
501pub struct RecommendationSummary {
502    /// <p> A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line and the end line. </p>
503    #[serde(rename = "Description")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub description: Option<String>,
506    /// <p> Last line where the recommendation is applicable in the source commit or source branch. For a single line comment the start line and end line values are the same. </p>
507    #[serde(rename = "EndLine")]
508    #[serde(skip_serializing_if = "Option::is_none")]
509    pub end_line: Option<i64>,
510    /// <p>Name of the file on which a recommendation is provided.</p>
511    #[serde(rename = "FilePath")]
512    #[serde(skip_serializing_if = "Option::is_none")]
513    pub file_path: Option<String>,
514    /// <p> The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback. </p>
515    #[serde(rename = "RecommendationId")]
516    #[serde(skip_serializing_if = "Option::is_none")]
517    pub recommendation_id: Option<String>,
518    /// <p> Start line from where the recommendation is applicable in the source commit or source branch. </p>
519    #[serde(rename = "StartLine")]
520    #[serde(skip_serializing_if = "Option::is_none")]
521    pub start_line: Option<i64>,
522}
523
524/// <p> Information about an associated AWS CodeCommit repository or an associated repository that is managed by AWS CodeStar Connections (for example, Bitbucket). This <code>Repository</code> object is not used if your source code is in an associated GitHub repository. </p>
525#[derive(Clone, Debug, Default, PartialEq, Serialize)]
526#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
527pub struct Repository {
528    /// <p> Information about a Bitbucket repository. </p>
529    #[serde(rename = "Bitbucket")]
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub bitbucket: Option<ThirdPartySourceRepository>,
532    /// <p>Information about an AWS CodeCommit repository.</p>
533    #[serde(rename = "CodeCommit")]
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub code_commit: Option<CodeCommitRepository>,
536    /// <p> Information about a GitHub Enterprise Server repository. </p>
537    #[serde(rename = "GitHubEnterpriseServer")]
538    #[serde(skip_serializing_if = "Option::is_none")]
539    pub git_hub_enterprise_server: Option<ThirdPartySourceRepository>,
540}
541
542/// <p>Information about a repository association. The <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html"> <code>DescribeRepositoryAssociation</code> </a> operation returns a <code>RepositoryAssociation</code> object.</p>
543#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
544#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
545pub struct RepositoryAssociation {
546    /// <p>The Amazon Resource Name (ARN) identifying the repository association.</p>
547    #[serde(rename = "AssociationArn")]
548    #[serde(skip_serializing_if = "Option::is_none")]
549    pub association_arn: Option<String>,
550    /// <p>The ID of the repository association.</p>
551    #[serde(rename = "AssociationId")]
552    #[serde(skip_serializing_if = "Option::is_none")]
553    pub association_id: Option<String>,
554    /// <p> The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is <code>arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id</code>. For more information, see <a href="https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html">Connection</a> in the <i>AWS CodeStar Connections API Reference</i>. </p>
555    #[serde(rename = "ConnectionArn")]
556    #[serde(skip_serializing_if = "Option::is_none")]
557    pub connection_arn: Option<String>,
558    /// <p>The time, in milliseconds since the epoch, when the repository association was created.</p>
559    #[serde(rename = "CreatedTimeStamp")]
560    #[serde(skip_serializing_if = "Option::is_none")]
561    pub created_time_stamp: Option<f64>,
562    /// <p>The time, in milliseconds since the epoch, when the repository association was last updated.</p>
563    #[serde(rename = "LastUpdatedTimeStamp")]
564    #[serde(skip_serializing_if = "Option::is_none")]
565    pub last_updated_time_stamp: Option<f64>,
566    /// <p>The name of the repository.</p>
567    #[serde(rename = "Name")]
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub name: Option<String>,
570    /// <p>The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub or Bitbucket repository, this is the username for the account that owns the repository.</p>
571    #[serde(rename = "Owner")]
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub owner: Option<String>,
574    /// <p>The provider type of the repository association.</p>
575    #[serde(rename = "ProviderType")]
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub provider_type: Option<String>,
578    /// <p><p>The state of the repository association.</p> <p>The valid repository association states are:</p> <ul> <li> <p> <b>Associated</b>: The repository association is complete. </p> </li> <li> <p> <b>Associating</b>: CodeGuru Reviewer is: </p> <ul> <li> <p> Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review. </p> <note> <p> If your repository <code>ProviderType</code> is <code>GitHub</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> </note> </li> <li> <p> Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository. </p> </li> </ul> </li> <li> <p> <b>Failed</b>: The repository failed to associate or disassociate. </p> </li> <li> <p> <b>Disassociating</b>: CodeGuru Reviewer is removing the repository&#39;s pull request notifications and source code access. </p> </li> </ul></p>
579    #[serde(rename = "State")]
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub state: Option<String>,
582    /// <p>A description of why the repository association is in the current state.</p>
583    #[serde(rename = "StateReason")]
584    #[serde(skip_serializing_if = "Option::is_none")]
585    pub state_reason: Option<String>,
586}
587
588/// <p>Summary information about a repository association. The <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html"> <code>ListRepositoryAssociations</code> </a> operation returns a list of <code>RepositoryAssociationSummary</code> objects.</p>
589#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
590#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
591pub struct RepositoryAssociationSummary {
592    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html"> <code>RepositoryAssociation</code> </a> object. </p>
593    #[serde(rename = "AssociationArn")]
594    #[serde(skip_serializing_if = "Option::is_none")]
595    pub association_arn: Option<String>,
596    /// <p> The repository association ID. </p>
597    #[serde(rename = "AssociationId")]
598    #[serde(skip_serializing_if = "Option::is_none")]
599    pub association_id: Option<String>,
600    /// <p> The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is <code>arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id</code>. For more information, see <a href="https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html">Connection</a> in the <i>AWS CodeStar Connections API Reference</i>. </p>
601    #[serde(rename = "ConnectionArn")]
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub connection_arn: Option<String>,
604    /// <p>The time, in milliseconds since the epoch, since the repository association was last updated. </p>
605    #[serde(rename = "LastUpdatedTimeStamp")]
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub last_updated_time_stamp: Option<f64>,
608    /// <p>The name of the repository association.</p>
609    #[serde(rename = "Name")]
610    #[serde(skip_serializing_if = "Option::is_none")]
611    pub name: Option<String>,
612    /// <p>The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub or Bitbucket repository, this is the username for the account that owns the repository.</p>
613    #[serde(rename = "Owner")]
614    #[serde(skip_serializing_if = "Option::is_none")]
615    pub owner: Option<String>,
616    /// <p>The provider type of the repository association.</p>
617    #[serde(rename = "ProviderType")]
618    #[serde(skip_serializing_if = "Option::is_none")]
619    pub provider_type: Option<String>,
620    /// <p><p>The state of the repository association.</p> <p>The valid repository association states are:</p> <ul> <li> <p> <b>Associated</b>: The repository association is complete. </p> </li> <li> <p> <b>Associating</b>: CodeGuru Reviewer is: </p> <ul> <li> <p> Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review. </p> <note> <p> If your repository <code>ProviderType</code> is <code>GitHub</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> </note> </li> <li> <p> Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository. </p> </li> </ul> </li> <li> <p> <b>Failed</b>: The repository failed to associate or disassociate. </p> </li> <li> <p> <b>Disassociating</b>: CodeGuru Reviewer is removing the repository&#39;s pull request notifications and source code access. </p> </li> </ul></p>
621    #[serde(rename = "State")]
622    #[serde(skip_serializing_if = "Option::is_none")]
623    pub state: Option<String>,
624}
625
626/// <p> Information about the source code type. </p>
627#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
628#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
629pub struct SourceCodeType {
630    /// <p> The commit diff for the pull request. </p>
631    #[serde(rename = "CommitDiff")]
632    #[serde(skip_serializing_if = "Option::is_none")]
633    pub commit_diff: Option<CommitDiffSourceCodeType>,
634}
635
636/// <p> Information about a third-party source repository connected to CodeGuru Reviewer. </p>
637#[derive(Clone, Debug, Default, PartialEq, Serialize)]
638#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
639pub struct ThirdPartySourceRepository {
640    /// <p> The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is <code>arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id</code>. For more information, see <a href="https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html">Connection</a> in the <i>AWS CodeStar Connections API Reference</i>. </p>
641    #[serde(rename = "ConnectionArn")]
642    pub connection_arn: String,
643    /// <p> The name of the third party source repository. </p>
644    #[serde(rename = "Name")]
645    pub name: String,
646    /// <p> The owner of the repository. For a GitHub, GitHub Enterprise, or Bitbucket repository, this is the username for the account that owns the repository. </p>
647    #[serde(rename = "Owner")]
648    pub owner: String,
649}
650
651/// Errors returned by AssociateRepository
652#[derive(Debug, PartialEq)]
653pub enum AssociateRepositoryError {
654    /// <p>You do not have sufficient access to perform this action.</p>
655    AccessDenied(String),
656    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
657    Conflict(String),
658    /// <p>The server encountered an internal error and is unable to complete the request.</p>
659    InternalServer(String),
660    /// <p>The request was denied due to request throttling.</p>
661    Throttling(String),
662}
663
664impl AssociateRepositoryError {
665    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateRepositoryError> {
666        if let Some(err) = proto::json::Error::parse_rest(&res) {
667            match err.typ.as_str() {
668                "AccessDeniedException" => {
669                    return RusotoError::Service(AssociateRepositoryError::AccessDenied(err.msg))
670                }
671                "ConflictException" => {
672                    return RusotoError::Service(AssociateRepositoryError::Conflict(err.msg))
673                }
674                "InternalServerException" => {
675                    return RusotoError::Service(AssociateRepositoryError::InternalServer(err.msg))
676                }
677                "ThrottlingException" => {
678                    return RusotoError::Service(AssociateRepositoryError::Throttling(err.msg))
679                }
680                "ValidationException" => return RusotoError::Validation(err.msg),
681                _ => {}
682            }
683        }
684        RusotoError::Unknown(res)
685    }
686}
687impl fmt::Display for AssociateRepositoryError {
688    #[allow(unused_variables)]
689    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
690        match *self {
691            AssociateRepositoryError::AccessDenied(ref cause) => write!(f, "{}", cause),
692            AssociateRepositoryError::Conflict(ref cause) => write!(f, "{}", cause),
693            AssociateRepositoryError::InternalServer(ref cause) => write!(f, "{}", cause),
694            AssociateRepositoryError::Throttling(ref cause) => write!(f, "{}", cause),
695        }
696    }
697}
698impl Error for AssociateRepositoryError {}
699/// Errors returned by DescribeCodeReview
700#[derive(Debug, PartialEq)]
701pub enum DescribeCodeReviewError {
702    /// <p>You do not have sufficient access to perform this action.</p>
703    AccessDenied(String),
704    /// <p>The server encountered an internal error and is unable to complete the request.</p>
705    InternalServer(String),
706    /// <p> The resource specified in the request was not found. </p>
707    ResourceNotFound(String),
708    /// <p>The request was denied due to request throttling.</p>
709    Throttling(String),
710}
711
712impl DescribeCodeReviewError {
713    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCodeReviewError> {
714        if let Some(err) = proto::json::Error::parse_rest(&res) {
715            match err.typ.as_str() {
716                "AccessDeniedException" => {
717                    return RusotoError::Service(DescribeCodeReviewError::AccessDenied(err.msg))
718                }
719                "InternalServerException" => {
720                    return RusotoError::Service(DescribeCodeReviewError::InternalServer(err.msg))
721                }
722                "ResourceNotFoundException" => {
723                    return RusotoError::Service(DescribeCodeReviewError::ResourceNotFound(err.msg))
724                }
725                "ThrottlingException" => {
726                    return RusotoError::Service(DescribeCodeReviewError::Throttling(err.msg))
727                }
728                "ValidationException" => return RusotoError::Validation(err.msg),
729                _ => {}
730            }
731        }
732        RusotoError::Unknown(res)
733    }
734}
735impl fmt::Display for DescribeCodeReviewError {
736    #[allow(unused_variables)]
737    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
738        match *self {
739            DescribeCodeReviewError::AccessDenied(ref cause) => write!(f, "{}", cause),
740            DescribeCodeReviewError::InternalServer(ref cause) => write!(f, "{}", cause),
741            DescribeCodeReviewError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
742            DescribeCodeReviewError::Throttling(ref cause) => write!(f, "{}", cause),
743        }
744    }
745}
746impl Error for DescribeCodeReviewError {}
747/// Errors returned by DescribeRecommendationFeedback
748#[derive(Debug, PartialEq)]
749pub enum DescribeRecommendationFeedbackError {
750    /// <p>You do not have sufficient access to perform this action.</p>
751    AccessDenied(String),
752    /// <p>The server encountered an internal error and is unable to complete the request.</p>
753    InternalServer(String),
754    /// <p> The resource specified in the request was not found. </p>
755    ResourceNotFound(String),
756    /// <p>The request was denied due to request throttling.</p>
757    Throttling(String),
758}
759
760impl DescribeRecommendationFeedbackError {
761    pub fn from_response(
762        res: BufferedHttpResponse,
763    ) -> RusotoError<DescribeRecommendationFeedbackError> {
764        if let Some(err) = proto::json::Error::parse_rest(&res) {
765            match err.typ.as_str() {
766                "AccessDeniedException" => {
767                    return RusotoError::Service(DescribeRecommendationFeedbackError::AccessDenied(
768                        err.msg,
769                    ))
770                }
771                "InternalServerException" => {
772                    return RusotoError::Service(
773                        DescribeRecommendationFeedbackError::InternalServer(err.msg),
774                    )
775                }
776                "ResourceNotFoundException" => {
777                    return RusotoError::Service(
778                        DescribeRecommendationFeedbackError::ResourceNotFound(err.msg),
779                    )
780                }
781                "ThrottlingException" => {
782                    return RusotoError::Service(DescribeRecommendationFeedbackError::Throttling(
783                        err.msg,
784                    ))
785                }
786                "ValidationException" => return RusotoError::Validation(err.msg),
787                _ => {}
788            }
789        }
790        RusotoError::Unknown(res)
791    }
792}
793impl fmt::Display for DescribeRecommendationFeedbackError {
794    #[allow(unused_variables)]
795    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
796        match *self {
797            DescribeRecommendationFeedbackError::AccessDenied(ref cause) => write!(f, "{}", cause),
798            DescribeRecommendationFeedbackError::InternalServer(ref cause) => {
799                write!(f, "{}", cause)
800            }
801            DescribeRecommendationFeedbackError::ResourceNotFound(ref cause) => {
802                write!(f, "{}", cause)
803            }
804            DescribeRecommendationFeedbackError::Throttling(ref cause) => write!(f, "{}", cause),
805        }
806    }
807}
808impl Error for DescribeRecommendationFeedbackError {}
809/// Errors returned by DescribeRepositoryAssociation
810#[derive(Debug, PartialEq)]
811pub enum DescribeRepositoryAssociationError {
812    /// <p>You do not have sufficient access to perform this action.</p>
813    AccessDenied(String),
814    /// <p>The server encountered an internal error and is unable to complete the request.</p>
815    InternalServer(String),
816    /// <p>The resource specified in the request was not found.</p>
817    NotFound(String),
818    /// <p>The request was denied due to request throttling.</p>
819    Throttling(String),
820}
821
822impl DescribeRepositoryAssociationError {
823    pub fn from_response(
824        res: BufferedHttpResponse,
825    ) -> RusotoError<DescribeRepositoryAssociationError> {
826        if let Some(err) = proto::json::Error::parse_rest(&res) {
827            match err.typ.as_str() {
828                "AccessDeniedException" => {
829                    return RusotoError::Service(DescribeRepositoryAssociationError::AccessDenied(
830                        err.msg,
831                    ))
832                }
833                "InternalServerException" => {
834                    return RusotoError::Service(
835                        DescribeRepositoryAssociationError::InternalServer(err.msg),
836                    )
837                }
838                "NotFoundException" => {
839                    return RusotoError::Service(DescribeRepositoryAssociationError::NotFound(
840                        err.msg,
841                    ))
842                }
843                "ThrottlingException" => {
844                    return RusotoError::Service(DescribeRepositoryAssociationError::Throttling(
845                        err.msg,
846                    ))
847                }
848                "ValidationException" => return RusotoError::Validation(err.msg),
849                _ => {}
850            }
851        }
852        RusotoError::Unknown(res)
853    }
854}
855impl fmt::Display for DescribeRepositoryAssociationError {
856    #[allow(unused_variables)]
857    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
858        match *self {
859            DescribeRepositoryAssociationError::AccessDenied(ref cause) => write!(f, "{}", cause),
860            DescribeRepositoryAssociationError::InternalServer(ref cause) => write!(f, "{}", cause),
861            DescribeRepositoryAssociationError::NotFound(ref cause) => write!(f, "{}", cause),
862            DescribeRepositoryAssociationError::Throttling(ref cause) => write!(f, "{}", cause),
863        }
864    }
865}
866impl Error for DescribeRepositoryAssociationError {}
867/// Errors returned by DisassociateRepository
868#[derive(Debug, PartialEq)]
869pub enum DisassociateRepositoryError {
870    /// <p>You do not have sufficient access to perform this action.</p>
871    AccessDenied(String),
872    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
873    Conflict(String),
874    /// <p>The server encountered an internal error and is unable to complete the request.</p>
875    InternalServer(String),
876    /// <p>The resource specified in the request was not found.</p>
877    NotFound(String),
878    /// <p>The request was denied due to request throttling.</p>
879    Throttling(String),
880}
881
882impl DisassociateRepositoryError {
883    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateRepositoryError> {
884        if let Some(err) = proto::json::Error::parse_rest(&res) {
885            match err.typ.as_str() {
886                "AccessDeniedException" => {
887                    return RusotoError::Service(DisassociateRepositoryError::AccessDenied(err.msg))
888                }
889                "ConflictException" => {
890                    return RusotoError::Service(DisassociateRepositoryError::Conflict(err.msg))
891                }
892                "InternalServerException" => {
893                    return RusotoError::Service(DisassociateRepositoryError::InternalServer(
894                        err.msg,
895                    ))
896                }
897                "NotFoundException" => {
898                    return RusotoError::Service(DisassociateRepositoryError::NotFound(err.msg))
899                }
900                "ThrottlingException" => {
901                    return RusotoError::Service(DisassociateRepositoryError::Throttling(err.msg))
902                }
903                "ValidationException" => return RusotoError::Validation(err.msg),
904                _ => {}
905            }
906        }
907        RusotoError::Unknown(res)
908    }
909}
910impl fmt::Display for DisassociateRepositoryError {
911    #[allow(unused_variables)]
912    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
913        match *self {
914            DisassociateRepositoryError::AccessDenied(ref cause) => write!(f, "{}", cause),
915            DisassociateRepositoryError::Conflict(ref cause) => write!(f, "{}", cause),
916            DisassociateRepositoryError::InternalServer(ref cause) => write!(f, "{}", cause),
917            DisassociateRepositoryError::NotFound(ref cause) => write!(f, "{}", cause),
918            DisassociateRepositoryError::Throttling(ref cause) => write!(f, "{}", cause),
919        }
920    }
921}
922impl Error for DisassociateRepositoryError {}
923/// Errors returned by ListCodeReviews
924#[derive(Debug, PartialEq)]
925pub enum ListCodeReviewsError {
926    /// <p>You do not have sufficient access to perform this action.</p>
927    AccessDenied(String),
928    /// <p>The server encountered an internal error and is unable to complete the request.</p>
929    InternalServer(String),
930    /// <p>The request was denied due to request throttling.</p>
931    Throttling(String),
932}
933
934impl ListCodeReviewsError {
935    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListCodeReviewsError> {
936        if let Some(err) = proto::json::Error::parse_rest(&res) {
937            match err.typ.as_str() {
938                "AccessDeniedException" => {
939                    return RusotoError::Service(ListCodeReviewsError::AccessDenied(err.msg))
940                }
941                "InternalServerException" => {
942                    return RusotoError::Service(ListCodeReviewsError::InternalServer(err.msg))
943                }
944                "ThrottlingException" => {
945                    return RusotoError::Service(ListCodeReviewsError::Throttling(err.msg))
946                }
947                "ValidationException" => return RusotoError::Validation(err.msg),
948                _ => {}
949            }
950        }
951        RusotoError::Unknown(res)
952    }
953}
954impl fmt::Display for ListCodeReviewsError {
955    #[allow(unused_variables)]
956    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
957        match *self {
958            ListCodeReviewsError::AccessDenied(ref cause) => write!(f, "{}", cause),
959            ListCodeReviewsError::InternalServer(ref cause) => write!(f, "{}", cause),
960            ListCodeReviewsError::Throttling(ref cause) => write!(f, "{}", cause),
961        }
962    }
963}
964impl Error for ListCodeReviewsError {}
965/// Errors returned by ListRecommendationFeedback
966#[derive(Debug, PartialEq)]
967pub enum ListRecommendationFeedbackError {
968    /// <p>You do not have sufficient access to perform this action.</p>
969    AccessDenied(String),
970    /// <p>The server encountered an internal error and is unable to complete the request.</p>
971    InternalServer(String),
972    /// <p> The resource specified in the request was not found. </p>
973    ResourceNotFound(String),
974    /// <p>The request was denied due to request throttling.</p>
975    Throttling(String),
976}
977
978impl ListRecommendationFeedbackError {
979    pub fn from_response(
980        res: BufferedHttpResponse,
981    ) -> RusotoError<ListRecommendationFeedbackError> {
982        if let Some(err) = proto::json::Error::parse_rest(&res) {
983            match err.typ.as_str() {
984                "AccessDeniedException" => {
985                    return RusotoError::Service(ListRecommendationFeedbackError::AccessDenied(
986                        err.msg,
987                    ))
988                }
989                "InternalServerException" => {
990                    return RusotoError::Service(ListRecommendationFeedbackError::InternalServer(
991                        err.msg,
992                    ))
993                }
994                "ResourceNotFoundException" => {
995                    return RusotoError::Service(ListRecommendationFeedbackError::ResourceNotFound(
996                        err.msg,
997                    ))
998                }
999                "ThrottlingException" => {
1000                    return RusotoError::Service(ListRecommendationFeedbackError::Throttling(
1001                        err.msg,
1002                    ))
1003                }
1004                "ValidationException" => return RusotoError::Validation(err.msg),
1005                _ => {}
1006            }
1007        }
1008        RusotoError::Unknown(res)
1009    }
1010}
1011impl fmt::Display for ListRecommendationFeedbackError {
1012    #[allow(unused_variables)]
1013    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1014        match *self {
1015            ListRecommendationFeedbackError::AccessDenied(ref cause) => write!(f, "{}", cause),
1016            ListRecommendationFeedbackError::InternalServer(ref cause) => write!(f, "{}", cause),
1017            ListRecommendationFeedbackError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1018            ListRecommendationFeedbackError::Throttling(ref cause) => write!(f, "{}", cause),
1019        }
1020    }
1021}
1022impl Error for ListRecommendationFeedbackError {}
1023/// Errors returned by ListRecommendations
1024#[derive(Debug, PartialEq)]
1025pub enum ListRecommendationsError {
1026    /// <p>You do not have sufficient access to perform this action.</p>
1027    AccessDenied(String),
1028    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1029    InternalServer(String),
1030    /// <p> The resource specified in the request was not found. </p>
1031    ResourceNotFound(String),
1032    /// <p>The request was denied due to request throttling.</p>
1033    Throttling(String),
1034}
1035
1036impl ListRecommendationsError {
1037    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRecommendationsError> {
1038        if let Some(err) = proto::json::Error::parse_rest(&res) {
1039            match err.typ.as_str() {
1040                "AccessDeniedException" => {
1041                    return RusotoError::Service(ListRecommendationsError::AccessDenied(err.msg))
1042                }
1043                "InternalServerException" => {
1044                    return RusotoError::Service(ListRecommendationsError::InternalServer(err.msg))
1045                }
1046                "ResourceNotFoundException" => {
1047                    return RusotoError::Service(ListRecommendationsError::ResourceNotFound(
1048                        err.msg,
1049                    ))
1050                }
1051                "ThrottlingException" => {
1052                    return RusotoError::Service(ListRecommendationsError::Throttling(err.msg))
1053                }
1054                "ValidationException" => return RusotoError::Validation(err.msg),
1055                _ => {}
1056            }
1057        }
1058        RusotoError::Unknown(res)
1059    }
1060}
1061impl fmt::Display for ListRecommendationsError {
1062    #[allow(unused_variables)]
1063    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1064        match *self {
1065            ListRecommendationsError::AccessDenied(ref cause) => write!(f, "{}", cause),
1066            ListRecommendationsError::InternalServer(ref cause) => write!(f, "{}", cause),
1067            ListRecommendationsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1068            ListRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
1069        }
1070    }
1071}
1072impl Error for ListRecommendationsError {}
1073/// Errors returned by ListRepositoryAssociations
1074#[derive(Debug, PartialEq)]
1075pub enum ListRepositoryAssociationsError {
1076    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1077    InternalServer(String),
1078    /// <p>The request was denied due to request throttling.</p>
1079    Throttling(String),
1080}
1081
1082impl ListRepositoryAssociationsError {
1083    pub fn from_response(
1084        res: BufferedHttpResponse,
1085    ) -> RusotoError<ListRepositoryAssociationsError> {
1086        if let Some(err) = proto::json::Error::parse_rest(&res) {
1087            match err.typ.as_str() {
1088                "InternalServerException" => {
1089                    return RusotoError::Service(ListRepositoryAssociationsError::InternalServer(
1090                        err.msg,
1091                    ))
1092                }
1093                "ThrottlingException" => {
1094                    return RusotoError::Service(ListRepositoryAssociationsError::Throttling(
1095                        err.msg,
1096                    ))
1097                }
1098                "ValidationException" => return RusotoError::Validation(err.msg),
1099                _ => {}
1100            }
1101        }
1102        RusotoError::Unknown(res)
1103    }
1104}
1105impl fmt::Display for ListRepositoryAssociationsError {
1106    #[allow(unused_variables)]
1107    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1108        match *self {
1109            ListRepositoryAssociationsError::InternalServer(ref cause) => write!(f, "{}", cause),
1110            ListRepositoryAssociationsError::Throttling(ref cause) => write!(f, "{}", cause),
1111        }
1112    }
1113}
1114impl Error for ListRepositoryAssociationsError {}
1115/// Errors returned by PutRecommendationFeedback
1116#[derive(Debug, PartialEq)]
1117pub enum PutRecommendationFeedbackError {
1118    /// <p>You do not have sufficient access to perform this action.</p>
1119    AccessDenied(String),
1120    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1121    InternalServer(String),
1122    /// <p> The resource specified in the request was not found. </p>
1123    ResourceNotFound(String),
1124    /// <p>The request was denied due to request throttling.</p>
1125    Throttling(String),
1126}
1127
1128impl PutRecommendationFeedbackError {
1129    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutRecommendationFeedbackError> {
1130        if let Some(err) = proto::json::Error::parse_rest(&res) {
1131            match err.typ.as_str() {
1132                "AccessDeniedException" => {
1133                    return RusotoError::Service(PutRecommendationFeedbackError::AccessDenied(
1134                        err.msg,
1135                    ))
1136                }
1137                "InternalServerException" => {
1138                    return RusotoError::Service(PutRecommendationFeedbackError::InternalServer(
1139                        err.msg,
1140                    ))
1141                }
1142                "ResourceNotFoundException" => {
1143                    return RusotoError::Service(PutRecommendationFeedbackError::ResourceNotFound(
1144                        err.msg,
1145                    ))
1146                }
1147                "ThrottlingException" => {
1148                    return RusotoError::Service(PutRecommendationFeedbackError::Throttling(
1149                        err.msg,
1150                    ))
1151                }
1152                "ValidationException" => return RusotoError::Validation(err.msg),
1153                _ => {}
1154            }
1155        }
1156        RusotoError::Unknown(res)
1157    }
1158}
1159impl fmt::Display for PutRecommendationFeedbackError {
1160    #[allow(unused_variables)]
1161    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1162        match *self {
1163            PutRecommendationFeedbackError::AccessDenied(ref cause) => write!(f, "{}", cause),
1164            PutRecommendationFeedbackError::InternalServer(ref cause) => write!(f, "{}", cause),
1165            PutRecommendationFeedbackError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1166            PutRecommendationFeedbackError::Throttling(ref cause) => write!(f, "{}", cause),
1167        }
1168    }
1169}
1170impl Error for PutRecommendationFeedbackError {}
1171/// Trait representing the capabilities of the CodeGuruReviewer API. CodeGuruReviewer clients implement this trait.
1172#[async_trait]
1173pub trait CodeGuruReviewer {
1174    /// <p><p> Use to associate an AWS CodeCommit repository or a repostory managed by AWS CodeStar Connections with Amazon CodeGuru Reviewer. When you associate a repository, CodeGuru Reviewer reviews source code changes in the repository&#39;s pull requests and provides automatic recommendations. You can view recommendations using the CodeGuru Reviewer console. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/recommendations.html">Recommendations in Amazon CodeGuru Reviewer</a> in the <i>Amazon CodeGuru Reviewer User Guide.</i> </p> <p>If you associate a CodeCommit repository, it must be in the same AWS Region and AWS account where its CodeGuru Reviewer code reviews are configured.</p> <p> Bitbucket and GitHub Enterprise Server repositories are managed by AWS CodeStar Connections to connect to CodeGuru Reviewer. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/reviewer-ug/step-one.html#select-repository-source-provider">Connect to a repository source provider</a> in the <i>Amazon CodeGuru Reviewer User Guide.</i> </p> <note> <p> You cannot use the CodeGuru Reviewer SDK or the AWS CLI to associate a GitHub repository with Amazon CodeGuru Reviewer. To associate a GitHub repository, use the console. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/getting-started-with-guru.html">Getting started with CodeGuru Reviewer</a> in the <i>CodeGuru Reviewer User Guide.</i> </p> </note></p>
1175    async fn associate_repository(
1176        &self,
1177        input: AssociateRepositoryRequest,
1178    ) -> Result<AssociateRepositoryResponse, RusotoError<AssociateRepositoryError>>;
1179
1180    /// <p> Returns the metadata associated with the code review along with its status.</p>
1181    async fn describe_code_review(
1182        &self,
1183        input: DescribeCodeReviewRequest,
1184    ) -> Result<DescribeCodeReviewResponse, RusotoError<DescribeCodeReviewError>>;
1185
1186    /// <p> Describes the customer feedback for a CodeGuru Reviewer recommendation. </p>
1187    async fn describe_recommendation_feedback(
1188        &self,
1189        input: DescribeRecommendationFeedbackRequest,
1190    ) -> Result<
1191        DescribeRecommendationFeedbackResponse,
1192        RusotoError<DescribeRecommendationFeedbackError>,
1193    >;
1194
1195    /// <p> Returns a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html"> <code>RepositoryAssociation</code> </a> object that contains information about the requested repository association. </p>
1196    async fn describe_repository_association(
1197        &self,
1198        input: DescribeRepositoryAssociationRequest,
1199    ) -> Result<
1200        DescribeRepositoryAssociationResponse,
1201        RusotoError<DescribeRepositoryAssociationError>,
1202    >;
1203
1204    /// <p>Removes the association between Amazon CodeGuru Reviewer and a repository.</p>
1205    async fn disassociate_repository(
1206        &self,
1207        input: DisassociateRepositoryRequest,
1208    ) -> Result<DisassociateRepositoryResponse, RusotoError<DisassociateRepositoryError>>;
1209
1210    /// <p> Lists all the code reviews that the customer has created in the past 90 days. </p>
1211    async fn list_code_reviews(
1212        &self,
1213        input: ListCodeReviewsRequest,
1214    ) -> Result<ListCodeReviewsResponse, RusotoError<ListCodeReviewsError>>;
1215
1216    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RecommendationFeedbackSummary.html"> <code>RecommendationFeedbackSummary</code> </a> objects that contain customer recommendation feedback for all CodeGuru Reviewer users. </p>
1217    async fn list_recommendation_feedback(
1218        &self,
1219        input: ListRecommendationFeedbackRequest,
1220    ) -> Result<ListRecommendationFeedbackResponse, RusotoError<ListRecommendationFeedbackError>>;
1221
1222    /// <p> Returns the list of all recommendations for a completed code review. </p>
1223    async fn list_recommendations(
1224        &self,
1225        input: ListRecommendationsRequest,
1226    ) -> Result<ListRecommendationsResponse, RusotoError<ListRecommendationsError>>;
1227
1228    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html"> <code>RepositoryAssociationSummary</code> </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"> <code>ProviderType</code> </a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name"> <code>Name</code> </a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State"> <code>State</code> </a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner"> <code>Owner</code> </a>. </p>
1229    async fn list_repository_associations(
1230        &self,
1231        input: ListRepositoryAssociationsRequest,
1232    ) -> Result<ListRepositoryAssociationsResponse, RusotoError<ListRepositoryAssociationsError>>;
1233
1234    /// <p> Stores customer feedback for a CodeGuru Reviewer recommendation. When this API is called again with different reactions the previous feedback is overwritten. </p>
1235    async fn put_recommendation_feedback(
1236        &self,
1237        input: PutRecommendationFeedbackRequest,
1238    ) -> Result<PutRecommendationFeedbackResponse, RusotoError<PutRecommendationFeedbackError>>;
1239}
1240/// A client for the CodeGuruReviewer API.
1241#[derive(Clone)]
1242pub struct CodeGuruReviewerClient {
1243    client: Client,
1244    region: region::Region,
1245}
1246
1247impl CodeGuruReviewerClient {
1248    /// Creates a client backed by the default tokio event loop.
1249    ///
1250    /// The client will use the default credentials provider and tls client.
1251    pub fn new(region: region::Region) -> CodeGuruReviewerClient {
1252        CodeGuruReviewerClient {
1253            client: Client::shared(),
1254            region,
1255        }
1256    }
1257
1258    pub fn new_with<P, D>(
1259        request_dispatcher: D,
1260        credentials_provider: P,
1261        region: region::Region,
1262    ) -> CodeGuruReviewerClient
1263    where
1264        P: ProvideAwsCredentials + Send + Sync + 'static,
1265        D: DispatchSignedRequest + Send + Sync + 'static,
1266    {
1267        CodeGuruReviewerClient {
1268            client: Client::new_with(credentials_provider, request_dispatcher),
1269            region,
1270        }
1271    }
1272
1273    pub fn new_with_client(client: Client, region: region::Region) -> CodeGuruReviewerClient {
1274        CodeGuruReviewerClient { client, region }
1275    }
1276}
1277
1278#[async_trait]
1279impl CodeGuruReviewer for CodeGuruReviewerClient {
1280    /// <p><p> Use to associate an AWS CodeCommit repository or a repostory managed by AWS CodeStar Connections with Amazon CodeGuru Reviewer. When you associate a repository, CodeGuru Reviewer reviews source code changes in the repository&#39;s pull requests and provides automatic recommendations. You can view recommendations using the CodeGuru Reviewer console. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/recommendations.html">Recommendations in Amazon CodeGuru Reviewer</a> in the <i>Amazon CodeGuru Reviewer User Guide.</i> </p> <p>If you associate a CodeCommit repository, it must be in the same AWS Region and AWS account where its CodeGuru Reviewer code reviews are configured.</p> <p> Bitbucket and GitHub Enterprise Server repositories are managed by AWS CodeStar Connections to connect to CodeGuru Reviewer. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/reviewer-ug/step-one.html#select-repository-source-provider">Connect to a repository source provider</a> in the <i>Amazon CodeGuru Reviewer User Guide.</i> </p> <note> <p> You cannot use the CodeGuru Reviewer SDK or the AWS CLI to associate a GitHub repository with Amazon CodeGuru Reviewer. To associate a GitHub repository, use the console. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/getting-started-with-guru.html">Getting started with CodeGuru Reviewer</a> in the <i>CodeGuru Reviewer User Guide.</i> </p> </note></p>
1281    #[allow(unused_mut)]
1282    async fn associate_repository(
1283        &self,
1284        input: AssociateRepositoryRequest,
1285    ) -> Result<AssociateRepositoryResponse, RusotoError<AssociateRepositoryError>> {
1286        let request_uri = "/associations";
1287
1288        let mut request =
1289            SignedRequest::new("POST", "codeguru-reviewer", &self.region, &request_uri);
1290        request.set_content_type("application/x-amz-json-1.1".to_owned());
1291
1292        let encoded = Some(serde_json::to_vec(&input).unwrap());
1293        request.set_payload(encoded);
1294
1295        let mut response = self
1296            .client
1297            .sign_and_dispatch(request)
1298            .await
1299            .map_err(RusotoError::from)?;
1300        if response.status.is_success() {
1301            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1302            let result = proto::json::ResponsePayload::new(&response)
1303                .deserialize::<AssociateRepositoryResponse, _>()?;
1304
1305            Ok(result)
1306        } else {
1307            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1308            Err(AssociateRepositoryError::from_response(response))
1309        }
1310    }
1311
1312    /// <p> Returns the metadata associated with the code review along with its status.</p>
1313    #[allow(unused_mut)]
1314    async fn describe_code_review(
1315        &self,
1316        input: DescribeCodeReviewRequest,
1317    ) -> Result<DescribeCodeReviewResponse, RusotoError<DescribeCodeReviewError>> {
1318        let request_uri = format!(
1319            "/codereviews/{code_review_arn}",
1320            code_review_arn = input.code_review_arn
1321        );
1322
1323        let mut request =
1324            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1325        request.set_content_type("application/x-amz-json-1.1".to_owned());
1326
1327        let mut response = self
1328            .client
1329            .sign_and_dispatch(request)
1330            .await
1331            .map_err(RusotoError::from)?;
1332        if response.status.is_success() {
1333            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1334            let result = proto::json::ResponsePayload::new(&response)
1335                .deserialize::<DescribeCodeReviewResponse, _>()?;
1336
1337            Ok(result)
1338        } else {
1339            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1340            Err(DescribeCodeReviewError::from_response(response))
1341        }
1342    }
1343
1344    /// <p> Describes the customer feedback for a CodeGuru Reviewer recommendation. </p>
1345    #[allow(unused_mut)]
1346    async fn describe_recommendation_feedback(
1347        &self,
1348        input: DescribeRecommendationFeedbackRequest,
1349    ) -> Result<
1350        DescribeRecommendationFeedbackResponse,
1351        RusotoError<DescribeRecommendationFeedbackError>,
1352    > {
1353        let request_uri = format!(
1354            "/feedback/{code_review_arn}",
1355            code_review_arn = input.code_review_arn
1356        );
1357
1358        let mut request =
1359            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1360        request.set_content_type("application/x-amz-json-1.1".to_owned());
1361
1362        let mut params = Params::new();
1363        params.put("RecommendationId", &input.recommendation_id);
1364        if let Some(ref x) = input.user_id {
1365            params.put("UserId", x);
1366        }
1367        request.set_params(params);
1368
1369        let mut response = self
1370            .client
1371            .sign_and_dispatch(request)
1372            .await
1373            .map_err(RusotoError::from)?;
1374        if response.status.is_success() {
1375            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1376            let result = proto::json::ResponsePayload::new(&response)
1377                .deserialize::<DescribeRecommendationFeedbackResponse, _>()?;
1378
1379            Ok(result)
1380        } else {
1381            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1382            Err(DescribeRecommendationFeedbackError::from_response(response))
1383        }
1384    }
1385
1386    /// <p> Returns a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html"> <code>RepositoryAssociation</code> </a> object that contains information about the requested repository association. </p>
1387    #[allow(unused_mut)]
1388    async fn describe_repository_association(
1389        &self,
1390        input: DescribeRepositoryAssociationRequest,
1391    ) -> Result<
1392        DescribeRepositoryAssociationResponse,
1393        RusotoError<DescribeRepositoryAssociationError>,
1394    > {
1395        let request_uri = format!(
1396            "/associations/{association_arn}",
1397            association_arn = input.association_arn
1398        );
1399
1400        let mut request =
1401            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1402        request.set_content_type("application/x-amz-json-1.1".to_owned());
1403
1404        let mut response = self
1405            .client
1406            .sign_and_dispatch(request)
1407            .await
1408            .map_err(RusotoError::from)?;
1409        if response.status.is_success() {
1410            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1411            let result = proto::json::ResponsePayload::new(&response)
1412                .deserialize::<DescribeRepositoryAssociationResponse, _>()?;
1413
1414            Ok(result)
1415        } else {
1416            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1417            Err(DescribeRepositoryAssociationError::from_response(response))
1418        }
1419    }
1420
1421    /// <p>Removes the association between Amazon CodeGuru Reviewer and a repository.</p>
1422    #[allow(unused_mut)]
1423    async fn disassociate_repository(
1424        &self,
1425        input: DisassociateRepositoryRequest,
1426    ) -> Result<DisassociateRepositoryResponse, RusotoError<DisassociateRepositoryError>> {
1427        let request_uri = format!(
1428            "/associations/{association_arn}",
1429            association_arn = input.association_arn
1430        );
1431
1432        let mut request =
1433            SignedRequest::new("DELETE", "codeguru-reviewer", &self.region, &request_uri);
1434        request.set_content_type("application/x-amz-json-1.1".to_owned());
1435
1436        let mut response = self
1437            .client
1438            .sign_and_dispatch(request)
1439            .await
1440            .map_err(RusotoError::from)?;
1441        if response.status.is_success() {
1442            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1443            let result = proto::json::ResponsePayload::new(&response)
1444                .deserialize::<DisassociateRepositoryResponse, _>()?;
1445
1446            Ok(result)
1447        } else {
1448            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1449            Err(DisassociateRepositoryError::from_response(response))
1450        }
1451    }
1452
1453    /// <p> Lists all the code reviews that the customer has created in the past 90 days. </p>
1454    #[allow(unused_mut)]
1455    async fn list_code_reviews(
1456        &self,
1457        input: ListCodeReviewsRequest,
1458    ) -> Result<ListCodeReviewsResponse, RusotoError<ListCodeReviewsError>> {
1459        let request_uri = "/codereviews";
1460
1461        let mut request =
1462            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1463        request.set_content_type("application/x-amz-json-1.1".to_owned());
1464
1465        let mut params = Params::new();
1466        if let Some(ref x) = input.max_results {
1467            params.put("MaxResults", x);
1468        }
1469        if let Some(ref x) = input.next_token {
1470            params.put("NextToken", x);
1471        }
1472        if let Some(ref x) = input.provider_types {
1473            for item in x.iter() {
1474                params.put("ProviderTypes", item);
1475            }
1476        }
1477        if let Some(ref x) = input.repository_names {
1478            for item in x.iter() {
1479                params.put("RepositoryNames", item);
1480            }
1481        }
1482        if let Some(ref x) = input.states {
1483            for item in x.iter() {
1484                params.put("States", item);
1485            }
1486        }
1487        params.put("Type", &input.type_);
1488        request.set_params(params);
1489
1490        let mut response = self
1491            .client
1492            .sign_and_dispatch(request)
1493            .await
1494            .map_err(RusotoError::from)?;
1495        if response.status.is_success() {
1496            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1497            let result = proto::json::ResponsePayload::new(&response)
1498                .deserialize::<ListCodeReviewsResponse, _>()?;
1499
1500            Ok(result)
1501        } else {
1502            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1503            Err(ListCodeReviewsError::from_response(response))
1504        }
1505    }
1506
1507    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RecommendationFeedbackSummary.html"> <code>RecommendationFeedbackSummary</code> </a> objects that contain customer recommendation feedback for all CodeGuru Reviewer users. </p>
1508    #[allow(unused_mut)]
1509    async fn list_recommendation_feedback(
1510        &self,
1511        input: ListRecommendationFeedbackRequest,
1512    ) -> Result<ListRecommendationFeedbackResponse, RusotoError<ListRecommendationFeedbackError>>
1513    {
1514        let request_uri = format!(
1515            "/feedback/{code_review_arn}/RecommendationFeedback",
1516            code_review_arn = input.code_review_arn
1517        );
1518
1519        let mut request =
1520            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1521        request.set_content_type("application/x-amz-json-1.1".to_owned());
1522
1523        let mut params = Params::new();
1524        if let Some(ref x) = input.max_results {
1525            params.put("MaxResults", x);
1526        }
1527        if let Some(ref x) = input.next_token {
1528            params.put("NextToken", x);
1529        }
1530        if let Some(ref x) = input.recommendation_ids {
1531            for item in x.iter() {
1532                params.put("RecommendationIds", item);
1533            }
1534        }
1535        if let Some(ref x) = input.user_ids {
1536            for item in x.iter() {
1537                params.put("UserIds", item);
1538            }
1539        }
1540        request.set_params(params);
1541
1542        let mut response = self
1543            .client
1544            .sign_and_dispatch(request)
1545            .await
1546            .map_err(RusotoError::from)?;
1547        if response.status.is_success() {
1548            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1549            let result = proto::json::ResponsePayload::new(&response)
1550                .deserialize::<ListRecommendationFeedbackResponse, _>()?;
1551
1552            Ok(result)
1553        } else {
1554            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1555            Err(ListRecommendationFeedbackError::from_response(response))
1556        }
1557    }
1558
1559    /// <p> Returns the list of all recommendations for a completed code review. </p>
1560    #[allow(unused_mut)]
1561    async fn list_recommendations(
1562        &self,
1563        input: ListRecommendationsRequest,
1564    ) -> Result<ListRecommendationsResponse, RusotoError<ListRecommendationsError>> {
1565        let request_uri = format!(
1566            "/codereviews/{code_review_arn}/Recommendations",
1567            code_review_arn = input.code_review_arn
1568        );
1569
1570        let mut request =
1571            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1572        request.set_content_type("application/x-amz-json-1.1".to_owned());
1573
1574        let mut params = Params::new();
1575        if let Some(ref x) = input.max_results {
1576            params.put("MaxResults", x);
1577        }
1578        if let Some(ref x) = input.next_token {
1579            params.put("NextToken", x);
1580        }
1581        request.set_params(params);
1582
1583        let mut response = self
1584            .client
1585            .sign_and_dispatch(request)
1586            .await
1587            .map_err(RusotoError::from)?;
1588        if response.status.is_success() {
1589            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1590            let result = proto::json::ResponsePayload::new(&response)
1591                .deserialize::<ListRecommendationsResponse, _>()?;
1592
1593            Ok(result)
1594        } else {
1595            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1596            Err(ListRecommendationsError::from_response(response))
1597        }
1598    }
1599
1600    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html"> <code>RepositoryAssociationSummary</code> </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"> <code>ProviderType</code> </a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name"> <code>Name</code> </a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State"> <code>State</code> </a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner"> <code>Owner</code> </a>. </p>
1601    #[allow(unused_mut)]
1602    async fn list_repository_associations(
1603        &self,
1604        input: ListRepositoryAssociationsRequest,
1605    ) -> Result<ListRepositoryAssociationsResponse, RusotoError<ListRepositoryAssociationsError>>
1606    {
1607        let request_uri = "/associations";
1608
1609        let mut request =
1610            SignedRequest::new("GET", "codeguru-reviewer", &self.region, &request_uri);
1611        request.set_content_type("application/x-amz-json-1.1".to_owned());
1612
1613        let mut params = Params::new();
1614        if let Some(ref x) = input.max_results {
1615            params.put("MaxResults", x);
1616        }
1617        if let Some(ref x) = input.names {
1618            for item in x.iter() {
1619                params.put("Name", item);
1620            }
1621        }
1622        if let Some(ref x) = input.next_token {
1623            params.put("NextToken", x);
1624        }
1625        if let Some(ref x) = input.owners {
1626            for item in x.iter() {
1627                params.put("Owner", item);
1628            }
1629        }
1630        if let Some(ref x) = input.provider_types {
1631            for item in x.iter() {
1632                params.put("ProviderType", item);
1633            }
1634        }
1635        if let Some(ref x) = input.states {
1636            for item in x.iter() {
1637                params.put("State", item);
1638            }
1639        }
1640        request.set_params(params);
1641
1642        let mut response = self
1643            .client
1644            .sign_and_dispatch(request)
1645            .await
1646            .map_err(RusotoError::from)?;
1647        if response.status.is_success() {
1648            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1649            let result = proto::json::ResponsePayload::new(&response)
1650                .deserialize::<ListRepositoryAssociationsResponse, _>()?;
1651
1652            Ok(result)
1653        } else {
1654            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1655            Err(ListRepositoryAssociationsError::from_response(response))
1656        }
1657    }
1658
1659    /// <p> Stores customer feedback for a CodeGuru Reviewer recommendation. When this API is called again with different reactions the previous feedback is overwritten. </p>
1660    #[allow(unused_mut)]
1661    async fn put_recommendation_feedback(
1662        &self,
1663        input: PutRecommendationFeedbackRequest,
1664    ) -> Result<PutRecommendationFeedbackResponse, RusotoError<PutRecommendationFeedbackError>>
1665    {
1666        let request_uri = "/feedback";
1667
1668        let mut request =
1669            SignedRequest::new("PUT", "codeguru-reviewer", &self.region, &request_uri);
1670        request.set_content_type("application/x-amz-json-1.1".to_owned());
1671
1672        let encoded = Some(serde_json::to_vec(&input).unwrap());
1673        request.set_payload(encoded);
1674
1675        let mut response = self
1676            .client
1677            .sign_and_dispatch(request)
1678            .await
1679            .map_err(RusotoError::from)?;
1680        if response.status.is_success() {
1681            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1682            let result = proto::json::ResponsePayload::new(&response)
1683                .deserialize::<PutRecommendationFeedbackResponse, _>()?;
1684
1685            Ok(result)
1686        } else {
1687            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1688            Err(PutRecommendationFeedbackError::from_response(response))
1689        }
1690    }
1691}