software.amazon.awssdk.services.codedeploy.model.DeploymentOverview Maven / Gradle / Ivy
/*
* 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.codedeploy.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 the deployment status of the instances in the deployment.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeploymentOverview implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField PENDING_FIELD = SdkField. builder(MarshallingType.LONG).memberName("Pending")
.getter(getter(DeploymentOverview::pending)).setter(setter(Builder::pending))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Pending").build()).build();
private static final SdkField IN_PROGRESS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("InProgress").getter(getter(DeploymentOverview::inProgress)).setter(setter(Builder::inProgress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InProgress").build()).build();
private static final SdkField SUCCEEDED_FIELD = SdkField. builder(MarshallingType.LONG).memberName("Succeeded")
.getter(getter(DeploymentOverview::succeeded)).setter(setter(Builder::succeeded))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Succeeded").build()).build();
private static final SdkField FAILED_FIELD = SdkField. builder(MarshallingType.LONG).memberName("Failed")
.getter(getter(DeploymentOverview::failed)).setter(setter(Builder::failed))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Failed").build()).build();
private static final SdkField SKIPPED_FIELD = SdkField. builder(MarshallingType.LONG).memberName("Skipped")
.getter(getter(DeploymentOverview::skipped)).setter(setter(Builder::skipped))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Skipped").build()).build();
private static final SdkField READY_FIELD = SdkField. builder(MarshallingType.LONG).memberName("Ready")
.getter(getter(DeploymentOverview::ready)).setter(setter(Builder::ready))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ready").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PENDING_FIELD,
IN_PROGRESS_FIELD, SUCCEEDED_FIELD, FAILED_FIELD, SKIPPED_FIELD, READY_FIELD));
private static final long serialVersionUID = 1L;
private final Long pending;
private final Long inProgress;
private final Long succeeded;
private final Long failed;
private final Long skipped;
private final Long ready;
private DeploymentOverview(BuilderImpl builder) {
this.pending = builder.pending;
this.inProgress = builder.inProgress;
this.succeeded = builder.succeeded;
this.failed = builder.failed;
this.skipped = builder.skipped;
this.ready = builder.ready;
}
/**
*
* The number of instances in the deployment in a pending state.
*
*
* @return The number of instances in the deployment in a pending state.
*/
public final Long pending() {
return pending;
}
/**
*
* The number of instances in which the deployment is in progress.
*
*
* @return The number of instances in which the deployment is in progress.
*/
public final Long inProgress() {
return inProgress;
}
/**
*
* The number of instances in the deployment to which revisions have been successfully deployed.
*
*
* @return The number of instances in the deployment to which revisions have been successfully deployed.
*/
public final Long succeeded() {
return succeeded;
}
/**
*
* The number of instances in the deployment in a failed state.
*
*
* @return The number of instances in the deployment in a failed state.
*/
public final Long failed() {
return failed;
}
/**
*
* The number of instances in the deployment in a skipped state.
*
*
* @return The number of instances in the deployment in a skipped state.
*/
public final Long skipped() {
return skipped;
}
/**
*
* The number of instances in a replacement environment ready to receive traffic in a blue/green deployment.
*
*
* @return The number of instances in a replacement environment ready to receive traffic in a blue/green deployment.
*/
public final Long ready() {
return ready;
}
@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(pending());
hashCode = 31 * hashCode + Objects.hashCode(inProgress());
hashCode = 31 * hashCode + Objects.hashCode(succeeded());
hashCode = 31 * hashCode + Objects.hashCode(failed());
hashCode = 31 * hashCode + Objects.hashCode(skipped());
hashCode = 31 * hashCode + Objects.hashCode(ready());
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 DeploymentOverview)) {
return false;
}
DeploymentOverview other = (DeploymentOverview) obj;
return Objects.equals(pending(), other.pending()) && Objects.equals(inProgress(), other.inProgress())
&& Objects.equals(succeeded(), other.succeeded()) && Objects.equals(failed(), other.failed())
&& Objects.equals(skipped(), other.skipped()) && Objects.equals(ready(), other.ready());
}
/**
* 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("DeploymentOverview").add("Pending", pending()).add("InProgress", inProgress())
.add("Succeeded", succeeded()).add("Failed", failed()).add("Skipped", skipped()).add("Ready", ready()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Pending":
return Optional.ofNullable(clazz.cast(pending()));
case "InProgress":
return Optional.ofNullable(clazz.cast(inProgress()));
case "Succeeded":
return Optional.ofNullable(clazz.cast(succeeded()));
case "Failed":
return Optional.ofNullable(clazz.cast(failed()));
case "Skipped":
return Optional.ofNullable(clazz.cast(skipped()));
case "Ready":
return Optional.ofNullable(clazz.cast(ready()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy