package io.grhodes.code.deploy.dashboard.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/grhodes/code-deploy-dashboard/0.0.1-dev/android_rx2_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson, retrofit2 and RxJava2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Deployment { private final String id; private final DateTime created; private final DateTime started; private final DateTime completed; private final String creator; private final String deploymentGroupName; private final Integer failed; private final Integer skipped; private final Integer inProgress; private final Integer pending; private final Integer succeeded; private final String status; private final String errorMessage; private final String revisionLocation; private final DeploymentInstance[] instances; @JsonCreator public Deployment(@JsonProperty("id") String id, @JsonProperty("created") DateTime created, @JsonProperty("started") DateTime started, @JsonProperty("completed") DateTime completed, @JsonProperty("creator") String creator, @JsonProperty("deployment_group_name") String deploymentGroupName, @JsonProperty("failed") Integer failed, @JsonProperty("skipped") Integer skipped, @JsonProperty("in_progress") Integer inProgress, @JsonProperty("pending") Integer pending, @JsonProperty("succeeded") Integer succeeded, @JsonProperty("status") String status, @JsonProperty("error_message") String errorMessage, @JsonProperty("revision_location") String revisionLocation, @JsonProperty("instances") DeploymentInstance[] instances) { this.id = id; this.created = created; this.started = started; this.completed = completed; this.creator = creator; this.deploymentGroupName = deploymentGroupName; this.failed = failed; this.skipped = skipped; this.inProgress = inProgress; this.pending = pending; this.succeeded = succeeded; this.status = status; this.errorMessage = errorMessage; this.revisionLocation = revisionLocation; this.instances = instances; } /** * The deployment id */ public String getId() { return id; } /** * Date deployment created */ public DateTime getCreated() { return created; } /** * Date deployment started */ public DateTime getStarted() { return started; } /** * Date deployment created */ public DateTime getCompleted() { return completed; } public String getCreator() { return creator; } /** * The deployment group name */ public String getDeploymentGroupName() { return deploymentGroupName; } /** * The number of instances failed deployment */ public Integer getFailed() { return failed; } /** * The number of instances skipped deployment */ public Integer getSkipped() { return skipped; } /** * The number of instances currently deploying */ public Integer getInProgress() { return inProgress; } /** * The number of instances pending deployment */ public Integer getPending() { return pending; } /** * The number of instances succeeded at deployment */ public Integer getSucceeded() { return succeeded; } /** * The status of the deployment */ public String getStatus() { return status; } /** * A error message if the deployment failed */ public String getErrorMessage() { return errorMessage; } /** * The location of the revision */ public String getRevisionLocation() { return revisionLocation; } /** * The instances involved in this deployment */ public DeploymentInstance[] getInstances() { return instances; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Deployment that = (Deployment) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (created != null ? !created.equals(that.created) : that.created != null) return false; if (started != null ? !started.equals(that.started) : that.started != null) return false; if (completed != null ? !completed.equals(that.completed) : that.completed != null) return false; if (creator != null ? !creator.equals(that.creator) : that.creator != null) return false; if (deploymentGroupName != null ? !deploymentGroupName.equals(that.deploymentGroupName) : that.deploymentGroupName != null) return false; if (failed != null ? !failed.equals(that.failed) : that.failed != null) return false; if (skipped != null ? !skipped.equals(that.skipped) : that.skipped != null) return false; if (inProgress != null ? !inProgress.equals(that.inProgress) : that.inProgress != null) return false; if (pending != null ? !pending.equals(that.pending) : that.pending != null) return false; if (succeeded != null ? !succeeded.equals(that.succeeded) : that.succeeded != null) return false; if (status != null ? !status.equals(that.status) : that.status != null) return false; if (errorMessage != null ? !errorMessage.equals(that.errorMessage) : that.errorMessage != null) return false; if (revisionLocation != null ? !revisionLocation.equals(that.revisionLocation) : that.revisionLocation != null) return false; if (!Arrays.equals(instances, that.instances)) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (created != null ? created.hashCode() : 0); result = 31 * result + (started != null ? started.hashCode() : 0); result = 31 * result + (completed != null ? completed.hashCode() : 0); result = 31 * result + (creator != null ? creator.hashCode() : 0); result = 31 * result + (deploymentGroupName != null ? deploymentGroupName.hashCode() : 0); result = 31 * result + (failed != null ? failed.hashCode() : 0); result = 31 * result + (skipped != null ? skipped.hashCode() : 0); result = 31 * result + (inProgress != null ? inProgress.hashCode() : 0); result = 31 * result + (pending != null ? pending.hashCode() : 0); result = 31 * result + (succeeded != null ? succeeded.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (errorMessage != null ? errorMessage.hashCode() : 0); result = 31 * result + (revisionLocation != null ? revisionLocation.hashCode() : 0); result = 31 * result + (instances != null ? instances.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return io.grhodes.code.deploy.dashboard.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Deployment parseJson(String json) throws IOException { return io.grhodes.code.deploy.dashboard.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, Deployment.class); } }