Skip to content

Commit

Permalink
TASK: Updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Oct 18, 2023
1 parent d6de3fc commit 78b287e
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 104 deletions.
9 changes: 9 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,12 @@
- added method `apiRoot.withProjectKey().attributeGroups().withId().head()`
</details>

**History changes**

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

- :warning: changed property `previousValue` of type `SetNameChange` from type `LocalizedString` to `string`
- :warning: changed property `nextValue` of type `SetNameChange` from type `LocalizedString` to `string`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
import io.vrap.rmf.base.client.utils.Generated;

/**
* SetLocalizedNameChange
* <p>Change triggered by the following update actions:</p>
* <ul>
* <li>Set Name on Discount Codes.</li>
* <li>Set State Name on States.</li>
* <li>Set Name on Stores.</li>
* </ul>
*
* <hr>
* Example to create an instance using the builder pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
* SetLocalizedNameChange
* <p>Change triggered by the following update actions:</p>
* <ul>
* <li>Set Name on Discount Codes.</li>
* <li>Set State Name on States.</li>
* <li>Set Name on Stores.</li>
* </ul>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class SetLocalizedNameChangeImpl implements SetLocalizedNameChange, ModelBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,24 @@
import java.util.function.Function;

import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.commercetools.history.models.common.LocalizedString;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
* <p>Change triggered by the following update actions:</p>
* <ul>
* <li>Set Name on Discount Codes.</li>
* <li>Set State Name on States.</li>
* <li>Set Name on Stores.</li>
* </ul>
* <p>Change triggered by the Set Name update action.</p>
*
* <hr>
* Example to create an instance using the builder pattern
* <div class=code-example>
* <pre><code class='java'>
* SetNameChange setNameChange = SetNameChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .previousValue("{previousValue}")
* .nextValue("{nextValue}")
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -65,18 +58,16 @@ public interface SetNameChange extends Change {
* @return previousValue
*/
@NotNull
@Valid
@JsonProperty("previousValue")
public LocalizedString getPreviousValue();
public String getPreviousValue();

/**
* <p>Value after the change.</p>
* @return nextValue
*/
@NotNull
@Valid
@JsonProperty("nextValue")
public LocalizedString getNextValue();
public String getNextValue();

/**
* set change
Expand All @@ -90,14 +81,14 @@ public interface SetNameChange extends Change {
* @param previousValue value to be set
*/

public void setPreviousValue(final LocalizedString previousValue);
public void setPreviousValue(final String previousValue);

/**
* <p>Value after the change.</p>
* @param nextValue value to be set
*/

public void setNextValue(final LocalizedString nextValue);
public void setNextValue(final String nextValue);

/**
* factory method
Expand Down Expand Up @@ -132,10 +123,8 @@ public static SetNameChange deepCopy(@Nullable final SetNameChange template) {
}
SetNameChangeImpl instance = new SetNameChangeImpl();
instance.setChange(template.getChange());
instance.setPreviousValue(
com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue()));
instance.setNextValue(
com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue()));
instance.setPreviousValue(template.getPreviousValue());
instance.setNextValue(template.getNextValue());
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package com.commercetools.history.models.change;

import java.util.*;
import java.util.function.Function;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
Expand All @@ -15,8 +14,8 @@
* <pre><code class='java'>
* SetNameChange setNameChange = SetNameChange.builder()
* .change("{change}")
* .previousValue(previousValueBuilder -> previousValueBuilder)
* .nextValue(nextValueBuilder -> nextValueBuilder)
* .previousValue("{previousValue}")
* .nextValue("{nextValue}")
* .build()
* </code></pre>
* </div>
Expand All @@ -26,9 +25,9 @@ public class SetNameChangeBuilder implements Builder<SetNameChange> {

private String change;

private com.commercetools.history.models.common.LocalizedString previousValue;
private String previousValue;

private com.commercetools.history.models.common.LocalizedString nextValue;
private String nextValue;

/**
* set the value to the change
Expand All @@ -41,73 +40,24 @@ public SetNameChangeBuilder change(final String change) {
return this;
}

/**
* <p>Value before the change.</p>
* @param builder function to build the previousValue value
* @return Builder
*/

public SetNameChangeBuilder previousValue(
Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedStringBuilder> builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of()).build();
return this;
}

/**
* <p>Value before the change.</p>
* @param builder function to build the previousValue value
* @return Builder
*/

public SetNameChangeBuilder withPreviousValue(
Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedString> builder) {
this.previousValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
return this;
}

/**
* <p>Value before the change.</p>
* @param previousValue value to be set
* @return Builder
*/

public SetNameChangeBuilder previousValue(
final com.commercetools.history.models.common.LocalizedString previousValue) {
public SetNameChangeBuilder previousValue(final String previousValue) {
this.previousValue = previousValue;
return this;
}

/**
* <p>Value after the change.</p>
* @param builder function to build the nextValue value
* @return Builder
*/

public SetNameChangeBuilder nextValue(
Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedStringBuilder> builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of()).build();
return this;
}

