All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.codebuild.model.Report Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Code Build module holds the client classes that are used for communicating with AWS Code Build.

There is a newer version: 2.29.39
Show newest version
/*
 * 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.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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.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;

/**
 * 

* Information about the results from running a series of test cases during the run of a build project. The test cases * are specified in the buildspec for the build project using one or more paths to the test case files. You can specify * any type of tests you want, such as unit tests, integration tests, and functional tests. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Report implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField REPORT_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::reportGroupArn)).setter(setter(Builder::reportGroupArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportGroupArn").build()).build(); private static final SdkField EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::executionId)).setter(setter(Builder::executionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionId").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(Report::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(Report::created)).setter(setter(Builder::created)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("created").build()).build(); private static final SdkField EXPIRED_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(Report::expired)).setter(setter(Builder::expired)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expired").build()).build(); private static final SdkField EXPORT_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(Report::exportConfig)) .setter(setter(Builder::exportConfig)).constructor(ReportExportConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportConfig").build()).build(); private static final SdkField TRUNCATED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(Report::truncated)).setter(setter(Builder::truncated)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("truncated").build()).build(); private static final SdkField TEST_SUMMARY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(Report::testSummary)) .setter(setter(Builder::testSummary)).constructor(TestReportSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("testSummary").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, TYPE_FIELD, NAME_FIELD, REPORT_GROUP_ARN_FIELD, EXECUTION_ID_FIELD, STATUS_FIELD, CREATED_FIELD, EXPIRED_FIELD, EXPORT_CONFIG_FIELD, TRUNCATED_FIELD, TEST_SUMMARY_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final String type; private final String name; private final String reportGroupArn; private final String executionId; private final String status; private final Instant created; private final Instant expired; private final ReportExportConfig exportConfig; private final Boolean truncated; private final TestReportSummary testSummary; private Report(BuilderImpl builder) { this.arn = builder.arn; this.type = builder.type; this.name = builder.name; this.reportGroupArn = builder.reportGroupArn; this.executionId = builder.executionId; this.status = builder.status; this.created = builder.created; this.expired = builder.expired; this.exportConfig = builder.exportConfig; this.truncated = builder.truncated; this.testSummary = builder.testSummary; } /** *

* The ARN of the report run. *

* * @return The ARN of the report run. */ public String arn() { return arn; } /** *

* The type of the report that was run. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link ReportType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The type of the report that was run. * @see ReportType */ public ReportType type() { return ReportType.fromValue(type); } /** *

* The type of the report that was run. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link ReportType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The type of the report that was run. * @see ReportType */ public String typeAsString() { return type; } /** *

* The name of the report that was run. *

* * @return The name of the report that was run. */ public String name() { return name; } /** *

* The ARN of the report group associated with this report. *

* * @return The ARN of the report group associated with this report. */ public String reportGroupArn() { return reportGroupArn; } /** *

* The ARN of the build run that generated this report. *

* * @return The ARN of the build run that generated this report. */ public String executionId() { return executionId; } /** *

* The status of this report. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ReportStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of this report. * @see ReportStatusType */ public ReportStatusType status() { return ReportStatusType.fromValue(status); } /** *

* The status of this report. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ReportStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of this report. * @see ReportStatusType */ public String statusAsString() { return status; } /** *

* The date and time this report run occurred. *

* * @return The date and time this report run occurred. */ public Instant created() { return created; } /** *

* The date and time a report expires. A report expires 30 days after it is created. An expired report is not * available to view in CodeBuild. *

* * @return The date and time a report expires. A report expires 30 days after it is created. An expired report is * not available to view in CodeBuild. */ public Instant expired() { return expired; } /** *

* Information about where the raw data used to generate this report was exported. *

* * @return Information about where the raw data used to generate this report was exported. */ public ReportExportConfig exportConfig() { return exportConfig; } /** *

* A boolean that specifies if this report run is truncated. The list of test cases is truncated after the maximum * number of test cases is reached. *

* * @return A boolean that specifies if this report run is truncated. The list of test cases is truncated after the * maximum number of test cases is reached. */ public Boolean truncated() { return truncated; } /** *

* A TestReportSummary object that contains information about this test report. *

* * @return A TestReportSummary object that contains information about this test report. */ public TestReportSummary testSummary() { return testSummary; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(reportGroupArn()); hashCode = 31 * hashCode + Objects.hashCode(executionId()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(created()); hashCode = 31 * hashCode + Objects.hashCode(expired()); hashCode = 31 * hashCode + Objects.hashCode(exportConfig()); hashCode = 31 * hashCode + Objects.hashCode(truncated()); hashCode = 31 * hashCode + Objects.hashCode(testSummary()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Report)) { return false; } Report other = (Report) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(name(), other.name()) && Objects.equals(reportGroupArn(), other.reportGroupArn()) && Objects.equals(executionId(), other.executionId()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(created(), other.created()) && Objects.equals(expired(), other.expired()) && Objects.equals(exportConfig(), other.exportConfig()) && Objects.equals(truncated(), other.truncated()) && Objects.equals(testSummary(), other.testSummary()); } /** * 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 String toString() { return ToString.builder("Report").add("Arn", arn()).add("Type", typeAsString()).add("Name", name()) .add("ReportGroupArn", reportGroupArn()).add("ExecutionId", executionId()).add("Status", statusAsString()) .add("Created", created()).add("Expired", expired()).add("ExportConfig", exportConfig()) .add("Truncated", truncated()).add("TestSummary", testSummary()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "name": return Optional.ofNullable(clazz.cast(name())); case "reportGroupArn": return Optional.ofNullable(clazz.cast(reportGroupArn())); case "executionId": return Optional.ofNullable(clazz.cast(executionId())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "created": return Optional.ofNullable(clazz.cast(created())); case "expired": return Optional.ofNullable(clazz.cast(expired())); case "exportConfig": return Optional.ofNullable(clazz.cast(exportConfig())); case "truncated": return Optional.ofNullable(clazz.cast(truncated())); case "testSummary": return Optional.ofNullable(clazz.cast(testSummary())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Report) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ARN of the report run. *

* * @param arn * The ARN of the report run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The type of the report that was run. *

* * @param type * The type of the report that was run. * @see ReportType * @return Returns a reference to this object so that method calls can be chained together. * @see ReportType */ Builder type(String type); /** *

* The type of the report that was run. *

* * @param type * The type of the report that was run. * @see ReportType * @return Returns a reference to this object so that method calls can be chained together. * @see ReportType */ Builder type(ReportType type); /** *

* The name of the report that was run. *

* * @param name * The name of the report that was run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The ARN of the report group associated with this report. *

* * @param reportGroupArn * The ARN of the report group associated with this report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reportGroupArn(String reportGroupArn); /** *

* The ARN of the build run that generated this report. *

* * @param executionId * The ARN of the build run that generated this report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executionId(String executionId); /** *

* The status of this report. *

* * @param status * The status of this report. * @see ReportStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see ReportStatusType */ Builder status(String status); /** *

* The status of this report. *

* * @param status * The status of this report. * @see ReportStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see ReportStatusType */ Builder status(ReportStatusType status); /** *

* The date and time this report run occurred. *

* * @param created * The date and time this report run occurred. * @return Returns a reference to this object so that method calls can be chained together. */ Builder created(Instant created); /** *

* The date and time a report expires. A report expires 30 days after it is created. An expired report is not * available to view in CodeBuild. *

* * @param expired * The date and time a report expires. A report expires 30 days after it is created. An expired report is * not available to view in CodeBuild. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expired(Instant expired); /** *

* Information about where the raw data used to generate this report was exported. *

* * @param exportConfig * Information about where the raw data used to generate this report was exported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportConfig(ReportExportConfig exportConfig); /** *

* Information about where the raw data used to generate this report was exported. *

* This is a convenience that creates an instance of the {@link ReportExportConfig.Builder} avoiding the need to * create one manually via {@link ReportExportConfig#builder()}. * * When the {@link Consumer} completes, {@link ReportExportConfig.Builder#build()} is called immediately and its * result is passed to {@link #exportConfig(ReportExportConfig)}. * * @param exportConfig * a consumer that will call methods on {@link ReportExportConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #exportConfig(ReportExportConfig) */ default Builder exportConfig(Consumer exportConfig) { return exportConfig(ReportExportConfig.builder().applyMutation(exportConfig).build()); } /** *

* A boolean that specifies if this report run is truncated. The list of test cases is truncated after the * maximum number of test cases is reached. *

* * @param truncated * A boolean that specifies if this report run is truncated. The list of test cases is truncated after * the maximum number of test cases is reached. * @return Returns a reference to this object so that method calls can be chained together. */ Builder truncated(Boolean truncated); /** *

* A TestReportSummary object that contains information about this test report. *

* * @param testSummary * A TestReportSummary object that contains information about this test report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder testSummary(TestReportSummary testSummary); /** *

* A TestReportSummary object that contains information about this test report. *

* This is a convenience that creates an instance of the {@link TestReportSummary.Builder} avoiding the need to * create one manually via {@link TestReportSummary#builder()}. * * When the {@link Consumer} completes, {@link TestReportSummary.Builder#build()} is called immediately and its * result is passed to {@link #testSummary(TestReportSummary)}. * * @param testSummary * a consumer that will call methods on {@link TestReportSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #testSummary(TestReportSummary) */ default Builder testSummary(Consumer testSummary) { return testSummary(TestReportSummary.builder().applyMutation(testSummary).build()); } } static final class BuilderImpl implements Builder { private String arn; private String type; private String name; private String reportGroupArn; private String executionId; private String status; private Instant created; private Instant expired; private ReportExportConfig exportConfig; private Boolean truncated; private TestReportSummary testSummary; private BuilderImpl() { } private BuilderImpl(Report model) { arn(model.arn); type(model.type); name(model.name); reportGroupArn(model.reportGroupArn); executionId(model.executionId); status(model.status); created(model.created); expired(model.expired); exportConfig(model.exportConfig); truncated(model.truncated); testSummary(model.testSummary); } public final String getArn() { return arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final void setArn(String arn) { this.arn = arn; } public final String getType() { return type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(ReportType type) { this.type(type == null ? null : type.toString()); return this; } public final void setType(String type) { this.type = type; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getReportGroupArn() { return reportGroupArn; } @Override public final Builder reportGroupArn(String reportGroupArn) { this.reportGroupArn = reportGroupArn; return this; } public final void setReportGroupArn(String reportGroupArn) { this.reportGroupArn = reportGroupArn; } public final String getExecutionId() { return executionId; } @Override public final Builder executionId(String executionId) { this.executionId = executionId; return this; } public final void setExecutionId(String executionId) { this.executionId = executionId; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ReportStatusType status) { this.status(status == null ? null : status.toString()); return this; } public final void setStatus(String status) { this.status = status; } public final Instant getCreated() { return created; } @Override public final Builder created(Instant created) { this.created = created; return this; } public final void setCreated(Instant created) { this.created = created; } public final Instant getExpired() { return expired; } @Override public final Builder expired(Instant expired) { this.expired = expired; return this; } public final void setExpired(Instant expired) { this.expired = expired; } public final ReportExportConfig.Builder getExportConfig() { return exportConfig != null ? exportConfig.toBuilder() : null; } @Override public final Builder exportConfig(ReportExportConfig exportConfig) { this.exportConfig = exportConfig; return this; } public final void setExportConfig(ReportExportConfig.BuilderImpl exportConfig) { this.exportConfig = exportConfig != null ? exportConfig.build() : null; } public final Boolean getTruncated() { return truncated; } @Override public final Builder truncated(Boolean truncated) { this.truncated = truncated; return this; } public final void setTruncated(Boolean truncated) { this.truncated = truncated; } public final TestReportSummary.Builder getTestSummary() { return testSummary != null ? testSummary.toBuilder() : null; } @Override public final Builder testSummary(TestReportSummary testSummary) { this.testSummary = testSummary; return this; } public final void setTestSummary(TestReportSummary.BuilderImpl testSummary) { this.testSummary = testSummary != null ? testSummary.build() : null; } @Override public Report build() { return new Report(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy