Class: Aws::CodeGuruReviewer::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CodeGuruReviewer::Client
- Includes:
- Aws::ClientStubs
- Defined in:
- lib/aws-sdk-codegurureviewer/client.rb
Overview
An API client for CodeGuruReviewer. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::CodeGuruReviewer::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#associate_repository(params = {}) ⇒ Types::AssociateRepositoryResponse
Use to associate an Amazon Web Services CodeCommit repository or a repository managed by Amazon Web Services CodeStar Connections with Amazon CodeGuru Reviewer.
-
#create_code_review(params = {}) ⇒ Types::CreateCodeReviewResponse
Use to create a code review with a [CodeReviewType] of ‘RepositoryAnalysis`.
-
#describe_code_review(params = {}) ⇒ Types::DescribeCodeReviewResponse
Returns the metadata associated with the code review along with its status.
-
#describe_recommendation_feedback(params = {}) ⇒ Types::DescribeRecommendationFeedbackResponse
Describes the customer feedback for a CodeGuru Reviewer recommendation.
-
#describe_repository_association(params = {}) ⇒ Types::DescribeRepositoryAssociationResponse
Returns a [RepositoryAssociation] object that contains information about the requested repository association.
-
#disassociate_repository(params = {}) ⇒ Types::DisassociateRepositoryResponse
Removes the association between Amazon CodeGuru Reviewer and a repository.
-
#list_code_reviews(params = {}) ⇒ Types::ListCodeReviewsResponse
Lists all the code reviews that the customer has created in the past 90 days.
-
#list_recommendation_feedback(params = {}) ⇒ Types::ListRecommendationFeedbackResponse
Returns a list of [RecommendationFeedbackSummary] objects that contain customer recommendation feedback for all CodeGuru Reviewer users.
-
#list_recommendations(params = {}) ⇒ Types::ListRecommendationsResponse
Returns the list of all recommendations for a completed code review.
-
#list_repository_associations(params = {}) ⇒ Types::ListRepositoryAssociationsResponse
Returns a list of [RepositoryAssociationSummary] objects that contain summary information about a repository association.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Returns the list of tags associated with an associated repository resource.
-
#put_recommendation_feedback(params = {}) ⇒ Struct
Stores customer feedback for a CodeGuru Reviewer recommendation.
-
#tag_resource(params = {}) ⇒ Struct
Adds one or more tags to an associated repository.
-
#untag_resource(params = {}) ⇒ Struct
Removes a tag from an associated repository.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
444 445 446 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 444 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1627 1628 1629 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1627 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1630 1631 1632 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1630 def errors_module Errors end |
Instance Method Details
#associate_repository(params = {}) ⇒ Types::AssociateRepositoryResponse
Use to associate an Amazon Web Services CodeCommit repository or a repository managed by Amazon Web Services CodeStar Connections with Amazon CodeGuru Reviewer. When you associate a repository, CodeGuru Reviewer reviews source code changes in the repository’s pull requests and provides automatic recommendations. You can view recommendations using the CodeGuru Reviewer console. For more information, see [Recommendations in Amazon CodeGuru Reviewer] in the *Amazon CodeGuru Reviewer User Guide.*
If you associate a CodeCommit or S3 repository, it must be in the same Amazon Web Services Region and Amazon Web Services account where its CodeGuru Reviewer code reviews are configured.
Bitbucket and GitHub Enterprise Server repositories are managed by Amazon Web Services CodeStar Connections to connect to CodeGuru Reviewer. For more information, see [Associate a repository] in the *Amazon CodeGuru Reviewer User Guide.*
<note markdown=“1”> You cannot use the CodeGuru Reviewer SDK or the Amazon Web Services CLI to associate a GitHub repository with Amazon CodeGuru Reviewer. To associate a GitHub repository, use the console. For more information, see [Getting started with CodeGuru Reviewer] in the *CodeGuru Reviewer User Guide.*
</note>
[1]: docs.aws.amazon.com/codeguru/latest/reviewer-ug/recommendations.html [2]: docs.aws.amazon.com/codeguru/latest/reviewer-ug/getting-started-associate-repository.html [3]: docs.aws.amazon.com/codeguru/latest/reviewer-ug/getting-started-with-guru.html
576 577 578 579 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 576 def associate_repository(params = {}, = {}) req = build_request(:associate_repository, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1485 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::CodeGuruReviewer') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-codegurureviewer' context[:gem_version] = '1.58.0' Seahorse::Client::Request.new(handlers, context) end |
#create_code_review(params = {}) ⇒ Types::CreateCodeReviewResponse
Use to create a code review with a [CodeReviewType] of ‘RepositoryAnalysis`. This type of code review analyzes all code under a specified branch in an associated repository. `PullRequest` code reviews are automatically triggered by a pull request.
[1]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html
716 717 718 719 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 716 def create_code_review(params = {}, = {}) req = build_request(:create_code_review, params) req.send_request() end |
#describe_code_review(params = {}) ⇒ Types::DescribeCodeReviewResponse
Returns the metadata associated with the code review along with its status.
The following waiters are defined for this operation (see #wait_until for detailed usage):
* code_review_completed
786 787 788 789 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 786 def describe_code_review(params = {}, = {}) req = build_request(:describe_code_review, params) req.send_request() end |
#describe_recommendation_feedback(params = {}) ⇒ Types::DescribeRecommendationFeedbackResponse
Describes the customer feedback for a CodeGuru Reviewer recommendation.
844 845 846 847 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 844 def describe_recommendation_feedback(params = {}, = {}) req = build_request(:describe_recommendation_feedback, params) req.send_request() end |
#describe_repository_association(params = {}) ⇒ Types::DescribeRepositoryAssociationResponse
Returns a [RepositoryAssociation] object that contains information about the requested repository association.
[1]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html
The following waiters are defined for this operation (see #wait_until for detailed usage):
* repository_association_succeeded
906 907 908 909 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 906 def describe_repository_association(params = {}, = {}) req = build_request(:describe_repository_association, params) req.send_request() end |
#disassociate_repository(params = {}) ⇒ Types::DisassociateRepositoryResponse
Removes the association between Amazon CodeGuru Reviewer and a repository.
959 960 961 962 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 959 def disassociate_repository(params = {}, = {}) req = build_request(:disassociate_repository, params) req.send_request() end |
#list_code_reviews(params = {}) ⇒ Types::ListCodeReviewsResponse
Lists all the code reviews that the customer has created in the past 90 days.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1059 1060 1061 1062 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1059 def list_code_reviews(params = {}, = {}) req = build_request(:list_code_reviews, params) req.send_request() end |
#list_recommendation_feedback(params = {}) ⇒ Types::ListRecommendationFeedbackResponse
Returns a list of [RecommendationFeedbackSummary] objects that contain customer recommendation feedback for all CodeGuru Reviewer users.
[1]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RecommendationFeedbackSummary.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1136 1137 1138 1139 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1136 def list_recommendation_feedback(params = {}, = {}) req = build_request(:list_recommendation_feedback, params) req.send_request() end |
#list_recommendations(params = {}) ⇒ Types::ListRecommendationsResponse
Returns the list of all recommendations for a completed code review.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1194 1195 1196 1197 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1194 def list_recommendations(params = {}, = {}) req = build_request(:list_recommendations, params) req.send_request() end |
#list_repository_associations(params = {}) ⇒ Types::ListRepositoryAssociationsResponse
Returns a list of [RepositoryAssociationSummary] objects that contain summary information about a repository association. You can filter the returned list by [ProviderType], [Name], [State], and [Owner].
[1]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html [2]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-ProviderType [3]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name [4]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State [5]: docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1323 1324 1325 1326 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1323 def list_repository_associations(params = {}, = {}) req = build_request(:list_repository_associations, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Returns the list of tags associated with an associated repository resource.
1360 1361 1362 1363 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1360 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_recommendation_feedback(params = {}) ⇒ Struct
Stores customer feedback for a CodeGuru Reviewer recommendation. When this API is called again with different reactions the previous feedback is overwritten.
1398 1399 1400 1401 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1398 def put_recommendation_feedback(params = {}, = {}) req = build_request(:put_recommendation_feedback, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds one or more tags to an associated repository.
1442 1443 1444 1445 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1442 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes a tag from an associated repository.
1476 1477 1478 1479 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1476 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
## Basic Usage
A waiter will call an API operation until:
-
It is successful
-
It enters a terminal state
-
It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
## Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
## Callbacks
You can be notified before each polling attempt and before each delay. If you throw ‘:success` or `:failure` from these callbacks, it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
## Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
## Valid Waiters
The following table lists the valid waiter names, the operations they call, and the default ‘:delay` and `:max_attempts` values.
| waiter_name | params | :delay | :max_attempts | | ——————————– | —————————————- | ——– | ————- | | code_review_completed | #describe_code_review | 10 | 180 | | repository_association_succeeded | #describe_repository_association | 10 | 30 |
1592 1593 1594 1595 1596 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1592 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1600 1601 1602 |
# File 'lib/aws-sdk-codegurureviewer/client.rb', line 1600 def waiter_names waiters.keys end |