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 associated
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 repository. The associated 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	// repository. The associated 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// An object that contains:
182//
183// * The encryption option for a repository association.
184// It is either owned by AWS Key Management Service (KMS) (AWS_OWNED_CMK) or
185// customer managed (CUSTOMER_MANAGED_CMK).
186//
187// * The ID of the AWS KMS key that is
188// associated with a respository association.
189type KMSKeyDetails struct {
190
191	// The encryption option for a repository association. It is either owned by AWS
192	// Key Management Service (KMS) (AWS_OWNED_CMK) or customer managed
193	// (CUSTOMER_MANAGED_CMK).
194	EncryptionOption EncryptionOption
195
196	// The ID of the AWS KMS key that is associated with a respository association.
197	KMSKeyId *string
198}
199
200// Information about the statistics from the code review.
201type Metrics struct {
202
203	// Total number of recommendations found in the code review.
204	FindingsCount *int64
205
206	// Lines of code metered in the code review. For the initial code review pull
207	// request and all subsequent revisions, this includes all lines of code in the
208	// files added to the pull request. In subsequent revisions, for files that already
209	// existed in the pull request, this includes only the changed lines of code. In
210	// both cases, this does not include non-code lines such as comments and import
211	// statements. For example, if you submit a pull request containing 5 files, each
212	// with 500 lines of code, and in a subsequent revision you added a new file with
213	// 200 lines of code, and also modified a total of 25 lines across the initial 5
214	// files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500
215	// lines), the new file (200 lines) and the 25 changed lines of code for a total of
216	// 2,725 lines of code.
217	MeteredLinesOfCodeCount *int64
218}
219
220// Information about metrics summaries.
221type MetricsSummary struct {
222
223	// Total number of recommendations found in the code review.
224	FindingsCount *int64
225
226	// Lines of code metered in the code review. For the initial code review pull
227	// request and all subsequent revisions, this includes all lines of code in the
228	// files added to the pull request. In subsequent revisions, for files that already
229	// existed in the pull request, this includes only the changed lines of code. In
230	// both cases, this does not include non-code lines such as comments and import
231	// statements. For example, if you submit a pull request containing 5 files, each
232	// with 500 lines of code, and in a subsequent revision you added a new file with
233	// 200 lines of code, and also modified a total of 25 lines across the initial 5
234	// files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500
235	// lines), the new file (200 lines) and the 25 changed lines of code for a total of
236	// 2,725 lines of code.
237	MeteredLinesOfCodeCount *int64
238}
239
240// Information about the recommendation feedback.
241type RecommendationFeedback struct {
242
243	// The Amazon Resource Name (ARN) of the CodeReview
244	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html)
245	// object.
246	CodeReviewArn *string
247
248	// The time at which the feedback was created.
249	CreatedTimeStamp *time.Time
250
251	// The time at which the feedback was last updated.
252	LastUpdatedTimeStamp *time.Time
253
254	// List for storing reactions. Reactions are utf-8 text code for emojis. You can
255	// send an empty list to clear off all your feedback.
256	Reactions []Reaction
257
258	// The recommendation ID that can be used to track the provided recommendations.
259	// Later on it can be used to collect the feedback.
260	RecommendationId *string
261
262	// The ID of the user that made the API call. The UserId is an IAM principal that
263	// can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more
264	// information, see  Specifying a Principal
265	// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying)
266	// in the AWS Identity and Access Management User Guide.
267	UserId *string
268}
269
270// Information about recommendation feedback summaries.
271type RecommendationFeedbackSummary struct {
272
273	// List for storing reactions. Reactions are utf-8 text code for emojis.
274	Reactions []Reaction
275
276	// The recommendation ID that can be used to track the provided recommendations.
277	// Later on it can be used to collect the feedback.
278	RecommendationId *string
279
280	// The ID of the user that gave the feedback. The UserId is an IAM principal that
281	// can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more
282	// information, see  Specifying a Principal
283	// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying)
284	// in the AWS Identity and Access Management User Guide.
285	UserId *string
286}
287
288// Information about recommendations.
289type RecommendationSummary struct {
290
291	// A description of the recommendation generated by CodeGuru Reviewer for the lines
292	// of code between the start line and the end line.
293	Description *string
294
295	// Last line where the recommendation is applicable in the source commit or source
296	// branch. For a single line comment the start line and end line values are the
297	// same.
298	EndLine *int32
299
300	// Name of the file on which a recommendation is provided.
301	FilePath *string
302
303	// The recommendation ID that can be used to track the provided recommendations.
304	// Later on it can be used to collect the feedback.
305	RecommendationId *string
306
307	// Start line from where the recommendation is applicable in the source commit or
308	// source branch.
309	StartLine *int32
310}
311
312// Information about an associated AWS CodeCommit repository or an associated
313// repository that is managed by AWS CodeStar Connections (for example, Bitbucket).
314// This Repository object is not used if your source code is in an associated
315// GitHub repository.
316type Repository struct {
317
318	// Information about a Bitbucket repository.
319	Bitbucket *ThirdPartySourceRepository
320
321	// Information about an AWS CodeCommit repository.
322	CodeCommit *CodeCommitRepository
323
324	// Information about a GitHub Enterprise Server repository.
325	GitHubEnterpriseServer *ThirdPartySourceRepository
326}
327
328// A code review type that analyzes all code under a specified branch in an
329// associated repository. The associated repository is specified using its ARN when
330// you call CreateCodeReview
331// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview).
332type RepositoryAnalysis struct {
333
334	// A SourceCodeType
335	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
336	// that specifies the tip of a branch in an associated repository.
337	//
338	// This member is required.
339	RepositoryHead *RepositoryHeadSourceCodeType
340}
341
342// Information about a repository association. The DescribeRepositoryAssociation
343// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html)
344// operation returns a RepositoryAssociation object.
345type RepositoryAssociation struct {
346
347	// The Amazon Resource Name (ARN) identifying the repository association.
348	AssociationArn *string
349
350	// The ID of the repository association.
351	AssociationId *string
352
353	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
354	// format is
355	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
356	// For more information, see Connection
357	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
358	// in the AWS CodeStar Connections API Reference.
359	ConnectionArn *string
360
361	// The time, in milliseconds since the epoch, when the repository association was
362	// created.
363	CreatedTimeStamp *time.Time
364
365	// A KMSKeyDetails object that contains:
366	//
367	// * The encryption option for this
368	// repository association. It is either owned by AWS Key Management Service (KMS)
369	// (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).
370	//
371	// * The ID of the AWS
372	// KMS key that is associated with this respository association.
373	KMSKeyDetails *KMSKeyDetails
374
375	// The time, in milliseconds since the epoch, when the repository association was
376	// last updated.
377	LastUpdatedTimeStamp *time.Time
378
379	// The name of the repository.
380	Name *string
381
382	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
383	// account ID of the account that owns the repository. For a GitHub, GitHub
384	// Enterprise Server, or Bitbucket repository, this is the username for the account
385	// that owns the repository.
386	Owner *string
387
388	// The provider type of the repository association.
389	ProviderType ProviderType
390
391	// The state of the repository association. The valid repository association states
392	// are:
393	//
394	// * Associated: The repository association is complete.
395	//
396	// * Associating:
397	// CodeGuru Reviewer is:
398	//
399	// * Setting up pull request notifications. This is required
400	// for pull requests to trigger a CodeGuru Reviewer review. If your repository
401	// ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru
402	// Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer
403	// reviews. If you delete these webhooks, reviews of code in your repository cannot
404	// be triggered.
405	//
406	// * Setting up source code access. This is required for CodeGuru
407	// Reviewer to securely clone code in your repository.
408	//
409	// * Failed: The repository
410	// failed to associate or disassociate.
411	//
412	// * Disassociating: CodeGuru Reviewer is
413	// removing the repository's pull request notifications and source code access.
414	//
415	// *
416	// Disassociated: CodeGuru Reviewer successfully disassociated the repository. You
417	// can create a new association with this repository if you want to review source
418	// code in it later. You can control access to code reviews created in an
419	// associated repository with tags after it has been disassociated. For more
420	// information, see Using tags to control access to associated repositories
421	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html)
422	// in the Amazon CodeGuru Reviewer User Guide.
423	State RepositoryAssociationState
424
425	// A description of why the repository association is in the current state.
426	StateReason *string
427}
428
429// Summary information about a repository association. The
430// ListRepositoryAssociations
431// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html)
432// operation returns a list of RepositoryAssociationSummary objects.
433type RepositoryAssociationSummary struct {
434
435	// The Amazon Resource Name (ARN) of the RepositoryAssociation
436	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html)
437	// object. You can retrieve this ARN by calling ListRepositoryAssociations
438	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html).
439	AssociationArn *string
440
441	// The repository association ID.
442	AssociationId *string
443
444	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
445	// format is
446	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
447	// For more information, see Connection
448	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
449	// in the AWS CodeStar Connections API Reference.
450	ConnectionArn *string
451
452	// The time, in milliseconds since the epoch, since the repository association was
453	// last updated.
454	LastUpdatedTimeStamp *time.Time
455
456	// The name of the repository association.
457	Name *string
458
459	// The owner of the repository. For an AWS CodeCommit repository, this is the AWS
460	// account ID of the account that owns the repository. For a GitHub, GitHub
461	// Enterprise Server, or Bitbucket repository, this is the username for the account
462	// that owns the repository.
463	Owner *string
464
465	// The provider type of the repository association.
466	ProviderType ProviderType
467
468	// The state of the repository association. The valid repository association states
469	// are:
470	//
471	// * Associated: The repository association is complete.
472	//
473	// * Associating:
474	// CodeGuru Reviewer is:
475	//
476	// * Setting up pull request notifications. This is required
477	// for pull requests to trigger a CodeGuru Reviewer review. If your repository
478	// ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru
479	// Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer
480	// reviews. If you delete these webhooks, reviews of code in your repository cannot
481	// be triggered.
482	//
483	// * Setting up source code access. This is required for CodeGuru
484	// Reviewer to securely clone code in your repository.
485	//
486	// * Failed: The repository
487	// failed to associate or disassociate.
488	//
489	// * Disassociating: CodeGuru Reviewer is
490	// removing the repository's pull request notifications and source code access.
491	//
492	// *
493	// Disassociated: CodeGuru Reviewer successfully disassociated the repository. You
494	// can create a new association with this repository if you want to review source
495	// code in it later. You can control access to code reviews created in an
496	// associated repository with tags after it has been disassociated. For more
497	// information, see Using tags to control access to associated repositories
498	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html)
499	// in the Amazon CodeGuru Reviewer User Guide.
500	State RepositoryAssociationState
501}
502
503// A SourceCodeType
504// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
505// that specifies the tip of a branch in an associated repository.
506type RepositoryHeadSourceCodeType struct {
507
508	// The name of the branch in an associated repository. The
509	// RepositoryHeadSourceCodeType specifies the tip of this branch.
510	//
511	// This member is required.
512	BranchName *string
513}
514
515// Specifies the source code that is analyzed in a code review. A code review can
516// analyze the source code that is specified using a pull request diff or a branch
517// in an associated repository.
518type SourceCodeType struct {
519
520	// A SourceCodeType
521	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
522	// that specifies a commit diff created by a pull request on an associated
523	// repository.
524	CommitDiff *CommitDiffSourceCodeType
525
526	// A SourceCodeType
527	// (https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType)
528	// that specifies the tip of a branch in an associated repository.
529	RepositoryHead *RepositoryHeadSourceCodeType
530}
531
532// Information about a third-party source repository connected to CodeGuru
533// Reviewer.
534type ThirdPartySourceRepository struct {
535
536	// The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its
537	// format is
538	// arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id.
539	// For more information, see Connection
540	// (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html)
541	// in the AWS CodeStar Connections API Reference.
542	//
543	// This member is required.
544	ConnectionArn *string
545
546	// The name of the third party source repository.
547	//
548	// This member is required.
549	Name *string
550
551	// The owner of the repository. For a GitHub, GitHub Enterprise, or Bitbucket
552	// repository, this is the username for the account that owns the repository.
553	//
554	// This member is required.
555	Owner *string
556}
557