Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thirdparty Intigration update #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.spotinst.sdkjava.enums.aws.elastigroup;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public enum Route53RecordSetType {

A("a"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to ARECORD

CNAME("cname");

private static final Logger LOGGER = LoggerFactory.getLogger(Route53RecordSetType.class);
private String name;

Route53RecordSetType(String name) {
this.name = name;
}

public static Route53RecordSetType fromName(String name) {
Route53RecordSetType retVal = null;

for (Route53RecordSetType signalNameEnum : Route53RecordSetType.values()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change variable signalNameEnum to relevant type

if (name.equalsIgnoreCase(signalNameEnum.name)) {
retVal = signalNameEnum;
break;
}
}

if (retVal == null) {
LOGGER.error("Tried to create signal name enum for: " + name + ", but we don't support such type ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change logging message

}

return retVal;
}

public String getName() {
return name;
}
}
17 changes: 17 additions & 0 deletions src/main/java/com/spotinst/sdkjava/model/ApiAutoScale.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity;
import com.spotinst.sdkjava.model.api.elastigroup.aws.ApiConstraints;
import com.spotinst.sdkjava.model.bl.elastigroup.aws.Constraints;

import java.util.HashSet;
import java.util.List;
Expand All @@ -24,6 +26,7 @@ public class ApiAutoScale implements IPartialUpdateEntity {
private Boolean isAutoConfig;
private Boolean shouldScaleDownNonServiceTasks;
private List<ApiAttributes> attributes;
private List<ApiConstraints> constraints;
//endregion

//region Constructor
Expand All @@ -41,6 +44,15 @@ public void setIsSet(Set<String> isSet) {
this.isSet = isSet;
}

public List<ApiConstraints> getConstraints() {
return constraints;
}

public void setConstraints(List<ApiConstraints> constraints) {
isSet.add("constraints");
this.constraints = constraints;
}

public Boolean getIsEnabled() {
return isEnabled;
}
Expand Down Expand Up @@ -106,6 +118,11 @@ public void setAttributes(List<ApiAttributes> attributes) {

//endregion
//region isSet methods
// Is constraints Set boolean method
@JsonIgnore
public boolean isConstraintsSet() {
return isSet.contains("constraints");
}
// Is isEnabled Set boolean method
@JsonIgnore
public boolean isIsEnabledSet() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spotinst.sdkjava.client.rest.IPartialUpdateEntity;
import com.spotinst.sdkjava.model.api.elastigroup.aws.ApiElasticBeanstalk;
import com.spotinst.sdkjava.model.api.elastigroup.aws.ApiNomad;
import com.spotinst.sdkjava.model.api.elastigroup.aws.ApiRoute53;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -16,10 +18,12 @@
class ApiThirdPartiesIntegration implements IPartialUpdateEntity {
//region Members
@JsonIgnore
private Set<String> isSet;
private ApiEcs ecs;
private ApiCodeDeploy codeDeploy;
private ApiElasticBeanstalk elasticBeanstalk;
private Set<String> isSet;
private ApiEcs ecs;
private ApiCodeDeploy codeDeploy;
private ApiElasticBeanstalk elasticBeanstalk;
private ApiRoute53 route53;
private ApiNomad nomad;
//endregion

//region Constructor
Expand All @@ -39,6 +43,15 @@ public void setIsSet(Set<String> isSet) {
this.isSet = isSet;
}

public ApiNomad getNomad() {
return nomad;
}

public void setNomad(ApiNomad nomad) {
isSet.add("nomad");
this.nomad = nomad;
}

public ApiEcs getEcs() {
return ecs;
}
Expand Down Expand Up @@ -67,8 +80,21 @@ public void setElasticBeanstalk(ApiElasticBeanstalk elasticBeanstalk) {
this.elasticBeanstalk = elasticBeanstalk;
}

public ApiRoute53 getRoute53() {
return route53;
}

public void setRoute53(ApiRoute53 route53) {
this.route53 = route53;
}

//endregion
//region isSet methods
// Is nomad Set boolean method
@JsonIgnore
public boolean isNomadSet() {
return isSet.contains("nomad");
}
// Is ecs Set boolean method
@JsonIgnore
public boolean isEcsSet() {
Expand All @@ -86,6 +112,12 @@ public boolean isCodeDeploySet() {
public boolean isElasticBeanstalkSet() {
return isSet.contains("elasticBeanstalk");
}

// Is route53 Set boolean method
@JsonIgnore
public boolean isRoute53Set() {
return isSet.contains("route53");
}
//endregion

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.spotinst.sdkjava.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.spotinst.sdkjava.model.bl.elastigroup.aws.Constraints;

import java.util.HashSet;
import java.util.List;
Expand All @@ -17,6 +18,7 @@ public class ElastigroupAutoScaleSpecification {
private Boolean isAutoConfig;
private Boolean shouldScaleDownNonServiceTasks;
private List<ElastigroupAttributesSpecification> attributes;
private List<Constraints> constraints;
//endregion

//region Constructor
Expand All @@ -35,6 +37,15 @@ public void setIsSet(Set<String> isSet) {
this.isSet = isSet;
}

public List<Constraints> getConstraints() {
return constraints;
}

public void setConstraints(List<Constraints> constraints) {
isSet.add("constraints");
this.constraints = constraints;
}

public Boolean getEnabled() {
return isEnabled;
}
Expand Down Expand Up @@ -111,6 +122,11 @@ public static ElastigroupAutoScaleSpecification.Builder get() {
return new Builder();
}

public Builder setConstraints(final List<Constraints> constraints) {
AutoScale.setConstraints(constraints);
return this;
}

public Builder setIsEnabled(final Boolean isEnabled) {
AutoScale.setIsEnabled(isEnabled);
return this;
Expand Down Expand Up @@ -153,6 +169,11 @@ public ElastigroupAutoScaleSpecification build() {
//endregion

//region isSet methods
// Is constraints Set boolean method
@JsonIgnore
public boolean isConstraintsSet() {
return isSet.contains("constraints");
}
// Is isEnabled Set boolean method
@JsonIgnore
public boolean isIsEnabledSet() {
Expand Down
Loading