software.amazon.awssdk.services.codebuild.model.GetReportGroupTrendRequest Maven / Gradle / Ivy
Show all versions of codebuild Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.codebuild.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetReportGroupTrendRequest extends CodeBuildRequest implements
ToCopyableBuilder {
private static final SdkField REPORT_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("reportGroupArn").getter(getter(GetReportGroupTrendRequest::reportGroupArn))
.setter(setter(Builder::reportGroupArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportGroupArn").build()).build();
private static final SdkField NUM_OF_REPORTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("numOfReports").getter(getter(GetReportGroupTrendRequest::numOfReports))
.setter(setter(Builder::numOfReports))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numOfReports").build()).build();
private static final SdkField TREND_FIELD_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("trendField").getter(getter(GetReportGroupTrendRequest::trendFieldAsString))
.setter(setter(Builder::trendField))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("trendField").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPORT_GROUP_ARN_FIELD,
NUM_OF_REPORTS_FIELD, TREND_FIELD_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("reportGroupArn", REPORT_GROUP_ARN_FIELD);
put("numOfReports", NUM_OF_REPORTS_FIELD);
put("trendField", TREND_FIELD_FIELD);
}
});
private final String reportGroupArn;
private final Integer numOfReports;
private final String trendField;
private GetReportGroupTrendRequest(BuilderImpl builder) {
super(builder);
this.reportGroupArn = builder.reportGroupArn;
this.numOfReports = builder.numOfReports;
this.trendField = builder.trendField;
}
/**
*
* The ARN of the report group that contains the reports to analyze.
*
*
* @return The ARN of the report group that contains the reports to analyze.
*/
public final String reportGroupArn() {
return reportGroupArn;
}
/**
*
* The number of reports to analyze. This operation always retrieves the most recent reports.
*
*
* If this parameter is omitted, the most recent 100 reports are analyzed.
*
*
* @return The number of reports to analyze. This operation always retrieves the most recent reports.
*
* If this parameter is omitted, the most recent 100 reports are analyzed.
*/
public final Integer numOfReports() {
return numOfReports;
}
/**
*
* The test report value to accumulate. This must be one of the following values:
*
*
* - Test reports:
* -
*
* - DURATION
* -
*
* Accumulate the test run times for the specified reports.
*
*
* - PASS_RATE
* -
*
* Accumulate the percentage of tests that passed for the specified test reports.
*
*
* - TOTAL
* -
*
* Accumulate the total number of tests for the specified test reports.
*
*
*
*
*
*
* - Code coverage reports:
* -
*
* - BRANCH_COVERAGE
* -
*
* Accumulate the branch coverage percentages for the specified test reports.
*
*
* - BRANCHES_COVERED
* -
*
* Accumulate the branches covered values for the specified test reports.
*
*
* - BRANCHES_MISSED
* -
*
* Accumulate the branches missed values for the specified test reports.
*
*
* - LINE_COVERAGE
* -
*
* Accumulate the line coverage percentages for the specified test reports.
*
*
* - LINES_COVERED
* -
*
* Accumulate the lines covered values for the specified test reports.
*
*
* - LINES_MISSED
* -
*
* Accumulate the lines not covered values for the specified test reports.
*
*
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #trendField} will
* return {@link ReportGroupTrendFieldType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #trendFieldAsString}.
*
*
* @return The test report value to accumulate. This must be one of the following values:
*
* - Test reports:
* -
*
* - DURATION
* -
*
* Accumulate the test run times for the specified reports.
*
*
* - PASS_RATE
* -
*
* Accumulate the percentage of tests that passed for the specified test reports.
*
*
* - TOTAL
* -
*
* Accumulate the total number of tests for the specified test reports.
*
*
*
*
*
*
* - Code coverage reports:
* -
*
* - BRANCH_COVERAGE
* -
*
* Accumulate the branch coverage percentages for the specified test reports.
*
*
* - BRANCHES_COVERED
* -
*
* Accumulate the branches covered values for the specified test reports.
*
*
* - BRANCHES_MISSED
* -
*
* Accumulate the branches missed values for the specified test reports.
*
*
* - LINE_COVERAGE
* -
*
* Accumulate the line coverage percentages for the specified test reports.
*
*
* - LINES_COVERED
* -
*
* Accumulate the lines covered values for the specified test reports.
*
*
* - LINES_MISSED
* -
*
* Accumulate the lines not covered values for the specified test reports.
*
*
*
*
* @see ReportGroupTrendFieldType
*/
public final ReportGroupTrendFieldType trendField() {
return ReportGroupTrendFieldType.fromValue(trendField);
}
/**
*
* The test report value to accumulate. This must be one of the following values:
*
*
* - Test reports:
* -
*
* - DURATION
* -
*
* Accumulate the test run times for the specified reports.
*
*
* - PASS_RATE
* -
*
* Accumulate the percentage of tests that passed for the specified test reports.
*
*
* - TOTAL
* -
*
* Accumulate the total number of tests for the specified test reports.
*
*
*
*
*
*
* - Code coverage reports:
* -
*
* - BRANCH_COVERAGE
* -
*
* Accumulate the branch coverage percentages for the specified test reports.
*
*
* - BRANCHES_COVERED
* -
*
* Accumulate the branches covered values for the specified test reports.
*
*
* - BRANCHES_MISSED
* -
*
* Accumulate the branches missed values for the specified test reports.
*
*
* - LINE_COVERAGE
* -
*
* Accumulate the line coverage percentages for the specified test reports.
*
*
* - LINES_COVERED
* -
*
* Accumulate the lines covered values for the specified test reports.
*
*
* - LINES_MISSED
* -
*
* Accumulate the lines not covered values for the specified test reports.
*
*
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #trendField} will
* return {@link ReportGroupTrendFieldType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #trendFieldAsString}.
*
*
* @return The test report value to accumulate. This must be one of the following values:
*
* - Test reports:
* -
*
* - DURATION
* -
*
* Accumulate the test run times for the specified reports.
*
*
* - PASS_RATE
* -
*
* Accumulate the percentage of tests that passed for the specified test reports.
*
*
* - TOTAL
* -
*
* Accumulate the total number of tests for the specified test reports.
*
*
*
*
*
*
* - Code coverage reports:
* -
*
* - BRANCH_COVERAGE
* -
*
* Accumulate the branch coverage percentages for the specified test reports.
*
*
* - BRANCHES_COVERED
* -
*
* Accumulate the branches covered values for the specified test reports.
*
*
* - BRANCHES_MISSED
* -
*
* Accumulate the branches missed values for the specified test reports.
*
*
* - LINE_COVERAGE
* -
*
* Accumulate the line coverage percentages for the specified test reports.
*
*
* - LINES_COVERED
* -
*
* Accumulate the lines covered values for the specified test reports.
*
*
* - LINES_MISSED
* -
*
* Accumulate the lines not covered values for the specified test reports.
*
*
*
*
* @see ReportGroupTrendFieldType
*/
public final String trendFieldAsString() {
return trendField;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(reportGroupArn());
hashCode = 31 * hashCode + Objects.hashCode(numOfReports());
hashCode = 31 * hashCode + Objects.hashCode(trendFieldAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetReportGroupTrendRequest)) {
return false;
}
GetReportGroupTrendRequest other = (GetReportGroupTrendRequest) obj;
return Objects.equals(reportGroupArn(), other.reportGroupArn()) && Objects.equals(numOfReports(), other.numOfReports())
&& Objects.equals(trendFieldAsString(), other.trendFieldAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("GetReportGroupTrendRequest").add("ReportGroupArn", reportGroupArn())
.add("NumOfReports", numOfReports()).add("TrendField", trendFieldAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "reportGroupArn":
return Optional.ofNullable(clazz.cast(reportGroupArn()));
case "numOfReports":
return Optional.ofNullable(clazz.cast(numOfReports()));
case "trendField":
return Optional.ofNullable(clazz.cast(trendFieldAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function