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 Jan 11, 2024
1 parent 236d7bc commit 67e7c26
Show file tree
Hide file tree
Showing 26 changed files with 1,169 additions and 15 deletions.
25 changes: 21 additions & 4 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
**Api changes**

<details>
<summary>Added Enum(s)</summary>
<summary>Added Type(s)</summary>

- added enum `associate-role` to type `AttributeReferenceTypeId`
- added enum `business-unit` to type `AttributeReferenceTypeId`
- added enum `cart-discount` to type `AttributeReferenceTypeId`
- added type `ApprovalFlowSetCustomFieldAction`
- added type `ApprovalFlowSetCustomTypeAction`
</details>


Expand All @@ -16,6 +15,24 @@
- :warning: removed type `GraphQLNotEnabledError`
</details>


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

- added property `custom` to type `ApprovalFlow`
</details>


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

- added enum `associate-role` to type `AttributeReferenceTypeId`
- added enum `business-unit` to type `AttributeReferenceTypeId`
- added enum `cart-discount` to type `AttributeReferenceTypeId`
- added enum `approval-flow` to type `CustomFieldReferenceValue`
- added enum `approval-flow` to type `ResourceTypeId`
</details>

**History changes**

<details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ type ApprovalFlow implements Versioned {
eligibleApprovers: [RuleApprover!]!
pendingApprovers: [RuleApprover!]!
currentTierPendingApprovers: [RuleApprover!]!
custom: CustomFieldsType
id: String!
version: Long!
createdAt: DateTime!
Expand Down Expand Up @@ -727,6 +728,8 @@ type ApprovalFlowRejection {
input ApprovalFlowUpdateAction {
approve: ApproveApprovalFlow
reject: RejectApprovalFlow
setCustomField: SetApprovalFlowCustomField
setCustomType: SetApprovalFlowCustomType
}

type ApprovalRule implements Versioned {
Expand Down Expand Up @@ -1796,6 +1799,7 @@ type CartDiscountTotalPriceTarget implements CartDiscountTarget {
input CartDiscountTotalPriceTargetInput {
dummy: String
}

input CartDiscountUpdateAction {
setStores: SetCartDiscountStores
addStore: AddCartDiscountStore
Expand Down Expand Up @@ -9764,6 +9768,18 @@ type SelectionOfProductQueryResult {
"A set."
scalar Set

input SetApprovalFlowCustomField {
name: String!
value: String
}

input SetApprovalFlowCustomType {
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}

input SetApprovalRuleApprovers {
approvers: ApproverHierarchyDraft!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.commercetools.api.models.common.CreatedBy;
import com.commercetools.api.models.common.LastModifiedBy;
import com.commercetools.api.models.order.OrderReference;
import com.commercetools.api.models.type.CustomFields;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

Expand Down Expand Up @@ -178,6 +179,14 @@ public interface ApprovalFlow extends BaseResource {
@JsonProperty("currentTierPendingApprovers")
public List<RuleApprover> getCurrentTierPendingApprovers();

/**
* <p>Custom Fields on the Approval Flow.</p>
* @return custom
*/
@Valid
@JsonProperty("custom")
public CustomFields getCustom();

/**
* <p>Unique identifier of the Approval Flow.</p>
* @param id value to be set
Expand Down Expand Up @@ -323,6 +332,13 @@ public interface ApprovalFlow extends BaseResource {

public void setCurrentTierPendingApprovers(final List<RuleApprover> currentTierPendingApprovers);

/**
* <p>Custom Fields on the Approval Flow.</p>
* @param custom value to be set
*/

public void setCustom(final CustomFields custom);

/**
* factory method
* @return instance of ApprovalFlow
Expand Down Expand Up @@ -353,6 +369,7 @@ public static ApprovalFlow of(final ApprovalFlow template) {
instance.setEligibleApprovers(template.getEligibleApprovers());
instance.setPendingApprovers(template.getPendingApprovers());
instance.setCurrentTierPendingApprovers(template.getCurrentTierPendingApprovers());
instance.setCustom(template.getCustom());
return instance;
}

Expand Down Expand Up @@ -405,6 +422,7 @@ public static ApprovalFlow deepCopy(@Nullable final ApprovalFlow template) {
.map(com.commercetools.api.models.approval_rule.RuleApprover::deepCopy)
.collect(Collectors.toList()))
.orElse(null));
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class ApprovalFlowBuilder implements Builder<ApprovalFlow> {

private java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> currentTierPendingApprovers;

@Nullable
private com.commercetools.api.models.type.CustomFields custom;

/**
* <p>Unique identifier of the Approval Flow.</p>
* @param id value to be set
Expand Down Expand Up @@ -760,6 +763,41 @@ public ApprovalFlowBuilder setCurrentTierPendingApprovers(
builder.apply(com.commercetools.api.models.approval_rule.RuleApproverBuilder.of()));
}

/**
* <p>Custom Fields on the Approval Flow.</p>
* @param builder function to build the custom value
* @return Builder
*/

public ApprovalFlowBuilder custom(
Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFieldsBuilder> builder) {
this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of()).build();
return this;
}

/**
* <p>Custom Fields on the Approval Flow.</p>
* @param builder function to build the custom value
* @return Builder
*/

public ApprovalFlowBuilder withCustom(
Function<com.commercetools.api.models.type.CustomFieldsBuilder, com.commercetools.api.models.type.CustomFields> builder) {
this.custom = builder.apply(com.commercetools.api.models.type.CustomFieldsBuilder.of());
return this;
}

/**
* <p>Custom Fields on the Approval Flow.</p>
* @param custom value to be set
* @return Builder
*/

public ApprovalFlowBuilder custom(@Nullable final com.commercetools.api.models.type.CustomFields custom) {
this.custom = custom;
return this;
}

/**
* <p>Unique identifier of the Approval Flow.</p>
* @return id
Expand Down Expand Up @@ -898,6 +936,16 @@ public java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> g
return this.currentTierPendingApprovers;
}

/**
* <p>Custom Fields on the Approval Flow.</p>
* @return custom
*/

@Nullable
public com.commercetools.api.models.type.CustomFields getCustom() {
return this.custom;
}

/**
* builds ApprovalFlow with checking for non-null required values
* @return ApprovalFlow
Expand All @@ -918,7 +966,7 @@ public ApprovalFlow build() {
ApprovalFlow.class + ": currentTierPendingApprovers is missing");
return new ApprovalFlowImpl(id, version, createdAt, lastModifiedAt, createdBy, lastModifiedBy, order,
businessUnit, rules, status, rejection, approvals, eligibleApprovers, pendingApprovers,
currentTierPendingApprovers);
currentTierPendingApprovers, custom);
}

/**
Expand All @@ -928,7 +976,7 @@ public ApprovalFlow build() {
public ApprovalFlow buildUnchecked() {
return new ApprovalFlowImpl(id, version, createdAt, lastModifiedAt, createdBy, lastModifiedBy, order,
businessUnit, rules, status, rejection, approvals, eligibleApprovers, pendingApprovers,
currentTierPendingApprovers);
currentTierPendingApprovers, custom);
}

/**
Expand Down Expand Up @@ -961,6 +1009,7 @@ public static ApprovalFlowBuilder of(final ApprovalFlow template) {
builder.eligibleApprovers = template.getEligibleApprovers();
builder.pendingApprovers = template.getPendingApprovers();
builder.currentTierPendingApprovers = template.getCurrentTierPendingApprovers();
builder.custom = template.getCustom();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class ApprovalFlowImpl implements ApprovalFlow, ModelBase {

private java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> currentTierPendingApprovers;

private com.commercetools.api.models.type.CustomFields custom;

/**
* create instance with all properties
*/
Expand All @@ -69,7 +71,8 @@ public class ApprovalFlowImpl implements ApprovalFlow, ModelBase {
@JsonProperty("approvals") final java.util.List<com.commercetools.api.models.approval_flow.ApprovalFlowApproval> approvals,
@JsonProperty("eligibleApprovers") final java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> eligibleApprovers,
@JsonProperty("pendingApprovers") final java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> pendingApprovers,
@JsonProperty("currentTierPendingApprovers") final java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> currentTierPendingApprovers) {
@JsonProperty("currentTierPendingApprovers") final java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> currentTierPendingApprovers,
@JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom) {
this.id = id;
this.version = version;
this.createdAt = createdAt;
Expand All @@ -85,6 +88,7 @@ public class ApprovalFlowImpl implements ApprovalFlow, ModelBase {
this.eligibleApprovers = eligibleApprovers;
this.pendingApprovers = pendingApprovers;
this.currentTierPendingApprovers = currentTierPendingApprovers;
this.custom = custom;
}

/**
Expand Down Expand Up @@ -213,6 +217,14 @@ public java.util.List<com.commercetools.api.models.approval_rule.RuleApprover> g
return this.currentTierPendingApprovers;
}

/**
* <p>Custom Fields on the Approval Flow.</p>
*/

public com.commercetools.api.models.type.CustomFields getCustom() {
return this.custom;
}

public void setId(final String id) {
this.id = id;
}
Expand Down Expand Up @@ -300,6 +312,10 @@ public void setCurrentTierPendingApprovers(
this.currentTierPendingApprovers = currentTierPendingApprovers;
}

public void setCustom(final com.commercetools.api.models.type.CustomFields custom) {
this.custom = custom;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -325,6 +341,7 @@ public boolean equals(Object o) {
.append(eligibleApprovers, that.eligibleApprovers)
.append(pendingApprovers, that.pendingApprovers)
.append(currentTierPendingApprovers, that.currentTierPendingApprovers)
.append(custom, that.custom)
.append(id, that.id)
.append(version, that.version)
.append(createdAt, that.createdAt)
Expand All @@ -340,6 +357,7 @@ public boolean equals(Object o) {
.append(eligibleApprovers, that.eligibleApprovers)
.append(pendingApprovers, that.pendingApprovers)
.append(currentTierPendingApprovers, that.currentTierPendingApprovers)
.append(custom, that.custom)
.isEquals();
}

Expand All @@ -360,6 +378,7 @@ public int hashCode() {
.append(eligibleApprovers)
.append(pendingApprovers)
.append(currentTierPendingApprovers)
.append(custom)
.toHashCode();
}

Expand All @@ -380,6 +399,7 @@ public String toString() {
.append("eligibleApprovers", eligibleApprovers)
.append("pendingApprovers", pendingApprovers)
.append("currentTierPendingApprovers", currentTierPendingApprovers)
.append("custom", custom)
.build();
}

Expand Down
Loading

0 comments on commit 67e7c26

Please sign in to comment.