/**
* <p>Value after the change.</p>
* @param builder function to build the nextValue value
* @return Builder
*/

public SetNameChangeBuilder withNextValue(
Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedString> builder) {
this.nextValue = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
return this;
}

/**
* <p>Value after the change.</p>
* @param nextValue value to be set
* @return Builder
*/

public SetNameChangeBuilder nextValue(final com.commercetools.history.models.common.LocalizedString nextValue) {
public SetNameChangeBuilder nextValue(final String nextValue) {
this.nextValue = nextValue;
return this;
}
Expand All @@ -126,7 +76,7 @@ public String getChange() {
* @return previousValue
*/

public com.commercetools.history.models.common.LocalizedString getPreviousValue() {
public String getPreviousValue() {
return this.previousValue;
}

Expand All @@ -135,7 +85,7 @@ public com.commercetools.history.models.common.LocalizedString getPreviousValue(
* @return nextValue
*/

public com.commercetools.history.models.common.LocalizedString getNextValue() {
public String getNextValue() {
return this.nextValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
* <p>Change triggered by the following update actions:</p>
* <ul>
* <li>Set Name on Discount Codes.</li>
* <li>Set State Name on States.</li>
* <li>Set Name on Stores.</li>
* </ul>
* <p>Change triggered by the Set Name update action.</p>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class SetNameChangeImpl implements SetNameChange, ModelBase {
Expand All @@ -29,17 +24,17 @@ public class SetNameChangeImpl implements SetNameChange, ModelBase {

private String change;

private com.commercetools.history.models.common.LocalizedString previousValue;
private String previousValue;

private com.commercetools.history.models.common.LocalizedString nextValue;
private String nextValue;

/**
* create instance with all properties
*/
@JsonCreator
SetNameChangeImpl(@JsonProperty("change") final String change,
@JsonProperty("previousValue") final com.commercetools.history.models.common.LocalizedString previousValue,
@JsonProperty("nextValue") final com.commercetools.history.models.common.LocalizedString nextValue) {
@JsonProperty("previousValue") final String previousValue,
@JsonProperty("nextValue") final String nextValue) {
this.change = change;
this.previousValue = previousValue;
this.nextValue = nextValue;
Expand Down Expand Up @@ -73,27 +68,27 @@ public String getChange() {
* <p>Value before the change.</p>
*/

public com.commercetools.history.models.common.LocalizedString getPreviousValue() {
public String getPreviousValue() {
return this.previousValue;
}

/**
* <p>Value after the change.</p>
*/

public com.commercetools.history.models.common.LocalizedString getNextValue() {
public String getNextValue() {
return this.nextValue;
}

public void setChange(final String change) {
this.change = change;
}

public void setPreviousValue(final com.commercetools.history.models.common.LocalizedString previousValue) {
public void setPreviousValue(final String previousValue) {
this.previousValue = previousValue;
}

public void setNextValue(final com.commercetools.history.models.common.LocalizedString nextValue) {
public void setNextValue(final String nextValue) {
this.nextValue = nextValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ public void buildUnchecked(SetNameChangeBuilder builder) {
@DataProvider
public static Object[][] objectBuilder() {
return new Object[][] { new Object[] { SetNameChange.builder().change("change") },
new Object[] { SetNameChange.builder()
.previousValue(new com.commercetools.history.models.common.LocalizedStringImpl()) },
new Object[] { SetNameChange.builder()
.nextValue(new com.commercetools.history.models.common.LocalizedStringImpl()) } };
new Object[] { SetNameChange.builder().previousValue("previousValue") },
new Object[] { SetNameChange.builder().nextValue("nextValue") } };
}

@Test
Expand All @@ -41,16 +39,14 @@ public void change() {
@Test
public void previousValue() {
SetNameChange value = SetNameChange.of();
value.setPreviousValue(new com.commercetools.history.models.common.LocalizedStringImpl());
Assertions.assertThat(value.getPreviousValue())
.isEqualTo(new com.commercetools.history.models.common.LocalizedStringImpl());
value.setPreviousValue("previousValue");
Assertions.assertThat(value.getPreviousValue()).isEqualTo("previousValue");
}

@Test
public void nextValue() {
SetNameChange value = SetNameChange.of();
value.setNextValue(new com.commercetools.history.models.common.LocalizedStringImpl());
Assertions.assertThat(value.getNextValue())
.isEqualTo(new com.commercetools.history.models.common.LocalizedStringImpl());
value.setNextValue("nextValue");
Assertions.assertThat(value.getNextValue()).isEqualTo("nextValue");
}
}
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ c79d63cb4ea031447a5dfeea23dc05bb9398d727
cfb34c1d1b7549d9bfe759d13ca9357646371e72
00ec1791c7297ecf203797bcfe02ebad5c9c9a64
da5022ed759c0ebb3b80c15eb62488c7584dfeba
b25b7cc02df72845f3045528120267d1b6330e0a

0 comments on commit 78b287e

Please sign in to comment.