
io.swagger.client.model.Webhook Maven / Gradle / Ivy
/*
* Qualpay Platform API
* This document describes the Qualpay Platform API.
*
* OpenAPI spec version: 1.1.9
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.WebhookAuthSetting;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Webhook
*/
public class Webhook {
@SerializedName("webhook_id")
private Long webhookId = null;
@SerializedName("webhook_node")
private String webhookNode = null;
/**
* <strong>Format: </strong>Variable length, up to 16 AN<br><strong>Description: </strong> Status of the webhook. Following are descriptions of the statuses <ul> <li>ACTIVE - The webhook is active.</li> <li>DISABLED - The webhook was disabled by the user. </li> <li>SUSPENDED - The webhook was suspended by the system. A webhook is suspended when the system is unable to post a request for 48 hours. </li> </ul>While a webhook is disabled or suspended, no new requests will be posted or added for it. If there are existing requests for this webhook in the request queue, they will be held.
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
ACTIVE("ACTIVE"),
DISABLED("DISABLED"),
SUSPENDED("SUSPENDED");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("status")
private StatusEnum status = null;
@SerializedName("label")
private String label = null;
@SerializedName("notification_url")
private String notificationUrl = null;
@SerializedName("email_address")
private List emailAddress = null;
@SerializedName("events")
private List events = null;
@SerializedName("db_timestamp")
private String dbTimestamp = null;
@SerializedName("secret")
private String secret = null;
@SerializedName("auth_type")
private String authType = null;
@SerializedName("auth_settings")
private WebhookAuthSetting authSettings = null;
/**
* <strong>Format: </strong>Variable length, up to 10 N<br><strong>Description: </strong>A unique ID generated by Qualpay to identify a webhook.
* @return webhookId
**/
@ApiModelProperty(example = "123", value = "Format: Variable length, up to 10 N
Description: A unique ID generated by Qualpay to identify a webhook.")
public Long getWebhookId() {
return webhookId;
}
public Webhook webhookNode(String webhookNode) {
this.webhookNode = webhookNode;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 16 N<br><strong>Description: </strong>The node at which the webhook will be created. If a merchant id is sent in this field, the webhook is created for the merchant. If a webhook_node is not included in the request, the webhook will be created at the api key's node.
* @return webhookNode
**/
@ApiModelProperty(example = "", value = "Format: Variable length, up to 16 N
Description: The node at which the webhook will be created. If a merchant id is sent in this field, the webhook is created for the merchant. If a webhook_node is not included in the request, the webhook will be created at the api key's node. ")
public String getWebhookNode() {
return webhookNode;
}
public void setWebhookNode(String webhookNode) {
this.webhookNode = webhookNode;
}
/**
* <strong>Format: </strong>Variable length, up to 16 AN<br><strong>Description: </strong> Status of the webhook. Following are descriptions of the statuses <ul> <li>ACTIVE - The webhook is active.</li> <li>DISABLED - The webhook was disabled by the user. </li> <li>SUSPENDED - The webhook was suspended by the system. A webhook is suspended when the system is unable to post a request for 48 hours. </li> </ul>While a webhook is disabled or suspended, no new requests will be posted or added for it. If there are existing requests for this webhook in the request queue, they will be held.
* @return status
**/
@ApiModelProperty(example = "ACTIVE", value = "Format: Variable length, up to 16 AN
Description: Status of the webhook. Following are descriptions of the statuses - ACTIVE - The webhook is active.
- DISABLED - The webhook was disabled by the user.
- SUSPENDED - The webhook was suspended by the system. A webhook is suspended when the system is unable to post a request for 48 hours.
While a webhook is disabled or suspended, no new requests will be posted or added for it. If there are existing requests for this webhook in the request queue, they will be held.")
public StatusEnum getStatus() {
return status;
}
public Webhook label(String label) {
this.label = label;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 64 AN<br><strong>Description: </strong>A label to identify the webhook.
* @return label
**/
@ApiModelProperty(example = "Test", required = true, value = "Format: Variable length, up to 64 AN
Description: A label to identify the webhook.")
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Webhook notificationUrl(String notificationUrl) {
this.notificationUrl = notificationUrl;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 256 AN<br><strong>Description: </strong>The webhook endpoint to which requests will be posted. The endpoint must use HTTPs and should serve HTTP POST requests. The endpoint URL should respond with an HTTP 2xx response. Any other HTTP response message is considered a failure and Qualpay will retry posting the same request until a successful response is received or the request expires, whichever comes first.
* @return notificationUrl
**/
@ApiModelProperty(example = "https:///<>", required = true, value = "Format: Variable length, up to 256 AN
Description: The webhook endpoint to which requests will be posted. The endpoint must use HTTPs and should serve HTTP POST requests. The endpoint URL should respond with an HTTP 2xx response. Any other HTTP response message is considered a failure and Qualpay will retry posting the same request until a successful response is received or the request expires, whichever comes first. ")
public String getNotificationUrl() {
return notificationUrl;
}
public void setNotificationUrl(String notificationUrl) {
this.notificationUrl = notificationUrl;
}
public Webhook emailAddress(List emailAddress) {
this.emailAddress = emailAddress;
return this;
}
public Webhook addEmailAddressItem(String emailAddressItem) {
if (this.emailAddress == null) {
this.emailAddress = new ArrayList();
}
this.emailAddress.add(emailAddressItem);
return this;
}
/**
* An array of email addresses that will be notified when a webhook is suspended.
* @return emailAddress
**/
@ApiModelProperty(value = "An array of email addresses that will be notified when a webhook is suspended.")
public List getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(List emailAddress) {
this.emailAddress = emailAddress;
}
public Webhook events(List events) {
this.events = events;
return this;
}
public Webhook addEventsItem(String eventsItem) {
if (this.events == null) {
this.events = new ArrayList();
}
this.events.add(eventsItem);
return this;
}
/**
* An array of events that will trigger the POST request. Refer to Webhooks documentation for a list of available events.
* @return events
**/
@ApiModelProperty(value = "An array of events that will trigger the POST request. Refer to Webhooks documentation for a list of available events.")
public List getEvents() {
return events;
}
public void setEvents(List events) {
this.events = events;
}
/**
* <strong>Format: </strong>Variable length AN, in YYYY-MM-DD HH:mm:ss format<br><strong>Description: </strong>Webhook creation timestamp.
* @return dbTimestamp
**/
@ApiModelProperty(example = "2017-06-06 07:30:30", value = "Format: Variable length AN, in YYYY-MM-DD HH:mm:ss format
Description: Webhook creation timestamp.")
public String getDbTimestamp() {
return dbTimestamp;
}
/**
* <strong>Format: </strong>Variable length, up to 32 AN<br><strong>Description: </strong>A secret that will be used by Qualpay to generate the x-qualpay-webhook-signature header. Qualpay signs each webhook request using the x-qualpay-webhook-signature header. This signature can be used to validate that a request is initiated by Qualpay. The signature is a Base 64 encoded HMAC-256 digest generated from the request payload using the webhook’s secret.This secret can be viewed only when adding a webhook. Use Qualpay Manager to change the secret.
* @return secret
**/
@ApiModelProperty(value = "Format: Variable length, up to 32 AN
Description: A secret that will be used by Qualpay to generate the x-qualpay-webhook-signature header. Qualpay signs each webhook request using the x-qualpay-webhook-signature header. This signature can be used to validate that a request is initiated by Qualpay. The signature is a Base 64 encoded HMAC-256 digest generated from the request payload using the webhook’s secret.This secret can be viewed only when adding a webhook. Use Qualpay Manager to change the secret. ")
public String getSecret() {
return secret;
}
public Webhook authType(String authType) {
this.authType = authType;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 8 AN<br><strong>Description: </strong>The authentication type. By default the authentication type will be NONE. Following are descriptions of the statuses <ul> <li>NONE - No authentication</li> <li>BASIC - The POST request will be secured by HTTP BASIC authenticaiton. user_password field should be provided for basic authenticaiton. </li> </ul>
* @return authType
**/
@ApiModelProperty(example = "BASIC", value = "Format: Variable length, up to 8 AN
Description: The authentication type. By default the authentication type will be NONE. Following are descriptions of the statuses - NONE - No authentication
- BASIC - The POST request will be secured by HTTP BASIC authenticaiton. user_password field should be provided for basic authenticaiton.
")
public String getAuthType() {
return authType;
}
public void setAuthType(String authType) {
this.authType = authType;
}
public Webhook authSettings(WebhookAuthSetting authSettings) {
this.authSettings = authSettings;
return this;
}
/**
* Authentication properties. If the webhook POST request should be secured, set this value along with the auth_type.
* @return authSettings
**/
@ApiModelProperty(value = "Authentication properties. If the webhook POST request should be secured, set this value along with the auth_type. ")
public WebhookAuthSetting getAuthSettings() {
return authSettings;
}
public void setAuthSettings(WebhookAuthSetting authSettings) {
this.authSettings = authSettings;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Webhook webhook = (Webhook) o;
return Objects.equals(this.webhookId, webhook.webhookId) &&
Objects.equals(this.webhookNode, webhook.webhookNode) &&
Objects.equals(this.status, webhook.status) &&
Objects.equals(this.label, webhook.label) &&
Objects.equals(this.notificationUrl, webhook.notificationUrl) &&
Objects.equals(this.emailAddress, webhook.emailAddress) &&
Objects.equals(this.events, webhook.events) &&
Objects.equals(this.dbTimestamp, webhook.dbTimestamp) &&
Objects.equals(this.secret, webhook.secret) &&
Objects.equals(this.authType, webhook.authType) &&
Objects.equals(this.authSettings, webhook.authSettings);
}
@Override
public int hashCode() {
return Objects.hash(webhookId, webhookNode, status, label, notificationUrl, emailAddress, events, dbTimestamp, secret, authType, authSettings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Webhook {\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookNode: ").append(toIndentedString(webhookNode)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
sb.append(" notificationUrl: ").append(toIndentedString(notificationUrl)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" events: ").append(toIndentedString(events)).append("\n");
sb.append(" dbTimestamp: ").append(toIndentedString(dbTimestamp)).append("\n");
sb.append(" secret: ").append(toIndentedString(secret)).append("\n");
sb.append(" authType: ").append(toIndentedString(authType)).append("\n");
sb.append(" authSettings: ").append(toIndentedString(authSettings)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy