Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Oct 22, 2024
1 parent 32e9d32 commit 3982bb1
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 5 deletions.
7 changes: 7 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
**Api changes**

<details>
<summary>Added Property(s)</summary>

- added property `source` to type `EventBridgeDestination`
</details>


<details>
<summary>Added Method(s)</summary>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* EventBridgeDestination eventBridgeDestination = EventBridgeDestination.builder()
* .region("{region}")
* .accountId("{accountId}")
* .source("{source}")
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -53,6 +54,14 @@ public interface EventBridgeDestination extends Destination {
@JsonProperty("accountId")
public String getAccountId();

/**
* <p>URN for the EventBridge destination.</p>
* @return source
*/
@NotNull
@JsonProperty("source")
public String getSource();

/**
* <p>AWS region that receives the events.</p>
* @param region value to be set
Expand All @@ -67,6 +76,13 @@ public interface EventBridgeDestination extends Destination {

public void setAccountId(final String accountId);

/**
* <p>URN for the EventBridge destination.</p>
* @param source value to be set
*/

public void setSource(final String source);

/**
* factory method
* @return instance of EventBridgeDestination
Expand All @@ -84,6 +100,7 @@ public static EventBridgeDestination of(final EventBridgeDestination template) {
EventBridgeDestinationImpl instance = new EventBridgeDestinationImpl();
instance.setRegion(template.getRegion());
instance.setAccountId(template.getAccountId());
instance.setSource(template.getSource());
return instance;
}

Expand All @@ -100,6 +117,7 @@ public static EventBridgeDestination deepCopy(@Nullable final EventBridgeDestina
EventBridgeDestinationImpl instance = new EventBridgeDestinationImpl();
instance.setRegion(template.getRegion());
instance.setAccountId(template.getAccountId());
instance.setSource(template.getSource());
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* EventBridgeDestination eventBridgeDestination = EventBridgeDestination.builder()
* .region("{region}")
* .accountId("{accountId}")
* .source("{source}")
* .build()
* </code></pre>
* </div>
Expand All @@ -26,6 +27,8 @@ public class EventBridgeDestinationBuilder implements Builder<EventBridgeDestina

private String accountId;

private String source;

/**
* <p>AWS region that receives the events.</p>
* @param region value to be set
Expand All @@ -48,6 +51,17 @@ public EventBridgeDestinationBuilder accountId(final String accountId) {
return this;
}

/**
* <p>URN for the EventBridge destination.</p>
* @param source value to be set
* @return Builder
*/

public EventBridgeDestinationBuilder source(final String source) {
this.source = source;
return this;
}

/**
* <p>AWS region that receives the events.</p>
* @return region
Expand All @@ -66,22 +80,32 @@ public String getAccountId() {
return this.accountId;
}

/**
* <p>URN for the EventBridge destination.</p>
* @return source
*/

public String getSource() {
return this.source;
}

/**
* builds EventBridgeDestination with checking for non-null required values
* @return EventBridgeDestination
*/
public EventBridgeDestination build() {
Objects.requireNonNull(region, EventBridgeDestination.class + ": region is missing");
Objects.requireNonNull(accountId, EventBridgeDestination.class + ": accountId is missing");
return new EventBridgeDestinationImpl(region, accountId);
Objects.requireNonNull(source, EventBridgeDestination.class + ": source is missing");
return new EventBridgeDestinationImpl(region, accountId, source);
}

/**
* builds EventBridgeDestination without checking for non-null required values
* @return EventBridgeDestination
*/
public EventBridgeDestination buildUnchecked() {
return new EventBridgeDestinationImpl(region, accountId);
return new EventBridgeDestinationImpl(region, accountId, source);
}

/**
Expand All @@ -101,6 +125,7 @@ public static EventBridgeDestinationBuilder of(final EventBridgeDestination temp
EventBridgeDestinationBuilder builder = new EventBridgeDestinationBuilder();
builder.region = template.getRegion();
builder.accountId = template.getAccountId();
builder.source = template.getSource();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ public class EventBridgeDestinationImpl implements EventBridgeDestination, Model

private String accountId;

private String source;

/**
* create instance with all properties
*/
@JsonCreator
EventBridgeDestinationImpl(@JsonProperty("region") final String region,
@JsonProperty("accountId") final String accountId) {
@JsonProperty("accountId") final String accountId, @JsonProperty("source") final String source) {
this.region = region;
this.accountId = accountId;
this.source = source;
this.type = EVENT_BRIDGE;
}

Expand Down Expand Up @@ -70,6 +73,14 @@ public String getAccountId() {
return this.accountId;
}

/**
* <p>URN for the EventBridge destination.</p>
*/

public String getSource() {
return this.source;
}

public void setRegion(final String region) {
this.region = region;
}
Expand All @@ -78,6 +89,10 @@ public void setAccountId(final String accountId) {
this.accountId = accountId;
}

public void setSource(final String source) {
this.source = source;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -91,22 +106,25 @@ public boolean equals(Object o) {
return new EqualsBuilder().append(type, that.type)
.append(region, that.region)
.append(accountId, that.accountId)
.append(source, that.source)
.append(type, that.type)
.append(region, that.region)
.append(accountId, that.accountId)
.append(source, that.source)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(type).append(region).append(accountId).toHashCode();
return new HashCodeBuilder(17, 37).append(type).append(region).append(accountId).append(source).toHashCode();
}

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type)
.append("region", region)
.append("accountId", accountId)
.append("source", source)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ public StringComparisonPredicateBuilder<EventBridgeDestinationQueryBuilderDsl> a
p -> new CombinationQueryPredicate<>(p, EventBridgeDestinationQueryBuilderDsl::of));
}

public StringComparisonPredicateBuilder<EventBridgeDestinationQueryBuilderDsl> source() {
return new StringComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("source")),
p -> new CombinationQueryPredicate<>(p, EventBridgeDestinationQueryBuilderDsl::of));

Check warning on line 35 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/subscription/EventBridgeDestinationQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/subscription/EventBridgeDestinationQueryBuilderDsl.java#L33-L35

Added lines #L33 - L35 were not covered by tests
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public void buildUnchecked(EventBridgeDestinationBuilder builder) {
@DataProvider
public static Object[][] objectBuilder() {
return new Object[][] { new Object[] { EventBridgeDestination.builder().region("region") },
new Object[] { EventBridgeDestination.builder().accountId("accountId") } };
new Object[] { EventBridgeDestination.builder().accountId("accountId") },
new Object[] { EventBridgeDestination.builder().source("source") } };
}

@Test
Expand All @@ -41,4 +42,11 @@ public void accountId() {
value.setAccountId("accountId");
Assertions.assertThat(value.getAccountId()).isEqualTo("accountId");
}

@Test
public void source() {
EventBridgeDestination value = EventBridgeDestination.of();
value.setSource("source");
Assertions.assertThat(value.getSource()).isEqualTo("source");
}
}
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,4 @@ e985f4b7aa55610705ee49bd3eb645c2fd03eb6c
c27603f949e869148570ebb8bd3ec6db34a985b7
cac013ef26a2c100979f66df86f605953dd5d736
82bca33a98d14907ea79e2cca281625dd82cdf0d
c8c2455221baca20421082b7715eaa0a712af7f1

0 comments on commit 3982bb1

Please sign in to comment.