package com.teambytes.hipchat.sns.bridge.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.Object; import java.lang.Override; import java.lang.String; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/teambytes/hipchat-sns-bridge/0.0.1-dev/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 * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class SnsNotification { private final String type; private final String messageId; private final String topicArn; private final String message; private final String timestamp; private final String signatureVersion; private final String signature; private final String signingCertURL; private final String token; private final String subject; private final String subscribeURL; private final String unsubscribeURL; @JsonCreator public SnsNotification(@JsonProperty("Type") String type, @JsonProperty("MessageId") String messageId, @JsonProperty("TopicArn") String topicArn, @JsonProperty("Message") String message, @JsonProperty("Timestamp") String timestamp, @JsonProperty("SignatureVersion") String signatureVersion, @JsonProperty("Signature") String signature, @JsonProperty("SigningCertURL") String signingCertURL, @JsonProperty("Token") String token, @JsonProperty("Subject") String subject, @JsonProperty("SubscribeURL") String subscribeURL, @JsonProperty("UnsubscribeURL") String unsubscribeURL) { this.type = type; this.messageId = messageId; this.topicArn = topicArn; this.message = message; this.timestamp = timestamp; this.signatureVersion = signatureVersion; this.signature = signature; this.signingCertURL = signingCertURL; this.token = token; this.subject = subject; this.subscribeURL = subscribeURL; this.unsubscribeURL = unsubscribeURL; } /** * The type of message. For a unsubscribe confirmation, the type is UnsubscribeConfirmation. */ public String getType() { return type; } /** * A Universally Unique Identifier, unique for each message published. For a message that Amazon SNS resends during a retry, the message ID of the original message is used. */ public String getMessageId() { return messageId; } /** * The Amazon Resource Name (ARN) for the topic that this endpoint has been unsubscribed from. */ public String getTopicArn() { return topicArn; } /** * A string that describes the message. */ public String getMessage() { return message; } /** * The time (GMT) when the unsubscribe confirmation was sent. */ public String getTimestamp() { return timestamp; } /** * Version of the Amazon SNS signature used. */ public String getSignatureVersion() { return signatureVersion; } /** * Base64-encoded 'SHA1withRSA' signature of the Message, MessageId, Type, Timestamp, and TopicArn values. */ public String getSignature() { return signature; } /** * The URL to the certificate that was used to sign the message. */ public String getSigningCertURL() { return signingCertURL; } /** * A value you can use with the ConfirmSubscription action to re-confirm the subscription. Alternatively, you can simply visit the SubscribeURL. */ public String getToken() { return token; } /** * The Subject parameter specified when the notification was published to the topic. Note that this is an optional parameter. If no Subject was specified, then this name/value pair does not appear in this JSON document. */ public String getSubject() { return subject; } /** * The URL that you must visit in order to re-confirm the subscription. Alternatively, you can instead use the Token with the ConfirmSubscription action to re-confirm the subscription. */ public String getSubscribeURL() { return subscribeURL; } /** * A URL that you can use to unsubscribe the endpoint from this topic. If you visit this URL, Amazon SNS unsubscribes the endpoint and stops sending notifications to this endpoint. */ public String getUnsubscribeURL() { return unsubscribeURL; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SnsNotification that = (SnsNotification) o; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (messageId != null ? !messageId.equals(that.messageId) : that.messageId != null) return false; if (topicArn != null ? !topicArn.equals(that.topicArn) : that.topicArn != null) return false; if (message != null ? !message.equals(that.message) : that.message != null) return false; if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false; if (signatureVersion != null ? !signatureVersion.equals(that.signatureVersion) : that.signatureVersion != null) return false; if (signature != null ? !signature.equals(that.signature) : that.signature != null) return false; if (signingCertURL != null ? !signingCertURL.equals(that.signingCertURL) : that.signingCertURL != null) return false; if (token != null ? !token.equals(that.token) : that.token != null) return false; if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false; if (subscribeURL != null ? !subscribeURL.equals(that.subscribeURL) : that.subscribeURL != null) return false; if (unsubscribeURL != null ? !unsubscribeURL.equals(that.unsubscribeURL) : that.unsubscribeURL != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (messageId != null ? messageId.hashCode() : 0); result = 31 * result + (topicArn != null ? topicArn.hashCode() : 0); result = 31 * result + (message != null ? message.hashCode() : 0); result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0); result = 31 * result + (signatureVersion != null ? signatureVersion.hashCode() : 0); result = 31 * result + (signature != null ? signature.hashCode() : 0); result = 31 * result + (signingCertURL != null ? signingCertURL.hashCode() : 0); result = 31 * result + (token != null ? token.hashCode() : 0); result = 31 * result + (subject != null ? subject.hashCode() : 0); result = 31 * result + (subscribeURL != null ? subscribeURL.hashCode() : 0); result = 31 * result + (unsubscribeURL != null ? unsubscribeURL.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.teambytes.hipchat.sns.bridge.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static SnsNotification parseJson(String json) throws IOException { return com.teambytes.hipchat.sns.bridge.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, SnsNotification.class); } }