Skip to content

Commit

Permalink
Merge pull request apple#34 from alexanderjordanbaker/AddStatus
Browse files Browse the repository at this point in the history
Add status field to Data model
  • Loading branch information
alexanderjordanbaker authored Sep 14, 2023
2 parents 9797f06 + b3fb34b commit dc41801
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/main/java/com/apple/itunes/storekit/model/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Data {
private static final String SERIALIZED_NAME_BUNDLE_VERSION = "bundleVersion";
private static final String SERIALIZED_NAME_SIGNED_TRANSACTION_INFO = "signedTransactionInfo";
private static final String SERIALIZED_NAME_SIGNED_RENEWAL_INFO = "signedRenewalInfo";
private static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_ENVIRONMENT)
private Environment environment;
@SerializedName(SERIALIZED_NAME_APP_APPLE_ID)
Expand All @@ -30,6 +31,8 @@ public class Data {
private String signedTransactionInfo;
@SerializedName(SERIALIZED_NAME_SIGNED_RENEWAL_INFO)
private String signedRenewalInfo;
@SerializedName(SERIALIZED_NAME_STATUS)
private Status status;


public Data() {
Expand Down Expand Up @@ -149,6 +152,25 @@ public void setSignedRenewalInfo(String signedRenewalInfo) {
this.signedRenewalInfo = signedRenewalInfo;
}

public Data status(Status status) {
this.status = status;
return this;
}

/**
* The status of an auto-renewable subscription as of the signedDate in the responseBodyV2DecodedPayload.
*
* @return status
* @see <a href="https://developer.apple.com/documentation/appstoreservernotifications/status">status</a>
**/
public Status getStatus() {
return status;
}

public void setStatus(Status status) {
this.status = status;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -163,12 +185,13 @@ public boolean equals(Object o) {
Objects.equals(this.bundleId, data.bundleId) &&
Objects.equals(this.bundleVersion, data.bundleVersion) &&
Objects.equals(this.signedTransactionInfo, data.signedTransactionInfo) &&
Objects.equals(this.signedRenewalInfo, data.signedRenewalInfo);
Objects.equals(this.signedRenewalInfo, data.signedRenewalInfo) &&
Objects.equals(this.status, data.status);
}

@Override
public int hashCode() {
return Objects.hash(environment, appAppleId, bundleId, bundleVersion, signedTransactionInfo, signedRenewalInfo);
return Objects.hash(environment, appAppleId, bundleId, bundleVersion, signedTransactionInfo, signedRenewalInfo, status);
}

@Override
Expand All @@ -180,6 +203,7 @@ public String toString() {
", bundleVersion='" + bundleVersion + '\'' +
", signedTransactionInfo='" + signedTransactionInfo + '\'' +
", signedRenewalInfo='" + signedRenewalInfo + '\'' +
", status=" + status +
'}';
}
}
Expand Down

0 comments on commit dc41801

Please sign in to comment.