From 505dd2147b2f864e17785f0402588e6eb6d18867 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 18 Oct 2022 09:09:24 +0000 Subject: [PATCH 1/2] TASK: Updating SDK --- .../importapi/models/orders/OrderImport.java | 11 ++++++ .../models/orders/OrderImportBuilder.java | 32 +++++++++++++++-- .../models/orders/OrderImportImpl.java | 20 ++++++++++- .../importapi/models/orders/TaxedPrice.java | 10 ------ .../models/orders/TaxedPriceBuilder.java | 34 ++----------------- .../models/orders/TaxedPriceImpl.java | 25 ++------------ 6 files changed, 64 insertions(+), 68 deletions(-) diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImport.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImport.java index 2b5684e3c4b..a6f4c1e8bf9 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImport.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImport.java @@ -12,6 +12,7 @@ import com.commercetools.importapi.models.common.Address; import com.commercetools.importapi.models.common.CustomerGroupKeyReference; import com.commercetools.importapi.models.common.CustomerKeyReference; +import com.commercetools.importapi.models.common.StoreKeyReference; import com.commercetools.importapi.models.common.TypedMoney; import com.commercetools.importapi.models.customfields.Custom; import com.fasterxml.jackson.annotation.*; @@ -194,6 +195,13 @@ public interface OrderImport { @JsonProperty("itemShippingAddresses") public List
getItemShippingAddresses(); + /** + *

Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

+ */ + @Valid + @JsonProperty("store") + public StoreKeyReference getStore(); + public void setOrderNumber(final String orderNumber); public void setCustomer(final CustomerKeyReference customer); @@ -247,6 +255,8 @@ public interface OrderImport { public void setItemShippingAddresses(final List
itemShippingAddresses); + public void setStore(final StoreKeyReference store); + public static OrderImport of() { return new OrderImportImpl(); } @@ -275,6 +285,7 @@ public static OrderImport of(final OrderImport template) { instance.setTaxCalculationMode(template.getTaxCalculationMode()); instance.setOrigin(template.getOrigin()); instance.setItemShippingAddresses(template.getItemShippingAddresses()); + instance.setStore(template.getStore()); return instance; } diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportBuilder.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportBuilder.java index dd2091378f5..ed17c3cf73e 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportBuilder.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportBuilder.java @@ -89,6 +89,9 @@ public class OrderImportBuilder implements Builder { @Nullable private java.util.List itemShippingAddresses; + @Nullable + private com.commercetools.importapi.models.common.StoreKeyReference store; + /** *

Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

*/ @@ -533,6 +536,25 @@ public OrderImportBuilder withItemShippingAddresses( return this; } + /** + *

Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

+ */ + + public OrderImportBuilder store( + Function builder) { + this.store = builder.apply(com.commercetools.importapi.models.common.StoreKeyReferenceBuilder.of()).build(); + return this; + } + + /** + *

Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

+ */ + + public OrderImportBuilder store(@Nullable final com.commercetools.importapi.models.common.StoreKeyReference store) { + this.store = store; + return this; + } + public String getOrderNumber() { return this.orderNumber; } @@ -641,13 +663,18 @@ public java.util.List getItem return this.itemShippingAddresses; } + @Nullable + public com.commercetools.importapi.models.common.StoreKeyReference getStore() { + return this.store; + } + public OrderImport build() { Objects.requireNonNull(orderNumber, OrderImport.class + ": orderNumber is missing"); Objects.requireNonNull(totalPrice, OrderImport.class + ": totalPrice is missing"); return new OrderImportImpl(orderNumber, customer, customerEmail, lineItems, customLineItems, totalPrice, taxedPrice, shippingAddress, billingAddress, customerGroup, country, orderState, shipmentState, paymentState, shippingInfo, completedAt, custom, inventoryMode, taxRoundingMode, taxCalculationMode, origin, - itemShippingAddresses); + itemShippingAddresses, store); } /** @@ -657,7 +684,7 @@ public OrderImport buildUnchecked() { return new OrderImportImpl(orderNumber, customer, customerEmail, lineItems, customLineItems, totalPrice, taxedPrice, shippingAddress, billingAddress, customerGroup, country, orderState, shipmentState, paymentState, shippingInfo, completedAt, custom, inventoryMode, taxRoundingMode, taxCalculationMode, origin, - itemShippingAddresses); + itemShippingAddresses, store); } public static OrderImportBuilder of() { @@ -688,6 +715,7 @@ public static OrderImportBuilder of(final OrderImport template) { builder.taxCalculationMode = template.getTaxCalculationMode(); builder.origin = template.getOrigin(); builder.itemShippingAddresses = template.getItemShippingAddresses(); + builder.store = template.getStore(); return builder; } diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportImpl.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportImpl.java index c94712ad709..1db40b5e198 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportImpl.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/OrderImportImpl.java @@ -66,6 +66,8 @@ public class OrderImportImpl implements OrderImport, ModelBase { private java.util.List itemShippingAddresses; + private com.commercetools.importapi.models.common.StoreKeyReference store; + @JsonCreator OrderImportImpl(@JsonProperty("orderNumber") final String orderNumber, @JsonProperty("customer") final com.commercetools.importapi.models.common.CustomerKeyReference customer, @@ -88,7 +90,8 @@ public class OrderImportImpl implements OrderImport, ModelBase { @JsonProperty("taxRoundingMode") final com.commercetools.importapi.models.orders.RoundingMode taxRoundingMode, @JsonProperty("taxCalculationMode") final com.commercetools.importapi.models.orders.TaxCalculationMode taxCalculationMode, @JsonProperty("origin") final com.commercetools.importapi.models.orders.CartOrigin origin, - @JsonProperty("itemShippingAddresses") final java.util.List itemShippingAddresses) { + @JsonProperty("itemShippingAddresses") final java.util.List itemShippingAddresses, + @JsonProperty("store") final com.commercetools.importapi.models.common.StoreKeyReference store) { this.orderNumber = orderNumber; this.customer = customer; this.customerEmail = customerEmail; @@ -111,6 +114,7 @@ public class OrderImportImpl implements OrderImport, ModelBase { this.taxCalculationMode = taxCalculationMode; this.origin = origin; this.itemShippingAddresses = itemShippingAddresses; + this.store = store; } public OrderImportImpl() { @@ -292,6 +296,14 @@ public java.util.List getItem return this.itemShippingAddresses; } + /** + *

Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

+ */ + + public com.commercetools.importapi.models.common.StoreKeyReference getStore() { + return this.store; + } + public void setOrderNumber(final String orderNumber) { this.orderNumber = orderNumber; } @@ -399,6 +411,10 @@ public void setItemShippingAddresses( this.itemShippingAddresses = itemShippingAddresses; } + public void setStore(final com.commercetools.importapi.models.common.StoreKeyReference store) { + this.store = store; + } + @Override public boolean equals(Object o) { if (this == o) @@ -431,6 +447,7 @@ public boolean equals(Object o) { .append(taxCalculationMode, that.taxCalculationMode) .append(origin, that.origin) .append(itemShippingAddresses, that.itemShippingAddresses) + .append(store, that.store) .isEquals(); } @@ -458,6 +475,7 @@ public int hashCode() { .append(taxCalculationMode) .append(origin) .append(itemShippingAddresses) + .append(store) .toHashCode(); } diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPrice.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPrice.java index f1c676c06f7..614e1692185 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPrice.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPrice.java @@ -57,13 +57,6 @@ public interface TaxedPrice { @JsonProperty("taxPortions") public List getTaxPortions(); - /** - *

Maps to TaxedPrice.totalTax.

- */ - @Valid - @JsonProperty("totalTax") - public Money getTotalTax(); - public void setTotalNet(final Money totalNet); public void setTotalGross(final Money totalGross); @@ -73,8 +66,6 @@ public interface TaxedPrice { public void setTaxPortions(final List taxPortions); - public void setTotalTax(final Money totalTax); - public static TaxedPrice of() { return new TaxedPriceImpl(); } @@ -84,7 +75,6 @@ public static TaxedPrice of(final TaxedPrice template) { instance.setTotalNet(template.getTotalNet()); instance.setTotalGross(template.getTotalGross()); instance.setTaxPortions(template.getTaxPortions()); - instance.setTotalTax(template.getTotalTax()); return instance; } diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceBuilder.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceBuilder.java index 994cff627a8..e8ab4b2b16b 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceBuilder.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceBuilder.java @@ -4,8 +4,6 @@ import java.util.*; import java.util.function.Function; -import javax.annotation.Nullable; - import io.vrap.rmf.base.client.Builder; import io.vrap.rmf.base.client.utils.Generated; @@ -32,9 +30,6 @@ public class TaxedPriceBuilder implements Builder { private java.util.List taxPortions; - @Nullable - private com.commercetools.importapi.models.common.Money totalTax; - /** *

Maps to TaxedPrice.totalNet.

*/ @@ -129,25 +124,6 @@ public TaxedPriceBuilder withTaxPortions( return this; } - /** - *

Maps to TaxedPrice.totalTax.

- */ - - public TaxedPriceBuilder totalTax( - Function builder) { - this.totalTax = builder.apply(com.commercetools.importapi.models.common.MoneyBuilder.of()).build(); - return this; - } - - /** - *

Maps to TaxedPrice.totalTax.

- */ - - public TaxedPriceBuilder totalTax(@Nullable final com.commercetools.importapi.models.common.Money totalTax) { - this.totalTax = totalTax; - return this; - } - public com.commercetools.importapi.models.common.Money getTotalNet() { return this.totalNet; } @@ -160,23 +136,18 @@ public java.util.List getT return this.taxPortions; } - @Nullable - public com.commercetools.importapi.models.common.Money getTotalTax() { - return this.totalTax; - } - public TaxedPrice build() { Objects.requireNonNull(totalNet, TaxedPrice.class + ": totalNet is missing"); Objects.requireNonNull(totalGross, TaxedPrice.class + ": totalGross is missing"); Objects.requireNonNull(taxPortions, TaxedPrice.class + ": taxPortions is missing"); - return new TaxedPriceImpl(totalNet, totalGross, taxPortions, totalTax); + return new TaxedPriceImpl(totalNet, totalGross, taxPortions); } /** * builds TaxedPrice without checking for non null required values */ public TaxedPrice buildUnchecked() { - return new TaxedPriceImpl(totalNet, totalGross, taxPortions, totalTax); + return new TaxedPriceImpl(totalNet, totalGross, taxPortions); } public static TaxedPriceBuilder of() { @@ -188,7 +159,6 @@ public static TaxedPriceBuilder of(final TaxedPrice template) { builder.totalNet = template.getTotalNet(); builder.totalGross = template.getTotalGross(); builder.taxPortions = template.getTaxPortions(); - builder.totalTax = template.getTotalTax(); return builder; } diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceImpl.java b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceImpl.java index 3f7c8b1bda7..45234c0e1b6 100644 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceImpl.java +++ b/commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/orders/TaxedPriceImpl.java @@ -26,17 +26,13 @@ public class TaxedPriceImpl implements TaxedPrice, ModelBase { private java.util.List taxPortions; - private com.commercetools.importapi.models.common.Money totalTax; - @JsonCreator TaxedPriceImpl(@JsonProperty("totalNet") final com.commercetools.importapi.models.common.Money totalNet, @JsonProperty("totalGross") final com.commercetools.importapi.models.common.Money totalGross, - @JsonProperty("taxPortions") final java.util.List taxPortions, - @JsonProperty("totalTax") final com.commercetools.importapi.models.common.Money totalTax) { + @JsonProperty("taxPortions") final java.util.List taxPortions) { this.totalNet = totalNet; this.totalGross = totalGross; this.taxPortions = taxPortions; - this.totalTax = totalTax; } public TaxedPriceImpl() { @@ -66,14 +62,6 @@ public java.util.List getT return this.taxPortions; } - /** - *

Maps to TaxedPrice.totalTax.

- */ - - public com.commercetools.importapi.models.common.Money getTotalTax() { - return this.totalTax; - } - public void setTotalNet(final com.commercetools.importapi.models.common.Money totalNet) { this.totalNet = totalNet; } @@ -90,10 +78,6 @@ public void setTaxPortions(final java.util.List Date: Fri, 21 Oct 2022 12:15:18 +0000 Subject: [PATCH 2/2] TASK: Updating SDK --- .../subscription/AwsAuthenticationMode.java | 74 +++++++++++++++++++ .../models/subscription/SnsDestination.java | 20 +++-- .../subscription/SnsDestinationBuilder.java | 41 +++++++--- .../subscription/SnsDestinationImpl.java | 25 ++++++- .../models/subscription/SqsDestination.java | 20 +++-- .../subscription/SqsDestinationBuilder.java | 41 +++++++--- .../subscription/SqsDestinationImpl.java | 25 ++++++- 7 files changed, 208 insertions(+), 38 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/AwsAuthenticationMode.java diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/AwsAuthenticationMode.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/AwsAuthenticationMode.java new file mode 100644 index 00000000000..ba277c05637 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/AwsAuthenticationMode.java @@ -0,0 +1,74 @@ + +package com.commercetools.api.models.subscription; + +import java.util.Arrays; +import java.util.Optional; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + *

Defines the method of authentication for AWS SQS and SNS Destinations. Subscriptions with Credentials authentication mode are authenticated using an accessKey and accessSecret pair. Subscriptions with IAM authentication mode are authenticated using Identity and Access Management (IAM). In this case, the user arn:aws:iam::362576667341:user/subscriptions requires permissions to send messages to the queue or publish to the topic. This is the recommended authenticationMode, as it doesn't require additional key management.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface AwsAuthenticationMode { + + AwsAuthenticationMode CREDENTIALS = AwsAuthenticationModeEnum.CREDENTIALS; + + AwsAuthenticationMode IAM = AwsAuthenticationModeEnum.IAM; + + enum AwsAuthenticationModeEnum implements AwsAuthenticationMode { + CREDENTIALS("Credentials"), + + IAM("IAM"); + private final String jsonName; + + private AwsAuthenticationModeEnum(final String jsonName) { + this.jsonName = jsonName; + } + + public String getJsonName() { + return jsonName; + } + + public String toString() { + return jsonName; + } + } + + @JsonValue + String getJsonName(); + + String name(); + + String toString(); + + @JsonCreator + public static AwsAuthenticationMode findEnum(String value) { + return findEnumViaJsonName(value).orElse(new AwsAuthenticationMode() { + @Override + public String getJsonName() { + return value; + } + + @Override + public String name() { + return value.toUpperCase(); + } + + public String toString() { + return value; + } + }); + } + + public static Optional findEnumViaJsonName(String jsonName) { + return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst(); + } + + public static AwsAuthenticationMode[] values() { + return AwsAuthenticationModeEnum.values(); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestination.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestination.java index d7cfb4e3953..a418a39bd6e 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestination.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestination.java @@ -20,8 +20,6 @@ *
*

  *     SnsDestination snsDestination = SnsDestination.builder()
- *             .accessKey("{accessKey}")
- *             .accessSecret("{accessSecret}")
  *             .topicArn("{topicArn}")
  *             .build()
  * 
@@ -34,16 +32,16 @@ public interface SnsDestination extends Destination { String SNS = "SNS"; /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - @NotNull + @JsonProperty("accessKey") public String getAccessKey(); /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - @NotNull + @JsonProperty("accessSecret") public String getAccessSecret(); @@ -54,12 +52,21 @@ public interface SnsDestination extends Destination { @JsonProperty("topicArn") public String getTopicArn(); + /** + *

Defines the method of authentication for the SNS topic.

+ */ + + @JsonProperty("authenticationMode") + public AwsAuthenticationMode getAuthenticationMode(); + public void setAccessKey(final String accessKey); public void setAccessSecret(final String accessSecret); public void setTopicArn(final String topicArn); + public void setAuthenticationMode(final AwsAuthenticationMode authenticationMode); + public static SnsDestination of() { return new SnsDestinationImpl(); } @@ -69,6 +76,7 @@ public static SnsDestination of(final SnsDestination template) { instance.setAccessKey(template.getAccessKey()); instance.setAccessSecret(template.getAccessSecret()); instance.setTopicArn(template.getTopicArn()); + instance.setAuthenticationMode(template.getAuthenticationMode()); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationBuilder.java index 1d0b63115d8..6057b3ec2eb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationBuilder.java @@ -3,6 +3,8 @@ import java.util.*; +import javax.annotation.Nullable; + import io.vrap.rmf.base.client.Builder; import io.vrap.rmf.base.client.utils.Generated; @@ -13,8 +15,6 @@ *
*

  *     SnsDestination snsDestination = SnsDestination.builder()
- *             .accessKey("{accessKey}")
- *             .accessSecret("{accessSecret}")
  *             .topicArn("{topicArn}")
  *             .build()
  * 
@@ -23,26 +23,31 @@ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class SnsDestinationBuilder implements Builder { + @Nullable private String accessKey; + @Nullable private String accessSecret; private String topicArn; + @Nullable + private com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode; + /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - public SnsDestinationBuilder accessKey(final String accessKey) { + public SnsDestinationBuilder accessKey(@Nullable final String accessKey) { this.accessKey = accessKey; return this; } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - public SnsDestinationBuilder accessSecret(final String accessSecret) { + public SnsDestinationBuilder accessSecret(@Nullable final String accessSecret) { this.accessSecret = accessSecret; return this; } @@ -56,10 +61,22 @@ public SnsDestinationBuilder topicArn(final String topicArn) { return this; } + /** + *

Defines the method of authentication for the SNS topic.

+ */ + + public SnsDestinationBuilder authenticationMode( + @Nullable final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { + this.authenticationMode = authenticationMode; + return this; + } + + @Nullable public String getAccessKey() { return this.accessKey; } + @Nullable public String getAccessSecret() { return this.accessSecret; } @@ -68,18 +85,21 @@ public String getTopicArn() { return this.topicArn; } + @Nullable + public com.commercetools.api.models.subscription.AwsAuthenticationMode getAuthenticationMode() { + return this.authenticationMode; + } + public SnsDestination build() { - Objects.requireNonNull(accessKey, SnsDestination.class + ": accessKey is missing"); - Objects.requireNonNull(accessSecret, SnsDestination.class + ": accessSecret is missing"); Objects.requireNonNull(topicArn, SnsDestination.class + ": topicArn is missing"); - return new SnsDestinationImpl(accessKey, accessSecret, topicArn); + return new SnsDestinationImpl(accessKey, accessSecret, topicArn, authenticationMode); } /** * builds SnsDestination without checking for non null required values */ public SnsDestination buildUnchecked() { - return new SnsDestinationImpl(accessKey, accessSecret, topicArn); + return new SnsDestinationImpl(accessKey, accessSecret, topicArn, authenticationMode); } public static SnsDestinationBuilder of() { @@ -91,6 +111,7 @@ public static SnsDestinationBuilder of(final SnsDestination template) { builder.accessKey = template.getAccessKey(); builder.accessSecret = template.getAccessSecret(); builder.topicArn = template.getTopicArn(); + builder.authenticationMode = template.getAuthenticationMode(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationImpl.java index 3584f77cc96..b9397e49c10 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SnsDestinationImpl.java @@ -28,12 +28,16 @@ public class SnsDestinationImpl implements SnsDestination, ModelBase { private String topicArn; + private com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode; + @JsonCreator SnsDestinationImpl(@JsonProperty("accessKey") final String accessKey, - @JsonProperty("accessSecret") final String accessSecret, @JsonProperty("topicArn") final String topicArn) { + @JsonProperty("accessSecret") final String accessSecret, @JsonProperty("topicArn") final String topicArn, + @JsonProperty("authenticationMode") final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { this.accessKey = accessKey; this.accessSecret = accessSecret; this.topicArn = topicArn; + this.authenticationMode = authenticationMode; this.type = SNS; } @@ -50,7 +54,7 @@ public String getType() { } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ public String getAccessKey() { @@ -58,7 +62,7 @@ public String getAccessKey() { } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ public String getAccessSecret() { @@ -73,6 +77,14 @@ public String getTopicArn() { return this.topicArn; } + /** + *

Defines the method of authentication for the SNS topic.

+ */ + + public com.commercetools.api.models.subscription.AwsAuthenticationMode getAuthenticationMode() { + return this.authenticationMode; + } + public void setAccessKey(final String accessKey) { this.accessKey = accessKey; } @@ -85,6 +97,11 @@ public void setTopicArn(final String topicArn) { this.topicArn = topicArn; } + public void setAuthenticationMode( + final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { + this.authenticationMode = authenticationMode; + } + @Override public boolean equals(Object o) { if (this == o) @@ -99,6 +116,7 @@ public boolean equals(Object o) { .append(accessKey, that.accessKey) .append(accessSecret, that.accessSecret) .append(topicArn, that.topicArn) + .append(authenticationMode, that.authenticationMode) .isEquals(); } @@ -108,6 +126,7 @@ public int hashCode() { .append(accessKey) .append(accessSecret) .append(topicArn) + .append(authenticationMode) .toHashCode(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestination.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestination.java index 25570e8ff73..793506c8ee8 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestination.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestination.java @@ -20,8 +20,6 @@ *
*

  *     SqsDestination sqsDestination = SqsDestination.builder()
- *             .accessKey("{accessKey}")
- *             .accessSecret("{accessSecret}")
  *             .queueUrl("{queueUrl}")
  *             .region("{region}")
  *             .build()
@@ -35,16 +33,16 @@ public interface SqsDestination extends Destination {
     String SQS = "SQS";
 
     /**
-     *
+     *  

Only present if authenticationMode is set to Credentials.

*/ - @NotNull + @JsonProperty("accessKey") public String getAccessKey(); /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - @NotNull + @JsonProperty("accessSecret") public String getAccessSecret(); @@ -62,6 +60,13 @@ public interface SqsDestination extends Destination { @JsonProperty("region") public String getRegion(); + /** + *

Defines the method of authentication for the SQS queue.

+ */ + + @JsonProperty("authenticationMode") + public AwsAuthenticationMode getAuthenticationMode(); + public void setAccessKey(final String accessKey); public void setAccessSecret(final String accessSecret); @@ -70,6 +75,8 @@ public interface SqsDestination extends Destination { public void setRegion(final String region); + public void setAuthenticationMode(final AwsAuthenticationMode authenticationMode); + public static SqsDestination of() { return new SqsDestinationImpl(); } @@ -80,6 +87,7 @@ public static SqsDestination of(final SqsDestination template) { instance.setAccessSecret(template.getAccessSecret()); instance.setQueueUrl(template.getQueueUrl()); instance.setRegion(template.getRegion()); + instance.setAuthenticationMode(template.getAuthenticationMode()); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationBuilder.java index 9dbabf9bb4b..77c24f6b49d 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationBuilder.java @@ -3,6 +3,8 @@ import java.util.*; +import javax.annotation.Nullable; + import io.vrap.rmf.base.client.Builder; import io.vrap.rmf.base.client.utils.Generated; @@ -13,8 +15,6 @@ *
*

  *     SqsDestination sqsDestination = SqsDestination.builder()
- *             .accessKey("{accessKey}")
- *             .accessSecret("{accessSecret}")
  *             .queueUrl("{queueUrl}")
  *             .region("{region}")
  *             .build()
@@ -24,28 +24,33 @@
 @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
 public class SqsDestinationBuilder implements Builder {
 
+    @Nullable
     private String accessKey;
 
+    @Nullable
     private String accessSecret;
 
     private String queueUrl;
 
     private String region;
 
+    @Nullable
+    private com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode;
+
     /**
-     *
+     *  

Only present if authenticationMode is set to Credentials.

*/ - public SqsDestinationBuilder accessKey(final String accessKey) { + public SqsDestinationBuilder accessKey(@Nullable final String accessKey) { this.accessKey = accessKey; return this; } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ - public SqsDestinationBuilder accessSecret(final String accessSecret) { + public SqsDestinationBuilder accessSecret(@Nullable final String accessSecret) { this.accessSecret = accessSecret; return this; } @@ -68,10 +73,22 @@ public SqsDestinationBuilder region(final String region) { return this; } + /** + *

Defines the method of authentication for the SQS queue.

+ */ + + public SqsDestinationBuilder authenticationMode( + @Nullable final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { + this.authenticationMode = authenticationMode; + return this; + } + + @Nullable public String getAccessKey() { return this.accessKey; } + @Nullable public String getAccessSecret() { return this.accessSecret; } @@ -84,19 +101,22 @@ public String getRegion() { return this.region; } + @Nullable + public com.commercetools.api.models.subscription.AwsAuthenticationMode getAuthenticationMode() { + return this.authenticationMode; + } + public SqsDestination build() { - Objects.requireNonNull(accessKey, SqsDestination.class + ": accessKey is missing"); - Objects.requireNonNull(accessSecret, SqsDestination.class + ": accessSecret is missing"); Objects.requireNonNull(queueUrl, SqsDestination.class + ": queueUrl is missing"); Objects.requireNonNull(region, SqsDestination.class + ": region is missing"); - return new SqsDestinationImpl(accessKey, accessSecret, queueUrl, region); + return new SqsDestinationImpl(accessKey, accessSecret, queueUrl, region, authenticationMode); } /** * builds SqsDestination without checking for non null required values */ public SqsDestination buildUnchecked() { - return new SqsDestinationImpl(accessKey, accessSecret, queueUrl, region); + return new SqsDestinationImpl(accessKey, accessSecret, queueUrl, region, authenticationMode); } public static SqsDestinationBuilder of() { @@ -109,6 +129,7 @@ public static SqsDestinationBuilder of(final SqsDestination template) { builder.accessSecret = template.getAccessSecret(); builder.queueUrl = template.getQueueUrl(); builder.region = template.getRegion(); + builder.authenticationMode = template.getAuthenticationMode(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationImpl.java index 6acf5e62450..8a2bc01083d 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/subscription/SqsDestinationImpl.java @@ -30,14 +30,18 @@ public class SqsDestinationImpl implements SqsDestination, ModelBase { private String region; + private com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode; + @JsonCreator SqsDestinationImpl(@JsonProperty("accessKey") final String accessKey, @JsonProperty("accessSecret") final String accessSecret, @JsonProperty("queueUrl") final String queueUrl, - @JsonProperty("region") final String region) { + @JsonProperty("region") final String region, + @JsonProperty("authenticationMode") final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { this.accessKey = accessKey; this.accessSecret = accessSecret; this.queueUrl = queueUrl; this.region = region; + this.authenticationMode = authenticationMode; this.type = SQS; } @@ -54,7 +58,7 @@ public String getType() { } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ public String getAccessKey() { @@ -62,7 +66,7 @@ public String getAccessKey() { } /** - * + *

Only present if authenticationMode is set to Credentials.

*/ public String getAccessSecret() { @@ -85,6 +89,14 @@ public String getRegion() { return this.region; } + /** + *

Defines the method of authentication for the SQS queue.

+ */ + + public com.commercetools.api.models.subscription.AwsAuthenticationMode getAuthenticationMode() { + return this.authenticationMode; + } + public void setAccessKey(final String accessKey) { this.accessKey = accessKey; } @@ -101,6 +113,11 @@ public void setRegion(final String region) { this.region = region; } + public void setAuthenticationMode( + final com.commercetools.api.models.subscription.AwsAuthenticationMode authenticationMode) { + this.authenticationMode = authenticationMode; + } + @Override public boolean equals(Object o) { if (this == o) @@ -116,6 +133,7 @@ public boolean equals(Object o) { .append(accessSecret, that.accessSecret) .append(queueUrl, that.queueUrl) .append(region, that.region) + .append(authenticationMode, that.authenticationMode) .isEquals(); } @@ -126,6 +144,7 @@ public int hashCode() { .append(accessSecret) .append(queueUrl) .append(region) + .append(authenticationMode) .toHashCode(); }