software.amazon.awssdk.services.codebuild.model.LogsLocation 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.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 build logs in CloudWatch Logs.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LogsLocation implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("groupName").getter(getter(LogsLocation::groupName)).setter(setter(Builder::groupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("groupName").build()).build();
private static final SdkField STREAM_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("streamName").getter(getter(LogsLocation::streamName)).setter(setter(Builder::streamName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("streamName").build()).build();
private static final SdkField DEEP_LINK_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("deepLink").getter(getter(LogsLocation::deepLink)).setter(setter(Builder::deepLink))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deepLink").build()).build();
private static final SdkField S3_DEEP_LINK_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("s3DeepLink").getter(getter(LogsLocation::s3DeepLink)).setter(setter(Builder::s3DeepLink))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3DeepLink").build()).build();
private static final SdkField CLOUD_WATCH_LOGS_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("cloudWatchLogsArn").getter(getter(LogsLocation::cloudWatchLogsArn))
.setter(setter(Builder::cloudWatchLogsArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cloudWatchLogsArn").build()).build();
private static final SdkField S3_LOGS_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("s3LogsArn").getter(getter(LogsLocation::s3LogsArn)).setter(setter(Builder::s3LogsArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3LogsArn").build()).build();
private static final SdkField CLOUD_WATCH_LOGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("cloudWatchLogs")
.getter(getter(LogsLocation::cloudWatchLogs)).setter(setter(Builder::cloudWatchLogs))
.constructor(CloudWatchLogsConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cloudWatchLogs").build()).build();
private static final SdkField S3_LOGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("s3Logs").getter(getter(LogsLocation::s3Logs)).setter(setter(Builder::s3Logs))
.constructor(S3LogsConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3Logs").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(GROUP_NAME_FIELD,
STREAM_NAME_FIELD, DEEP_LINK_FIELD, S3_DEEP_LINK_FIELD, CLOUD_WATCH_LOGS_ARN_FIELD, S3_LOGS_ARN_FIELD,
CLOUD_WATCH_LOGS_FIELD, S3_LOGS_FIELD));
private static final long serialVersionUID = 1L;
private final String groupName;
private final String streamName;
private final String deepLink;
private final String s3DeepLink;
private final String cloudWatchLogsArn;
private final String s3LogsArn;
private final CloudWatchLogsConfig cloudWatchLogs;
private final S3LogsConfig s3Logs;
private LogsLocation(BuilderImpl builder) {
this.groupName = builder.groupName;
this.streamName = builder.streamName;
this.deepLink = builder.deepLink;
this.s3DeepLink = builder.s3DeepLink;
this.cloudWatchLogsArn = builder.cloudWatchLogsArn;
this.s3LogsArn = builder.s3LogsArn;
this.cloudWatchLogs = builder.cloudWatchLogs;
this.s3Logs = builder.s3Logs;
}
/**
*
* The name of the CloudWatch Logs group for the build logs.
*
*
* @return The name of the CloudWatch Logs group for the build logs.
*/
public final String groupName() {
return groupName;
}
/**
*
* The name of the CloudWatch Logs stream for the build logs.
*
*
* @return The name of the CloudWatch Logs stream for the build logs.
*/
public final String streamName() {
return streamName;
}
/**
*
* The URL to an individual build log in CloudWatch Logs.
*
*
* @return The URL to an individual build log in CloudWatch Logs.
*/
public final String deepLink() {
return deepLink;
}
/**
*
* The URL to a build log in an S3 bucket.
*
*
* @return The URL to a build log in an S3 bucket.
*/
public final String s3DeepLink() {
return s3DeepLink;
}
/**
*
* The ARN of CloudWatch Logs for a build project. Its format is
* arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}
.
* For more information, see Resources Defined by CloudWatch Logs.
*
*
* @return The ARN of CloudWatch Logs for a build project. Its format is
* arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}
* . For more information, see Resources Defined by CloudWatch Logs.
*/
public final String cloudWatchLogsArn() {
return cloudWatchLogsArn;
}
/**
*
* The ARN of S3 logs for a build project. Its format is
* arn:${Partition}:s3:::${BucketName}/${ObjectName}
. For more information, see Resources Defined by Amazon S3.
*
*
* @return The ARN of S3 logs for a build project. Its format is
* arn:${Partition}:s3:::${BucketName}/${ObjectName}
. For more information, see Resources Defined by Amazon S3.
*/
public final String s3LogsArn() {
return s3LogsArn;
}
/**
*
* Information about CloudWatch Logs for a build project.
*
*
* @return Information about CloudWatch Logs for a build project.
*/
public final CloudWatchLogsConfig cloudWatchLogs() {
return cloudWatchLogs;
}
/**
*
* Information about S3 logs for a build project.
*
*
* @return Information about S3 logs for a build project.
*/
public final S3LogsConfig s3Logs() {
return s3Logs;
}
@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(groupName());
hashCode = 31 * hashCode + Objects.hashCode(streamName());
hashCode = 31 * hashCode + Objects.hashCode(deepLink());
hashCode = 31 * hashCode + Objects.hashCode(s3DeepLink());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLogsArn());
hashCode = 31 * hashCode + Objects.hashCode(s3LogsArn());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLogs());
hashCode = 31 * hashCode + Objects.hashCode(s3Logs());
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 LogsLocation)) {
return false;
}
LogsLocation other = (LogsLocation) obj;
return Objects.equals(groupName(), other.groupName()) && Objects.equals(streamName(), other.streamName())
&& Objects.equals(deepLink(), other.deepLink()) && Objects.equals(s3DeepLink(), other.s3DeepLink())
&& Objects.equals(cloudWatchLogsArn(), other.cloudWatchLogsArn())
&& Objects.equals(s3LogsArn(), other.s3LogsArn()) && Objects.equals(cloudWatchLogs(), other.cloudWatchLogs())
&& Objects.equals(s3Logs(), other.s3Logs());
}
/**
* 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("LogsLocation").add("GroupName", groupName()).add("StreamName", streamName())
.add("DeepLink", deepLink()).add("S3DeepLink", s3DeepLink()).add("CloudWatchLogsArn", cloudWatchLogsArn())
.add("S3LogsArn", s3LogsArn()).add("CloudWatchLogs", cloudWatchLogs()).add("S3Logs", s3Logs()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "groupName":
return Optional.ofNullable(clazz.cast(groupName()));
case "streamName":
return Optional.ofNullable(clazz.cast(streamName()));
case "deepLink":
return Optional.ofNullable(clazz.cast(deepLink()));
case "s3DeepLink":
return Optional.ofNullable(clazz.cast(s3DeepLink()));
case "cloudWatchLogsArn":
return Optional.ofNullable(clazz.cast(cloudWatchLogsArn()));
case "s3LogsArn":
return Optional.ofNullable(clazz.cast(s3LogsArn()));
case "cloudWatchLogs":
return Optional.ofNullable(clazz.cast(cloudWatchLogs()));
case "s3Logs":
return Optional.ofNullable(clazz.cast(s3Logs()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function