software.amazon.awssdk.services.codebuild.model.S3LogsConfig 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.beans.Transient;
import java.io.Serializable;
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.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 S3 logs for a build project.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class S3LogsConfig implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(S3LogsConfig::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField LOCATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("location").getter(getter(S3LogsConfig::location)).setter(setter(Builder::location))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("location").build()).build();
private static final SdkField ENCRYPTION_DISABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("encryptionDisabled").getter(getter(S3LogsConfig::encryptionDisabled))
.setter(setter(Builder::encryptionDisabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionDisabled").build())
.build();
private static final SdkField BUCKET_OWNER_ACCESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("bucketOwnerAccess").getter(getter(S3LogsConfig::bucketOwnerAccessAsString))
.setter(setter(Builder::bucketOwnerAccess))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("bucketOwnerAccess").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STATUS_FIELD, LOCATION_FIELD,
ENCRYPTION_DISABLED_FIELD, BUCKET_OWNER_ACCESS_FIELD));
private static final long serialVersionUID = 1L;
private final String status;
private final String location;
private final Boolean encryptionDisabled;
private final String bucketOwnerAccess;
private S3LogsConfig(BuilderImpl builder) {
this.status = builder.status;
this.location = builder.location;
this.encryptionDisabled = builder.encryptionDisabled;
this.bucketOwnerAccess = builder.bucketOwnerAccess;
}
/**
*
* The current status of the S3 build logs. Valid values are:
*
*
* -
*
* ENABLED
: S3 build logs are enabled for this build project.
*
*
* -
*
* DISABLED
: S3 build logs are not enabled for this build project.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link LogsConfigStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The current status of the S3 build logs. Valid values are:
*
* -
*
* ENABLED
: S3 build logs are enabled for this build project.
*
*
* -
*
* DISABLED
: S3 build logs are not enabled for this build project.
*
*
* @see LogsConfigStatusType
*/
public final LogsConfigStatusType status() {
return LogsConfigStatusType.fromValue(status);
}
/**
*
* The current status of the S3 build logs. Valid values are:
*
*
* -
*
* ENABLED
: S3 build logs are enabled for this build project.
*
*
* -
*
* DISABLED
: S3 build logs are not enabled for this build project.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link LogsConfigStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The current status of the S3 build logs. Valid values are:
*
* -
*
* ENABLED
: S3 build logs are enabled for this build project.
*
*
* -
*
* DISABLED
: S3 build logs are not enabled for this build project.
*
*
* @see LogsConfigStatusType
*/
public final String statusAsString() {
return status;
}
/**
*
* The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is my-bucket
,
* and your path prefix is build-log
, then acceptable formats are my-bucket/build-log
or
* arn:aws:s3:::my-bucket/build-log
.
*
*
* @return The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is
* my-bucket
, and your path prefix is build-log
, then acceptable formats are
* my-bucket/build-log
or arn:aws:s3:::my-bucket/build-log
.
*/
public final String location() {
return location;
}
/**
*
* Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.
*
*
* @return Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are
* encrypted.
*/
public final Boolean encryptionDisabled() {
return encryptionDisabled;
}
/**
* Returns the value of the BucketOwnerAccess property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #bucketOwnerAccess}
* will return {@link BucketOwnerAccess#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #bucketOwnerAccessAsString}.
*
*
* @return The value of the BucketOwnerAccess property for this object.
* @see BucketOwnerAccess
*/
public final BucketOwnerAccess bucketOwnerAccess() {
return BucketOwnerAccess.fromValue(bucketOwnerAccess);
}
/**
* Returns the value of the BucketOwnerAccess property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #bucketOwnerAccess}
* will return {@link BucketOwnerAccess#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #bucketOwnerAccessAsString}.
*
*
* @return The value of the BucketOwnerAccess property for this object.
* @see BucketOwnerAccess
*/
public final String bucketOwnerAccessAsString() {
return bucketOwnerAccess;
}
@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 + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(location());
hashCode = 31 * hashCode + Objects.hashCode(encryptionDisabled());
hashCode = 31 * hashCode + Objects.hashCode(bucketOwnerAccessAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof S3LogsConfig)) {
return false;
}
S3LogsConfig other = (S3LogsConfig) obj;
return Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(location(), other.location())
&& Objects.equals(encryptionDisabled(), other.encryptionDisabled())
&& Objects.equals(bucketOwnerAccessAsString(), other.bucketOwnerAccessAsString());
}
/**
* 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("S3LogsConfig").add("Status", statusAsString()).add("Location", location())
.add("EncryptionDisabled", encryptionDisabled()).add("BucketOwnerAccess", bucketOwnerAccessAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "location":
return Optional.ofNullable(clazz.cast(location()));
case "encryptionDisabled":
return Optional.ofNullable(clazz.cast(encryptionDisabled()));
case "bucketOwnerAccess":
return Optional.ofNullable(clazz.cast(bucketOwnerAccessAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function