package com.gilt.svc.sundial.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.2.7 * User agent: apibuilder app.apibuilder.io/gilt/svc-sundial/0.2.7/android_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 and retrofit2 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 * * New EMR cluster configuration object */ @JsonIgnoreProperties( ignoreUnknown = true ) @JsonTypeInfo( use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE ) public class NewEmrCluster implements EmrCluster { private final String name; private final EmrReleaseLabel releaseLabel; private final EmrApplication[] applications; private final String s3LogUri; private final EmrInstanceGroupDetails masterInstance; private final EmrInstanceGroupDetails coreInstance; private final EmrInstanceGroupDetails taskInstance; private final String ec2Subnet; private final EmrServiceRole emrServiceRole; private final EmrJobFlowRole emrJobFlowRole; private final Boolean visibleToAllUsers; @JsonCreator public NewEmrCluster(@JsonProperty("name") String name, @JsonProperty("release_label") EmrReleaseLabel releaseLabel, @JsonProperty("applications") EmrApplication[] applications, @JsonProperty("s3_log_uri") String s3LogUri, @JsonProperty("master_instance") EmrInstanceGroupDetails masterInstance, @JsonProperty("core_instance") EmrInstanceGroupDetails coreInstance, @JsonProperty("task_instance") EmrInstanceGroupDetails taskInstance, @JsonProperty("ec2_subnet") String ec2Subnet, @JsonProperty("emr_service_role") EmrServiceRole emrServiceRole, @JsonProperty("emr_job_flow_role") EmrJobFlowRole emrJobFlowRole, @JsonProperty("visible_to_all_users") Boolean visibleToAllUsers) { this.name = name; this.releaseLabel = releaseLabel; this.applications = applications; this.s3LogUri = s3LogUri; this.masterInstance = masterInstance; this.coreInstance = coreInstance; this.taskInstance = taskInstance; this.ec2Subnet = ec2Subnet; this.emrServiceRole = emrServiceRole; this.emrJobFlowRole = emrJobFlowRole; this.visibleToAllUsers = visibleToAllUsers; } public String getName() { return name; } public EmrReleaseLabel getReleaseLabel() { return releaseLabel; } public EmrApplication[] getApplications() { return applications; } public String getS3LogUri() { return s3LogUri; } public EmrInstanceGroupDetails getMasterInstance() { return masterInstance; } public EmrInstanceGroupDetails getCoreInstance() { return coreInstance; } public EmrInstanceGroupDetails getTaskInstance() { return taskInstance; } /** * To be set in case the EMR cannot be launched in the `default VPC` */ public String getEc2Subnet() { return ec2Subnet; } /** * role to be assigned to the service, the default one should cover most of the cases */ public EmrServiceRole getEmrServiceRole() { return emrServiceRole; } /** * role to be assigned to the ec2 instances composing the EMR cluster. The default one should cover most of the cases */ public EmrJobFlowRole getEmrJobFlowRole() { return emrJobFlowRole; } /** * whether or not to show the new cluster in the list of clusters. For more details see [emr docs](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-emr-cluster.html#cfn-emr-cluster-visibletoallusers) */ public Boolean getVisibleToAllUsers() { return visibleToAllUsers; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NewEmrCluster that = (NewEmrCluster) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (releaseLabel != null ? !releaseLabel.equals(that.releaseLabel) : that.releaseLabel != null) return false; if (!Arrays.equals(applications, that.applications)) return false; if (s3LogUri != null ? !s3LogUri.equals(that.s3LogUri) : that.s3LogUri != null) return false; if (masterInstance != null ? !masterInstance.equals(that.masterInstance) : that.masterInstance != null) return false; if (coreInstance != null ? !coreInstance.equals(that.coreInstance) : that.coreInstance != null) return false; if (taskInstance != null ? !taskInstance.equals(that.taskInstance) : that.taskInstance != null) return false; if (ec2Subnet != null ? !ec2Subnet.equals(that.ec2Subnet) : that.ec2Subnet != null) return false; if (emrServiceRole != null ? !emrServiceRole.equals(that.emrServiceRole) : that.emrServiceRole != null) return false; if (emrJobFlowRole != null ? !emrJobFlowRole.equals(that.emrJobFlowRole) : that.emrJobFlowRole != null) return false; if (visibleToAllUsers != null ? !visibleToAllUsers.equals(that.visibleToAllUsers) : that.visibleToAllUsers != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (releaseLabel != null ? releaseLabel.hashCode() : 0); result = 31 * result + (applications != null ? applications.hashCode() : 0); result = 31 * result + (s3LogUri != null ? s3LogUri.hashCode() : 0); result = 31 * result + (masterInstance != null ? masterInstance.hashCode() : 0); result = 31 * result + (coreInstance != null ? coreInstance.hashCode() : 0); result = 31 * result + (taskInstance != null ? taskInstance.hashCode() : 0); result = 31 * result + (ec2Subnet != null ? ec2Subnet.hashCode() : 0); result = 31 * result + (emrServiceRole != null ? emrServiceRole.hashCode() : 0); result = 31 * result + (emrJobFlowRole != null ? emrJobFlowRole.hashCode() : 0); result = 31 * result + (visibleToAllUsers != null ? visibleToAllUsers.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.gilt.svc.sundial.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static NewEmrCluster parseJson(String json) throws IOException { return com.gilt.svc.sundial.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, NewEmrCluster.class); } }