* | :heavy_minus_sign: | The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this field is provided then the `buyer_id` field needs to be unset. | user-789123 |
\ No newline at end of file
diff --git a/docs/sdks/activations/README.md b/docs/sdks/activations/README.md
index 5ce22e09..e8d89620 100644
--- a/docs/sdks/activations/README.md
+++ b/docs/sdks/activations/README.md
@@ -8,7 +8,7 @@
## create
-Activate a physical gift card through the primary gift card service.
+Activate a physical gift card through the primary gift card service. Set `store` to `true` to also store the activated gift card.
### Example Usage
diff --git a/gradle.properties b/gradle.properties
index bdee5eb1..da64f5d5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
groupId=com.gr4vy
artifactId=sdk
-version=2.18.0
+version=2.18.1
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
diff --git a/src/main/java/com/gr4vy/sdk/Activations.java b/src/main/java/com/gr4vy/sdk/Activations.java
index f8d575ae..6c8e957a 100644
--- a/src/main/java/com/gr4vy/sdk/Activations.java
+++ b/src/main/java/com/gr4vy/sdk/Activations.java
@@ -37,7 +37,8 @@ public AsyncActivations async() {
/**
* Activate a gift card
*
- * Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @return The call builder
*/
@@ -48,7 +49,8 @@ public ActivateGiftCardRequestBuilder create() {
/**
* Activate a gift card
*
- *
Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @param giftCardActivationCreate The details used to activate a physical gift card.
* @return The response from the API call
@@ -61,7 +63,8 @@ public ActivateGiftCardResponse create(GiftCardActivationCreate giftCardActivati
/**
* Activate a gift card
*
- *
Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @param idempotencyKey A unique key that identifies this request. If supported by the gift card service, the value will be forwarded to make the activation idempotent. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
* @param merchantAccountId
diff --git a/src/main/java/com/gr4vy/sdk/AsyncActivations.java b/src/main/java/com/gr4vy/sdk/AsyncActivations.java
index fd9f0372..57f94498 100644
--- a/src/main/java/com/gr4vy/sdk/AsyncActivations.java
+++ b/src/main/java/com/gr4vy/sdk/AsyncActivations.java
@@ -39,7 +39,8 @@ public Activations sync() {
/**
* Activate a gift card
*
- *
Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @return The async call builder
*/
@@ -50,7 +51,8 @@ public ActivateGiftCardRequestBuilder create() {
/**
* Activate a gift card
*
- *
Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @param giftCardActivationCreate The details used to activate a physical gift card.
* @return {@code CompletableFuture} - The async response
@@ -62,7 +64,8 @@ public CompletableFuture create(GiftCardActivationCrea
/**
* Activate a gift card
*
- * Activate a physical gift card through the primary gift card service.
+ *
Activate a physical gift card through the primary gift card service. Set `store` to `true` to also
+ * store the activated gift card.
*
* @param idempotencyKey A unique key that identifies this request. If supported by the gift card service, the value will be forwarded to make the activation idempotent. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
* @param merchantAccountId
diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
index bc127b5d..0722eb26 100644
--- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
+++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
@@ -22,7 +22,7 @@ public class SDKConfiguration {
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "1.0.0";
- public static final String SDK_VERSION = "2.18.0";
+ public static final String SDK_VERSION = "2.18.1";
public static final String GEN_VERSION = "2.924.0";
private static final String BASE_PACKAGE = "com.gr4vy.sdk";
public static final String USER_AGENT =
diff --git a/src/main/java/com/gr4vy/sdk/models/components/GiftCardActivationCreate.java b/src/main/java/com/gr4vy/sdk/models/components/GiftCardActivationCreate.java
index 14f65504..92d833cf 100644
--- a/src/main/java/com/gr4vy/sdk/models/components/GiftCardActivationCreate.java
+++ b/src/main/java/com/gr4vy/sdk/models/components/GiftCardActivationCreate.java
@@ -8,10 +8,14 @@
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.gr4vy.sdk.utils.LazySingletonValue;
import com.gr4vy.sdk.utils.Utils;
+import java.lang.Boolean;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
+import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
/**
@@ -55,28 +59,61 @@ public class GiftCardActivationCreate {
@JsonProperty("external_identifier")
private JsonNullable externalIdentifier;
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("store")
+ private Optional store;
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("buyer_id")
+ private JsonNullable buyerId;
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("buyer_external_identifier")
+ private JsonNullable buyerExternalIdentifier;
+
@JsonCreator
public GiftCardActivationCreate(
@JsonProperty("number") String number,
@JsonProperty("pin") JsonNullable pin,
@JsonProperty("amount") JsonNullable amount,
@JsonProperty("currency") JsonNullable currency,
- @JsonProperty("external_identifier") JsonNullable externalIdentifier) {
+ @JsonProperty("external_identifier") JsonNullable externalIdentifier,
+ @JsonProperty("store") Optional store,
+ @JsonProperty("buyer_id") JsonNullable buyerId,
+ @JsonProperty("buyer_external_identifier") JsonNullable buyerExternalIdentifier) {
Utils.checkNotNull(number, "number");
Utils.checkNotNull(pin, "pin");
Utils.checkNotNull(amount, "amount");
Utils.checkNotNull(currency, "currency");
Utils.checkNotNull(externalIdentifier, "externalIdentifier");
+ Utils.checkNotNull(store, "store");
+ Utils.checkNotNull(buyerId, "buyerId");
+ Utils.checkNotNull(buyerExternalIdentifier, "buyerExternalIdentifier");
this.number = number;
this.pin = pin;
this.amount = amount;
this.currency = currency;
this.externalIdentifier = externalIdentifier;
+ this.store = store;
+ this.buyerId = buyerId;
+ this.buyerExternalIdentifier = buyerExternalIdentifier;
}
public GiftCardActivationCreate(
String number) {
this(number, JsonNullable.undefined(), JsonNullable.undefined(),
+ JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(),
JsonNullable.undefined(), JsonNullable.undefined());
}
@@ -121,6 +158,32 @@ public JsonNullable externalIdentifier() {
return externalIdentifier;
}
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ @JsonIgnore
+ public Optional store() {
+ return store;
+ }
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ @JsonIgnore
+ public JsonNullable buyerId() {
+ return buyerId;
+ }
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ @JsonIgnore
+ public JsonNullable buyerExternalIdentifier() {
+ return buyerExternalIdentifier;
+ }
+
public static Builder builder() {
return new Builder();
}
@@ -209,6 +272,65 @@ public GiftCardActivationCreate withExternalIdentifier(JsonNullable exte
return this;
}
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ public GiftCardActivationCreate withStore(boolean store) {
+ Utils.checkNotNull(store, "store");
+ this.store = Optional.ofNullable(store);
+ return this;
+ }
+
+
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ public GiftCardActivationCreate withStore(Optional store) {
+ Utils.checkNotNull(store, "store");
+ this.store = store;
+ return this;
+ }
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ public GiftCardActivationCreate withBuyerId(String buyerId) {
+ Utils.checkNotNull(buyerId, "buyerId");
+ this.buyerId = JsonNullable.of(buyerId);
+ return this;
+ }
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ public GiftCardActivationCreate withBuyerId(JsonNullable buyerId) {
+ Utils.checkNotNull(buyerId, "buyerId");
+ this.buyerId = buyerId;
+ return this;
+ }
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ public GiftCardActivationCreate withBuyerExternalIdentifier(String buyerExternalIdentifier) {
+ Utils.checkNotNull(buyerExternalIdentifier, "buyerExternalIdentifier");
+ this.buyerExternalIdentifier = JsonNullable.of(buyerExternalIdentifier);
+ return this;
+ }
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ public GiftCardActivationCreate withBuyerExternalIdentifier(JsonNullable buyerExternalIdentifier) {
+ Utils.checkNotNull(buyerExternalIdentifier, "buyerExternalIdentifier");
+ this.buyerExternalIdentifier = buyerExternalIdentifier;
+ return this;
+ }
+
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
@@ -223,14 +345,18 @@ public boolean equals(java.lang.Object o) {
Utils.enhancedDeepEquals(this.pin, other.pin) &&
Utils.enhancedDeepEquals(this.amount, other.amount) &&
Utils.enhancedDeepEquals(this.currency, other.currency) &&
- Utils.enhancedDeepEquals(this.externalIdentifier, other.externalIdentifier);
+ Utils.enhancedDeepEquals(this.externalIdentifier, other.externalIdentifier) &&
+ Utils.enhancedDeepEquals(this.store, other.store) &&
+ Utils.enhancedDeepEquals(this.buyerId, other.buyerId) &&
+ Utils.enhancedDeepEquals(this.buyerExternalIdentifier, other.buyerExternalIdentifier);
}
@Override
public int hashCode() {
return Utils.enhancedHash(
number, pin, amount,
- currency, externalIdentifier);
+ currency, externalIdentifier, store,
+ buyerId, buyerExternalIdentifier);
}
@Override
@@ -240,7 +366,10 @@ public String toString() {
"pin", pin,
"amount", amount,
"currency", currency,
- "externalIdentifier", externalIdentifier);
+ "externalIdentifier", externalIdentifier,
+ "store", store,
+ "buyerId", buyerId,
+ "buyerExternalIdentifier", buyerExternalIdentifier);
}
@SuppressWarnings("UnusedReturnValue")
@@ -256,6 +385,12 @@ public final static class Builder {
private JsonNullable externalIdentifier = JsonNullable.undefined();
+ private Optional store;
+
+ private JsonNullable buyerId = JsonNullable.undefined();
+
+ private JsonNullable buyerExternalIdentifier = JsonNullable.undefined();
+
private Builder() {
// force use of static builder() method
}
@@ -348,12 +483,83 @@ public Builder externalIdentifier(JsonNullable externalIdentifier) {
return this;
}
+
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ public Builder store(boolean store) {
+ Utils.checkNotNull(store, "store");
+ this.store = Optional.ofNullable(store);
+ return this;
+ }
+
+ /**
+ * Whether to store the activated gift card in the vault. When `true`, a `pin` is required.
+ */
+ public Builder store(Optional store) {
+ Utils.checkNotNull(store, "store");
+ this.store = store;
+ return this;
+ }
+
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ public Builder buyerId(String buyerId) {
+ Utils.checkNotNull(buyerId, "buyerId");
+ this.buyerId = JsonNullable.of(buyerId);
+ return this;
+ }
+
+ /**
+ * The ID of the buyer to associate this gift card to. Only allowed when `store` is `true`. If this
+ * field is provided then the `buyer_external_identifier` field needs to be unset.
+ */
+ public Builder buyerId(JsonNullable buyerId) {
+ Utils.checkNotNull(buyerId, "buyerId");
+ this.buyerId = buyerId;
+ return this;
+ }
+
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ public Builder buyerExternalIdentifier(String buyerExternalIdentifier) {
+ Utils.checkNotNull(buyerExternalIdentifier, "buyerExternalIdentifier");
+ this.buyerExternalIdentifier = JsonNullable.of(buyerExternalIdentifier);
+ return this;
+ }
+
+ /**
+ * The `external_identifier` of the buyer to associate this gift card to. Only allowed when `store` is
+ * `true`. If this field is provided then the `buyer_id` field needs to be unset.
+ */
+ public Builder buyerExternalIdentifier(JsonNullable buyerExternalIdentifier) {
+ Utils.checkNotNull(buyerExternalIdentifier, "buyerExternalIdentifier");
+ this.buyerExternalIdentifier = buyerExternalIdentifier;
+ return this;
+ }
+
public GiftCardActivationCreate build() {
+ if (store == null) {
+ store = _SINGLETON_VALUE_Store.value();
+ }
return new GiftCardActivationCreate(
number, pin, amount,
- currency, externalIdentifier);
+ currency, externalIdentifier, store,
+ buyerId, buyerExternalIdentifier);
}
+
+ private static final LazySingletonValue> _SINGLETON_VALUE_Store =
+ new LazySingletonValue<>(
+ "store",
+ "false",
+ new TypeReference>() {});
}
}