1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package types
4
5import (
6	"time"
7)
8
9// Information about an AWS CodeCommit repository. The CodeCommit repository must
10// be in the same AWS Region and AWS account where its CodeGuru Reviewer code
11// reviews are configured.
12type CodeCommitRepository struct {
13
14	// The name of the AWS CodeCommit repository. For more information, see
15	// repositoryName
16	// (https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetRepository.html#CodeCommit-GetRepository-request-repositoryName)
17	// in the AWS CodeCommit API Reference.
18	//
19	// This member is required.
20	Name *string
21}
22
23// Information about a code review. A code review belongs to the associated
24// repository that contains the reviewed code.
25type CodeReview struct {
26
27	// The Amazon Resource Name (ARN) of the RepositoryAssociation
28	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html)
29	// that contains the reviewed source code. You can retrieve associated repository
30	// ARNs by calling ListRepositoryAssociations
31	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html).
32	AssociationArn *string
33
34	// The Amazon Resource Name (ARN) of the CodeReview
35	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html)
36	// object.
37	CodeReviewArn *string
38
39	// The time, in milliseconds since the epoch, when the code review was created.
40	CreatedTimeStamp *time.Time
41
42	// The time, in milliseconds since the epoch, when the code review was last
43	// updated.
44	LastUpdatedTimeStamp *time.Time
45
46	// The statistics from the code review.
47	Metrics *Metrics
48
49	// The name of the code review.
50	Name *string
51
52	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
53	// account ID of the account that owns the repository. For a GitHub, GitHub
54	// Enterprise Server, or Bitbucket repository, this is the username for the account
55	// that owns the repository.
56	Owner *string
57
58	// The type of repository that contains the reviewed code (for example, GitHub or
59	// Bitbucket).
60	ProviderType ProviderType
61
62	// The pull request ID for the code review.
63	PullRequestId *string
64
65	// The name of the repository.
66	RepositoryName *string
67
68	// The type of the source code for the code review.
69	SourceCodeType *SourceCodeType
70
71	// The valid code review states are:
72	//
73	// * Completed: The code review is complete.
74	//
75	// *
76	// Pending: The code review started and has not completed or failed.
77	//
78	// * Failed: The
79	// code review failed.
80	//
81	// * Deleting: The code review is being deleted.
82	State JobState
83
84	// The reason for the state of the code review.
85	StateReason *string
86
87	// The type of code review.
88	Type Type
89}
90
91// Information about the summary of the code review.
92type CodeReviewSummary struct {
93
94	// The Amazon Resource Name (ARN) of the CodeReview
95	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html)
96	// object.
97	CodeReviewArn *string
98
99	// The time, in milliseconds since the epoch, when the code review was created.
100	CreatedTimeStamp *time.Time
101
102	// The time, in milliseconds since the epoch, when the code review was last
103	// updated.
104	LastUpdatedTimeStamp *time.Time
105
106	// The statistics from the code review.
107	MetricsSummary *MetricsSummary
108
109	// The name of the code review.
110	Name *string
111
112	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
113	// account ID of the account that owns the repository. For a GitHub, GitHub
114	// Enterprise Server, or Bitbucket repository, this is the username for the account
115	// that owns the repository.
116	Owner *string
117
118	// The provider type of the repository association.
119	ProviderType ProviderType
120
121	// The pull request ID for the code review.
122	PullRequestId *string
123
124	// The name of the repository.
125	RepositoryName *string
126
127	// The state of the code review. The valid code review states are:
128	//
129	// * Completed:
130	// The code review is complete.
131	//
132	// * Pending: The code review started and has not
133	// completed or failed.
134	//
135	// * Failed: The code review failed.
136	//
137	// * Deleting: The code
138	// review is being deleted.
139	State JobState
140
141	// The type of the code review.
142	Type Type
143}
144
145// The type of a code review. There are two code review types:
146//
147// * PullRequest - A
148// code review that is automatically triggered by a pull request on an assocaited
149// repository. Because this type of code review is automatically generated, you
150// cannot specify this code review type using CreateCodeReview
151// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview).
152//
153// *
154// RepositoryAnalysis - A code review that analyzes all code under a specified
155// branch in an associated respository. The assocated repository is specified using
156// its ARN in CreateCodeReview
157// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview).
158type CodeReviewType struct {
159
160	// A code review that analyzes all code under a specified branch in an associated
161	// respository. The assocated repository is specified using its ARN in
162	// CreateCodeReview
163	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview).
164	//
165	// This member is required.
166	RepositoryAnalysis *RepositoryAnalysis
167}
168
169// A type of SourceCodeType
170// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
171// that specifies the commit diff for a pull request on an associated repository.
172type CommitDiffSourceCodeType struct {
173
174	// The SHA of the destination commit used to generate a commit diff.
175	DestinationCommit *string
176
177	// The SHA of the source commit used to generate a commit diff.
178	SourceCommit *string
179}
180
181// Information about the statistics from the code review.
182type Metrics struct {
183
184	// Total number of recommendations found in the code review.
185	FindingsCount *int64
186
187	// Lines of code metered in the code review. For the initial code review pull
188	// request and all subsequent revisions, this includes all lines of code in the
189	// files added to the pull request. In subsequent revisions, for files that already
190	// existed in the pull request, this includes only the changed lines of code. In
191	// both cases, this does not include non-code lines such as comments and import
192	// statements. For example, if you submit a pull request containing 5 files, each
193	// with 500 lines of code, and in a subsequent revision you added a new file with
194	// 200 lines of code, and also modified a total of 25 lines across the initial 5
195	// files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500
196	// lines), the new file (200 lines) and the 25 changed lines of code for a total of
197	// 2,725 lines of code.
198	MeteredLinesOfCodeCount *int64
199}
200
201// Information about metrics summaries.
202type MetricsSummary struct {
203
204	// Total number of recommendations found in the code review.
205	FindingsCount *int64
206
207	// Lines of code metered in the code review. For the initial code review pull
208	// request and all subsequent revisions, this includes all lines of code in the
209	// files added to the pull request. In subsequent revisions, for files that already
210	// existed in the pull request, this includes only the changed lines of code. In
211	// both cases, this does not include non-code lines such as comments and import
212	// statements. For example, if you submit a pull request containing 5 files, each
213	// with 500 lines of code, and in a subsequent revision you added a new file with
214	// 200 lines of code, and also modified a total of 25 lines across the initial 5
215	// files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500
216	// lines), the new file (200 lines) and the 25 changed lines of code for a total of
217	// 2,725 lines of code.
218	MeteredLinesOfCodeCount *int64
219}
220
221// Information about the recommendation feedback.
222type RecommendationFeedback struct {
223
224	// The Amazon Resource Name (ARN) of the CodeReview
225	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html)
226	// object.
227	CodeReviewArn *string
228
229	// The time at which the feedback was created.
230	CreatedTimeStamp *time.Time
231
232	// The time at which the feedback was last updated.
233	LastUpdatedTimeStamp *time.Time
234
235	// List for storing reactions. Reactions are utf-8 text code for emojis. You can
236	// send an empty list to clear off all your feedback.
237	Reactions []Reaction
238
239	// The recommendation ID that can be used to track the provided recommendations.
240	// Later on it can be used to collect the feedback.
241	RecommendationId *string
242
243	// The ID of the user that made the API call. The UserId is an IAM principal that
244	// can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more
245	// information, see  Specifying a Principal
246	// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying)
247	// in the AWS Identity and Access Management User Guide.
248	UserId *string
249}
250
251// Information about recommendation feedback summaries.
252type RecommendationFeedbackSummary struct {
253
254	// List for storing reactions. Reactions are utf-8 text code for emojis.
255	Reactions []Reaction
256
257	// The recommendation ID that can be used to track the provided recommendations.
258	// Later on it can be used to collect the feedback.
259	RecommendationId *string
260
261	// The ID of the user that gave the feedback. The UserId is an IAM principal that
262	// can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more
263	// information, see  Specifying a Principal
264	// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying)
265	// in the AWS Identity and Access Management User Guide.
266	UserId *string
267}
268
269// Information about recommendations.
270type RecommendationSummary struct {
271
272	// A description of the recommendation generated by CodeGuru Reviewer for the lines
273	// of code between the start line and the end line.
274	Description *string
275
276	// Last line where the recommendation is applicable in the source commit or source
277	// branch. For a single line comment the start line and end line values are the
278	// same.
279	EndLine *int32
280
281	// Name of the file on which a recommendation is provided.
282	FilePath *string
283
284	// The recommendation ID that can be used to track the provided recommendations.
285	// Later on it can be used to collect the feedback.
286	RecommendationId *string
287
288	// Start line from where the recommendation is applicable in the source commit or
289	// source branch.
290	StartLine *int32
291}
292
293// Information about an associated AWS CodeCommit repository or an associated
294// repository that is managed by AWS CodeStar Connections (for example, Bitbucket).
295// This Repository object is not used if your source code is in an associated
296// GitHub repository.
297type Repository struct {
298
299	// Information about a Bitbucket repository.
300	Bitbucket *ThirdPartySourceRepository
301
302	// Information about an AWS CodeCommit repository.
303	CodeCommit *CodeCommitRepository
304
305	// Information about a GitHub Enterprise Server repository.
306	GitHubEnterpriseServer *ThirdPartySourceRepository
307}
308
309// A code review type that analyzes all code under a specified branch in an
310// associated respository. The assocated repository is specified using its ARN when
311// you call CreateCodeReview
312// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview).
313type RepositoryAnalysis struct {
314
315	// A SourceCodeType
316	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
317	// that specifies the tip of a branch in an associated repository.
318	//
319	// This member is required.
320	RepositoryHead *RepositoryHeadSourceCodeType
321}
322
323// Information about a repository association. The DescribeRepositoryAssociation
324// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html)
325// operation returns a RepositoryAssociation object.
326type RepositoryAssociation struct {
327
328	// The Amazon Resource Name (ARN) identifying the repository association.
329	AssociationArn *string
330
331	// The ID of the repository association.
332	AssociationId *string
333
334	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
335	// format is
336	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
337	// For more information, see Connection
338	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
339	// in the AWS CodeStar Connections API Reference.
340	ConnectionArn *string
341
342	// The time, in milliseconds since the epoch, when the repository association was
343	// created.
344	CreatedTimeStamp *time.Time
345
346	// The time, in milliseconds since the epoch, when the repository association was
347	// last updated.
348	LastUpdatedTimeStamp *time.Time
349
350	// The name of the repository.
351	Name *string
352
353	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
354	// account ID of the account that owns the repository. For a GitHub, GitHub
355	// Enterprise Server, or Bitbucket repository, this is the username for the account
356	// that owns the repository.
357	Owner *string
358
359	// The provider type of the repository association.
360	ProviderType ProviderType
361
362	// The state of the repository association. The valid repository association states
363	// are:
364	//
365	// * Associated: The repository association is complete.
366	//
367	// * Associating:
368	// CodeGuru Reviewer is:
369	//
370	// * Setting up pull request notifications. This is required
371	// for pull requests to trigger a CodeGuru Reviewer review. If your repository
372	// ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru
373	// Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer
374	// reviews. If you delete these webhooks, reviews of code in your repository cannot
375	// be triggered.
376	//
377	// * Setting up source code access. This is required for CodeGuru
378	// Reviewer to securely clone code in your repository.
379	//
380	// * Failed: The repository
381	// failed to associate or disassociate.
382	//
383	// * Disassociating: CodeGuru Reviewer is
384	// removing the repository's pull request notifications and source code access.
385	//
386	// *
387	// Disassociated: CodeGuru Reviewer successfully disassociated the repository. You
388	// can create a new association with this repository if you want to review source
389	// code in it later. You can control access to code reviews created in an
390	// associated repository with tags after it has been disassociated. For more
391	// information, see Using tags to control access to associated repositories
392	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html)
393	// in the Amazon CodeGuru Reviewer User Guide.
394	State RepositoryAssociationState
395
396	// A description of why the repository association is in the current state.
397	StateReason *string
398}
399
400// Summary information about a repository association. The
401// ListRepositoryAssociations
402// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html)
403// operation returns a list of RepositoryAssociationSummary objects.
404type RepositoryAssociationSummary struct {
405
406	// The Amazon Resource Name (ARN) of the RepositoryAssociation
407	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html)
408	// object. You can retrieve this ARN by calling ListRepositoryAssociations
409	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html).
410	AssociationArn *string
411
412	// The repository association ID.
413	AssociationId *string
414
415	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
416	// format is
417	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
418	// For more information, see Connection
419	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
420	// in the AWS CodeStar Connections API Reference.
421	ConnectionArn *string
422
423	// The time, in milliseconds since the epoch, since the repository association was
424	// last updated.
425	LastUpdatedTimeStamp *time.Time
426
427	// The name of the repository association.
428	Name *string
429
430	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
431	// account ID of the account that owns the repository. For a GitHub, GitHub
432	// Enterprise Server, or Bitbucket repository, this is the username for the account
433	// that owns the repository.
434	Owner *string
435
436	// The provider type of the repository association.
437	ProviderType ProviderType
438
439	// The state of the repository association. The valid repository association states
440	// are:
441	//
442	// * Associated: The repository association is complete.
443	//
444	// * Associating:
445	// CodeGuru Reviewer is:
446	//
447	// * Setting up pull request notifications. This is required
448	// for pull requests to trigger a CodeGuru Reviewer review. If your repository
449	// ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru
450	// Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer
451	// reviews. If you delete these webhooks, reviews of code in your repository cannot
452	// be triggered.
453	//
454	// * Setting up source code access. This is required for CodeGuru
455	// Reviewer to securely clone code in your repository.
456	//
457	// * Failed: The repository
458	// failed to associate or disassociate.
459	//
460	// * Disassociating: CodeGuru Reviewer is
461	// removing the repository's pull request notifications and source code access.
462	//
463	// *
464	// Disassociated: CodeGuru Reviewer successfully disassociated the repository. You
465	// can create a new association with this repository if you want to review source
466	// code in it later. You can control access to code reviews created in an
467	// associated repository with tags after it has been disassociated. For more
468	// information, see Using tags to control access to associated repositories
469	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html)
470	// in the Amazon CodeGuru Reviewer User Guide.
471	State RepositoryAssociationState
472}
473
474// A SourceCodeType
475// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
476// that specifies the tip of a branch in an associated repository.
477type RepositoryHeadSourceCodeType struct {
478
479	// The name of the branch in an associated repository. The
480	// RepositoryHeadSourceCodeType specifies the tip of this branch.
481	//
482	// This member is required.
483	BranchName *string
484}
485
486// Specifies the source code that is analyzed in a code review. A code review can
487// analyze the source code that is specified using a pull request diff or a branch
488// in an associated repository.
489type SourceCodeType struct {
490
491	// A SourceCodeType
492	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
493	// that specifies a commit diff created by a pull request on an associated
494	// repository.
495	CommitDiff *CommitDiffSourceCodeType
496
497	// A SourceCodeType
498	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
499	// that specifies the tip of a branch in an associated repository.
500	RepositoryHead *RepositoryHeadSourceCodeType
501}
502
503// Information about a third-party source repository connected to CodeGuru
504// Reviewer.
505type ThirdPartySourceRepository struct {
506
507	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
508	// format is
509	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
510	// For more information, see Connection
511	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
512	// in the AWS CodeStar Connections API Reference.
513	//
514	// This member is required.
515	ConnectionArn *string
516
517	// The name of the third party source repository.
518	//
519	// This member is required.
520	Name *string
521
522	// The owner of the repository. For a GitHub, GitHub Enterprise, or Bitbucket
523	// repository, this is the username for the account that owns the repository.
524	//
525	// This member is required.
526	Owner *string
527}
528