Skip to content

Commit

Permalink
Add propertyClass to Organisation endpoint
Browse files Browse the repository at this point in the history
Update Organisation model
Update version
Fix link in README
  • Loading branch information
SidneyAllen committed Nov 30, 2018
1 parent 695ddad commit 8651e1b
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ Start by deciding which type of Xero app you'll be building [Private](http://dev

### Add Xero-Java Dependency

Add the dependency to your pom.xml. Gradle, sbt and other build tools can be found on [maven central](https://search.maven.org/artifact/com.github.xeroapi/xero-java/2.1.0/jar).
Add the dependency to your pom.xml. Gradle, sbt and other build tools can be found on [maven central](https://search.maven.org/search?q=g:com.github.xeroapi).

<dependency>
<groupId>com.github.xeroapi</groupId>
<artifactId>xero-java</artifactId>
<version>2.1.1</version>
<version>2.1.2</version>
</dependency>


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/JsonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public String getAccessTokenUrl() {

@Override
public String getUserAgent() {
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.1.1]";
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.1.2]";
}

@Override
Expand Down
78 changes: 77 additions & 1 deletion src/main/java/com/xero/models/accounting/Organisation.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,62 @@ public static OrganisationEntityTypeEnum fromValue(String text) {
@JsonProperty("ShortCode")
private String shortCode = null;

/**
* Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM)
*/
public enum PropertyClassEnum {
DEMO("DEMO"),

TRIAL("TRIAL"),

STARTER("STARTER"),

STANDARD("STANDARD"),

PREMIUM("PREMIUM"),

PREMIUM_20("PREMIUM_20"),

PREMIUM_50("PREMIUM_50"),

PREMIUM_100("PREMIUM_100"),

LEDGER("LEDGER"),

GST_CASHBOOK("GST_CASHBOOK"),

NON_GST_CASHBOOK("NON_GST_CASHBOOK");

private String value;

PropertyClassEnum(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static PropertyClassEnum fromValue(String text) {
for (PropertyClassEnum b : PropertyClassEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

@JsonProperty("Class")
private PropertyClassEnum propertyClass = null;

@JsonProperty("LineOfBusiness")
private String lineOfBusiness = null;

Expand Down Expand Up @@ -695,6 +751,24 @@ public void setShortCode(String shortCode) {
this.shortCode = shortCode;
}

public Organisation propertyClass(PropertyClassEnum propertyClass) {
this.propertyClass = propertyClass;
return this;
}

/**
* Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM)
* @return propertyClass
**/
@ApiModelProperty(value = "Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM)")
public PropertyClassEnum getPropertyClass() {
return propertyClass;
}

public void setPropertyClass(PropertyClassEnum propertyClass) {
this.propertyClass = propertyClass;
}

public Organisation lineOfBusiness(String lineOfBusiness) {
this.lineOfBusiness = lineOfBusiness;
return this;
Expand Down Expand Up @@ -843,6 +917,7 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.timezone, organisation.timezone) &&
Objects.equals(this.organisationEntityType, organisation.organisationEntityType) &&
Objects.equals(this.shortCode, organisation.shortCode) &&
Objects.equals(this.propertyClass, organisation.propertyClass) &&
Objects.equals(this.lineOfBusiness, organisation.lineOfBusiness) &&
Objects.equals(this.addresses, organisation.addresses) &&
Objects.equals(this.phones, organisation.phones) &&
Expand All @@ -852,7 +927,7 @@ public boolean equals(java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(apIKey, name, legalName, paysTax, version, organisationType, baseCurrency, countryCode, isDemoCompany, organisationStatus, registrationNumber, taxNumber, financialYearEndDay, financialYearEndMonth, salesTaxBasis, salesTaxPeriod, defaultSalesTax, defaultPurchasesTax, periodLockDate, endOfYearLockDate, createdDateUTC, timezone, organisationEntityType, shortCode, lineOfBusiness, addresses, phones, externalLinks, paymentTerms);
return Objects.hash(apIKey, name, legalName, paysTax, version, organisationType, baseCurrency, countryCode, isDemoCompany, organisationStatus, registrationNumber, taxNumber, financialYearEndDay, financialYearEndMonth, salesTaxBasis, salesTaxPeriod, defaultSalesTax, defaultPurchasesTax, periodLockDate, endOfYearLockDate, createdDateUTC, timezone, organisationEntityType, shortCode, propertyClass, lineOfBusiness, addresses, phones, externalLinks, paymentTerms);
}


Expand Down Expand Up @@ -885,6 +960,7 @@ public String toString() {
sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n");
sb.append(" organisationEntityType: ").append(toIndentedString(organisationEntityType)).append("\n");
sb.append(" shortCode: ").append(toIndentedString(shortCode)).append("\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
sb.append(" lineOfBusiness: ").append(toIndentedString(lineOfBusiness)).append("\n");
sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n");
sb.append(" phones: ").append(toIndentedString(phones)).append("\n");
Expand Down

0 comments on commit 8651e1b

Please sign in to comment.