lib/aws-sdk-codegurureviewer/client.rb in aws-sdk-codegurureviewer-1.2.0 vs lib/aws-sdk-codegurureviewer/client.rb in aws-sdk-codegurureviewer-1.3.0

- old
+ new

@@ -309,12 +309,12 @@ # @!group API Operations # Associates an AWS CodeCommit repository with Amazon CodeGuru Reviewer. # When you associate an AWS CodeCommit repository with Amazon CodeGuru # Reviewer, Amazon CodeGuru Reviewer will provide recommendations for - # each pull request. You can view recommendations in the AWS CodeCommit - # repository. + # each pull request raised within the repository. You can view + # recommendations in the AWS CodeCommit repository. # # You can associate a GitHub repository using the Amazon CodeGuru # Reviewer console. # # @option params [required, Types::Repository] :repository @@ -322,26 +322,25 @@ # # @option params [String] :client_request_token # Unique, case-sensitive identifier that you provide to ensure the # idempotency of the request. # - # If you want to add a new repository association, this parameter - # specifies a unique identifier for the new repository association that - # helps ensure idempotency. + # To add a new repository association, this parameter specifies a unique + # identifier for the new repository association that helps ensure + # idempotency. # - # If you use the AWS CLI or one of the AWS SDK to call this operation, - # then 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, then you must generate a ClientRequestToken - # yourself for new versions and include that value in the request. + # 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. # - # You typically only need to 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. + # 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. # # Amazon CodeGuru Reviewer uses this value to prevent the accidental # creation of duplicate repository associations if there are failures # and retries. # @@ -382,14 +381,103 @@ def associate_repository(params = {}, options = {}) req = build_request(:associate_repository, params) req.send_request(options) end + # Returns the metadaata associated with the code review along with its + # status. + # + # @option params [required, String] :code_review_arn + # The Amazon Resource Name (ARN) of the code review to describe. + # + # @return [Types::DescribeCodeReviewResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::DescribeCodeReviewResponse#code_review #code_review} => Types::CodeReview + # + # @example Request syntax with placeholder values + # + # resp = client.describe_code_review({ + # code_review_arn: "Arn", # required + # }) + # + # @example Response structure + # + # resp.code_review.name #=> String + # resp.code_review.code_review_arn #=> String + # resp.code_review.repository_name #=> String + # resp.code_review.owner #=> String + # resp.code_review.provider_type #=> String, one of "CodeCommit", "GitHub" + # resp.code_review.state #=> String, one of "Completed", "Pending", "Failed", "Deleting" + # resp.code_review.state_reason #=> String + # resp.code_review.created_time_stamp #=> Time + # resp.code_review.last_updated_time_stamp #=> Time + # resp.code_review.type #=> String, one of "PullRequest" + # resp.code_review.pull_request_id #=> String + # resp.code_review.source_code_type.commit_diff.source_commit #=> String + # resp.code_review.source_code_type.commit_diff.destination_commit #=> String + # resp.code_review.metrics.metered_lines_of_code_count #=> Integer + # resp.code_review.metrics.findings_count #=> Integer + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/DescribeCodeReview AWS API Documentation + # + # @overload describe_code_review(params = {}) + # @param [Hash] params ({}) + def describe_code_review(params = {}, options = {}) + req = build_request(:describe_code_review, params) + req.send_request(options) + end + + # Describes the customer feedback for a CodeGuru Reviewer + # recommendation. + # + # @option params [required, String] :code_review_arn + # The Amazon Resource Name (ARN) that identifies the code review. + # + # @option params [required, String] :recommendation_id + # The recommendation ID that can be used to track the provided + # recommendations and then to collect the feedback. + # + # @option params [String] :user_id + # Optional parameter to describe the feedback for a given user. If this + # is not supplied, it defaults to the user making the request. + # + # @return [Types::DescribeRecommendationFeedbackResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::DescribeRecommendationFeedbackResponse#recommendation_feedback #recommendation_feedback} => Types::RecommendationFeedback + # + # @example Request syntax with placeholder values + # + # resp = client.describe_recommendation_feedback({ + # code_review_arn: "Arn", # required + # recommendation_id: "RecommendationId", # required + # user_id: "UserId", + # }) + # + # @example Response structure + # + # resp.recommendation_feedback.code_review_arn #=> String + # resp.recommendation_feedback.recommendation_id #=> String + # resp.recommendation_feedback.reactions #=> Array + # resp.recommendation_feedback.reactions[0] #=> String, one of "ThumbsUp", "ThumbsDown" + # resp.recommendation_feedback.user_id #=> String + # resp.recommendation_feedback.created_time_stamp #=> Time + # resp.recommendation_feedback.last_updated_time_stamp #=> Time + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/DescribeRecommendationFeedback AWS API Documentation + # + # @overload describe_recommendation_feedback(params = {}) + # @param [Hash] params ({}) + def describe_recommendation_feedback(params = {}, options = {}) + req = build_request(:describe_recommendation_feedback, params) + req.send_request(options) + end + # Describes a repository association. # # @option params [required, String] :association_arn - # The Amazon Resource Name (ARN) identifying the association. + # The Amazon Resource Name (ARN) identifying the association. You can + # retrieve this ARN by calling `ListRepositories`. # # @return [Types::DescribeRepositoryAssociationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::DescribeRepositoryAssociationResponse#repository_association #repository_association} => Types::RepositoryAssociation # @@ -455,10 +543,193 @@ def disassociate_repository(params = {}, options = {}) req = build_request(:disassociate_repository, params) req.send_request(options) end + # Lists all the code reviews that the customer has created in the past + # 90 days. + # + # @option params [Array<String>] :provider_types + # List of provider types for filtering that needs to be applied before + # displaying the result. For example, "providerTypes=\[GitHub\]" will + # list code reviews from GitHub. + # + # @option params [Array<String>] :states + # List of states for filtering that needs to be applied before + # displaying the result. For example, "states=\[Pending\]" will list + # code reviews in the Pending state. + # + # @option params [Array<String>] :repository_names + # List of repository names for filtering that needs to be applied before + # displaying the result. + # + # @option params [required, String] :type + # The type of code reviews to list in the response. + # + # @option params [Integer] :max_results + # The maximum number of results that are returned per call. The default + # is 100. + # + # @option params [String] :next_token + # 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. + # + # @return [Types::ListCodeReviewsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::ListCodeReviewsResponse#code_review_summaries #code_review_summaries} => Array&lt;Types::CodeReviewSummary&gt; + # * {Types::ListCodeReviewsResponse#next_token #next_token} => String + # + # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}. + # + # @example Request syntax with placeholder values + # + # resp = client.list_code_reviews({ + # provider_types: ["CodeCommit"], # accepts CodeCommit, GitHub + # states: ["Completed"], # accepts Completed, Pending, Failed, Deleting + # repository_names: ["Name"], + # type: "PullRequest", # required, accepts PullRequest + # max_results: 1, + # next_token: "NextToken", + # }) + # + # @example Response structure + # + # resp.code_review_summaries #=> Array + # resp.code_review_summaries[0].name #=> String + # resp.code_review_summaries[0].code_review_arn #=> String + # resp.code_review_summaries[0].repository_name #=> String + # resp.code_review_summaries[0].owner #=> String + # resp.code_review_summaries[0].provider_type #=> String, one of "CodeCommit", "GitHub" + # resp.code_review_summaries[0].state #=> String, one of "Completed", "Pending", "Failed", "Deleting" + # resp.code_review_summaries[0].created_time_stamp #=> Time + # resp.code_review_summaries[0].last_updated_time_stamp #=> Time + # resp.code_review_summaries[0].type #=> String, one of "PullRequest" + # resp.code_review_summaries[0].pull_request_id #=> String + # resp.code_review_summaries[0].metrics_summary.metered_lines_of_code_count #=> Integer + # resp.code_review_summaries[0].metrics_summary.findings_count #=> Integer + # resp.next_token #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/ListCodeReviews AWS API Documentation + # + # @overload list_code_reviews(params = {}) + # @param [Hash] params ({}) + def list_code_reviews(params = {}, options = {}) + req = build_request(:list_code_reviews, params) + req.send_request(options) + end + + # Lists the customer feedback for a CodeGuru Reviewer recommendation for + # all users. This API will be used from the console to extract the + # previously given feedback by the user to pre-populate the feedback + # emojis for all recommendations. + # + # @option params [String] :next_token + # 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. + # + # @option params [Integer] :max_results + # The maximum number of results that are returned per call. The default + # is 100. + # + # @option params [required, String] :code_review_arn + # The Amazon Resource Name (ARN) that identifies the code review. + # + # @option params [Array<String>] :user_ids + # Filter on userIds that need to be applied before displaying the + # result. This can be used to query all the recommendation feedback for + # a code review from a given user. + # + # @option params [Array<String>] :recommendation_ids + # Filter on recommendationIds that need to be applied before displaying + # the result. This can be used to query all the recommendation feedback + # for a given recommendation. + # + # @return [Types::ListRecommendationFeedbackResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::ListRecommendationFeedbackResponse#recommendation_feedback_summaries #recommendation_feedback_summaries} => Array&lt;Types::RecommendationFeedbackSummary&gt; + # * {Types::ListRecommendationFeedbackResponse#next_token #next_token} => String + # + # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}. + # + # @example Request syntax with placeholder values + # + # resp = client.list_recommendation_feedback({ + # next_token: "NextToken", + # max_results: 1, + # code_review_arn: "Arn", # required + # user_ids: ["UserId"], + # recommendation_ids: ["RecommendationId"], + # }) + # + # @example Response structure + # + # resp.recommendation_feedback_summaries #=> Array + # resp.recommendation_feedback_summaries[0].recommendation_id #=> String + # resp.recommendation_feedback_summaries[0].reactions #=> Array + # resp.recommendation_feedback_summaries[0].reactions[0] #=> String, one of "ThumbsUp", "ThumbsDown" + # resp.recommendation_feedback_summaries[0].user_id #=> String + # resp.next_token #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/ListRecommendationFeedback AWS API Documentation + # + # @overload list_recommendation_feedback(params = {}) + # @param [Hash] params ({}) + def list_recommendation_feedback(params = {}, options = {}) + req = build_request(:list_recommendation_feedback, params) + req.send_request(options) + end + + # Returns the list of all recommendations for a completed code review. + # + # @option params [String] :next_token + # Pagination token. + # + # @option params [Integer] :max_results + # The maximum number of results that are returned per call. The default + # is 100. + # + # @option params [required, String] :code_review_arn + # The Amazon Resource Name (ARN) of the code review to describe. + # + # @return [Types::ListRecommendationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: + # + # * {Types::ListRecommendationsResponse#recommendation_summaries #recommendation_summaries} => Array&lt;Types::RecommendationSummary&gt; + # * {Types::ListRecommendationsResponse#next_token #next_token} => String + # + # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}. + # + # @example Request syntax with placeholder values + # + # resp = client.list_recommendations({ + # next_token: "NextToken", + # max_results: 1, + # code_review_arn: "Arn", # required + # }) + # + # @example Response structure + # + # resp.recommendation_summaries #=> Array + # resp.recommendation_summaries[0].file_path #=> String + # resp.recommendation_summaries[0].recommendation_id #=> String + # resp.recommendation_summaries[0].start_line #=> Integer + # resp.recommendation_summaries[0].end_line #=> Integer + # resp.recommendation_summaries[0].description #=> String + # resp.next_token #=> String + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/ListRecommendations AWS API Documentation + # + # @overload list_recommendations(params = {}) + # @param [Hash] params ({}) + def list_recommendations(params = {}, options = {}) + req = build_request(:list_recommendations, params) + req.send_request(options) + end + # Lists repository associations. You can optionally filter on one or # more of the following recommendation properties: provider types, # states, names, and owners. # # @option params [Array<String>] :provider_types @@ -466,37 +737,38 @@ # # @option params [Array<String>] :states # List of states to use as a filter. # # @option params [Array<String>] :names - # List of names to use as a filter. + # List of repository names to use as a filter. # # @option params [Array<String>] :owners - # List of owners to use as a filter. For AWS CodeCommit, the owner is - # the AWS account id. For GitHub, it is the GitHub account name. + # List of owners to use as a filter. For GitHub, this is name of the + # GitHub account that was used to associate the repository. For AWS + # CodeCommit, it is the name of the CodeCommit account that was used to + # associate the repository. # # @option params [Integer] :max_results # The maximum number of repository association results returned by # `ListRepositoryAssociations` in paginated output. When this parameter # is used, `ListRepositoryAssociations` only returns `maxResults` - # results in a single page along with a `nextToken` response element. - # The remaining results of the initial request can be seen by sending + # results in a single page with a `nextToken` response element. The + # remaining results of the initial request can be seen by sending # another `ListRepositoryAssociations` request with the returned - # `nextToken` value. This value can be between 1 and 100. If this - # parameter is not used, then `ListRepositoryAssociations` returns up to - # 100 results and a `nextToken` value if applicable. + # `nextToken` value. This value can be between 1 and 25. If this + # parameter is not used, `ListRepositoryAssociations` returns up to 25 + # results and a `nextToken` value if applicable. # # @option params [String] :next_token # The `nextToken` value returned from a previous paginated # `ListRepositoryAssociations` request where `maxResults` was used and # the results exceeded the value of that parameter. Pagination continues # from the end of the previous results that returned the `nextToken` # value. # - # <note markdown="1"> This token should be treated as an opaque identifier that is only used - # to retrieve the next items in a list and not for other programmatic - # purposes. + # <note markdown="1"> 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. # # </note> # # @return [Types::ListRepositoryAssociationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # @@ -535,10 +807,44 @@ def list_repository_associations(params = {}, options = {}) req = build_request(:list_repository_associations, params) req.send_request(options) end + # Stores customer feedback for a CodeGuru-Reviewer recommendation. When + # this API is called again with different reactions the previous + # feedback is overwritten. + # + # @option params [required, String] :code_review_arn + # The Amazon Resource Name (ARN) that identifies the code review. + # + # @option params [required, String] :recommendation_id + # The recommendation ID that can be used to track the provided + # recommendations and then to collect the feedback. + # + # @option params [required, Array<String>] :reactions + # List for storing reactions. Reactions are utf-8 text code for emojis. + # If you send an empty list it clears all your feedback. + # + # @return [Struct] Returns an empty {Seahorse::Client::Response response}. + # + # @example Request syntax with placeholder values + # + # resp = client.put_recommendation_feedback({ + # code_review_arn: "Arn", # required + # recommendation_id: "RecommendationId", # required + # reactions: ["ThumbsUp"], # required, accepts ThumbsUp, ThumbsDown + # }) + # + # @see http://docs.aws.amazon.com/goto/WebAPI/codeguru-reviewer-2019-09-19/PutRecommendationFeedback AWS API Documentation + # + # @overload put_recommendation_feedback(params = {}) + # @param [Hash] params ({}) + def put_recommendation_feedback(params = {}, options = {}) + req = build_request(:put_recommendation_feedback, params) + req.send_request(options) + end + # @!endgroup # @param params ({}) # @api private def build_request(operation_name, params = {}) @@ -548,10 +854,10 @@ operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-codegurureviewer' - context[:gem_version] = '1.2.0' + context[:gem_version] = '1.3.0' Seahorse::Client::Request.new(handlers, context) end # @api private # @deprecated