Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
<details>
<summary>Added Property(s)</summary>

- added property `approvalRuleMode` to type `BusinessUnit`
- added property `approvalRuleMode` to type `BusinessUnitDraft`
- added property `approvalRuleMode` to type `Company`
- added property `approvalRuleMode` to type `CompanyDraft`
- added property `approvalRuleMode` to type `Division`
- added property `approvalRuleMode` to type `DivisionDraft`
- added property `metaTitle` to type `ProductTailoringCreatedMessage`
- added property `metaDescription` to type `ProductTailoringCreatedMessage`
- added property `metaKeywords` to type `ProductTailoringCreatedMessage`
Expand Down Expand Up @@ -101,16 +107,20 @@
<details>
<summary>Added Type(s)</summary>

- added type `BusinessUnitApprovalRuleMode`
- added type `BusinessUnitChangeApprovalRuleModeAction`
- added type `CustomerIndexingProgress`
- added type `CustomerIndexingStatus`
- added type `CustomerPagedSearchResponse`
- added type `CustomerSearchIndexingStatusResponse`
- added type `CustomerSearchRequest`
- added type `CustomerSearchResult`
- added type `BusinessUnitApprovalRuleModeChangedMessage`
- added type `ProductTailoringImageAddedMessage`
- added type `ProductTailoringImagesSetMessage`
- added type `ProductVariantTailoringAddedMessage`
- added type `ProductVariantTailoringRemovedMessage`
- added type `BusinessUnitApprovalRuleModeChangedMessagePayload`
- added type `ProductTailoringImageAddedMessagePayload`
- added type `ProductTailoringImagesSetMessagePayload`
- added type `ProductVariantTailoringAddedMessagePayload`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ type BusinessUnit implements Versioned & ReferenceExpandable {
inheritedStores: [InheritedStore!]
topLevelUnitRef: KeyReference
topLevelUnit: BusinessUnit!
approvalRuleMode: BusinessUnitApprovalRuleMode!
id: String!
version: Long!
createdAt: DateTime!
Expand Down Expand Up @@ -1410,6 +1411,17 @@ type BusinessUnitAddressRemoved implements MessagePayload {
type: String!
}

enum BusinessUnitApprovalRuleMode {
Explicit
ExplicitAndFromParent
}

type BusinessUnitApprovalRuleModeChanged implements MessagePayload {
approvalRuleMode: BusinessUnitApprovalRuleMode!
oldApprovalRuleMode: BusinessUnitApprovalRuleMode
type: String!
}

type BusinessUnitAssociateAdded implements MessagePayload {
associate: Associate!
type: String!
Expand Down Expand Up @@ -1543,6 +1555,7 @@ input BusinessUnitDraft {
stores: [ResourceIdentifierInput!]
associates: [AssociateDraft!]
associateMode: BusinessUnitAssociateMode
approvalRuleMode: BusinessUnitApprovalRuleMode
}

type BusinessUnitNameChanged implements MessagePayload {
Expand Down Expand Up @@ -1646,6 +1659,7 @@ input BusinessUnitUpdateAction {
setStores: SetBusinessUnitStores
setStoreMode: SetBusinessUnitStoreMode
changeAssociateMode: ChangeBusinessUnitAssociateMode
changeApprovalRuleMode: ChangeBusinessUnitApprovalRuleMode
}

input CancelQuoteRequest {
Expand Down Expand Up @@ -2248,6 +2262,10 @@ input ChangeBusinessUnitAddress {
address: AddressInput!
}

input ChangeBusinessUnitApprovalRuleMode {
approvalRuleMode: BusinessUnitApprovalRuleMode!
}

input ChangeBusinessUnitAssociate {
associate: AssociateDraft!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* associateMode(BusinessUnitAssociateMode.EXPLICIT)
* plusAssociates(associatesBuilder -> associatesBuilder)
* topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
* approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
* .build()
* </code></pre>
* </div>
Expand Down Expand Up @@ -252,6 +253,14 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models
@JsonProperty("topLevelUnit")
public BusinessUnitKeyReference getTopLevelUnit();

/**
* <p>Determines whether the Business Unit can inherit Approval Rules from a parent. Always <code>Explicit</code> for Companies and defaults to <code>ExplicitAndFromParent</code> for Divisions.</p>
* @return approvalRuleMode
*/
@NotNull
@JsonProperty("approvalRuleMode")
public BusinessUnitApprovalRuleMode getApprovalRuleMode();

/**
* <p>Unique identifier of the Business Unit.</p>
* @param id value to be set
Expand Down Expand Up @@ -465,6 +474,13 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models

public void setTopLevelUnit(final BusinessUnitKeyReference topLevelUnit);

/**
* <p>Determines whether the Business Unit can inherit Approval Rules from a parent. Always <code>Explicit</code> for Companies and defaults to <code>ExplicitAndFromParent</code> for Divisions.</p>
* @param approvalRuleMode value to be set
*/

public void setApprovalRuleMode(final BusinessUnitApprovalRuleMode approvalRuleMode);

/**
* factory method to create a deep copy of BusinessUnit
* @param template instance to be copied
Expand Down Expand Up @@ -528,6 +544,7 @@ public static BusinessUnit deepCopy(@Nullable final BusinessUnit template) {
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getParentUnit()));
instance.setTopLevelUnit(
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getTopLevelUnit()));
instance.setApprovalRuleMode(template.getApprovalRuleMode());
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

package com.commercetools.api.models.business_unit;

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.JsonEnum;
import io.vrap.rmf.base.client.utils.Generated;

/**
* <p>Determines whether a Business Unit can inherit Approval Rules from a parent. Only Business Units of type <code>Division</code> can use <code>ExplicitAndFromParent</code>.</p>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public interface BusinessUnitApprovalRuleMode extends JsonEnum {

/**
<p>Approval Rules of a Business Unit must be explicitly assigned. The Business Unit cannot inherit Approval Rules from a parent.</p> */
BusinessUnitApprovalRuleMode EXPLICIT = BusinessUnitApprovalRuleModeEnum.EXPLICIT;
/**
<p>Approval Rules of a Business Unit are inherited from a parent and can also be explicitly assigned.</p> */
BusinessUnitApprovalRuleMode EXPLICIT_AND_FROM_PARENT = BusinessUnitApprovalRuleModeEnum.EXPLICIT_AND_FROM_PARENT;

/**
* possible values of BusinessUnitApprovalRuleMode
*/
enum BusinessUnitApprovalRuleModeEnum implements BusinessUnitApprovalRuleMode {
/**
* Explicit
*/
EXPLICIT("Explicit"),

/**
* ExplicitAndFromParent
*/
EXPLICIT_AND_FROM_PARENT("ExplicitAndFromParent");
private final String jsonName;

private BusinessUnitApprovalRuleModeEnum(final String jsonName) {
this.jsonName = jsonName;
}

public String getJsonName() {
return jsonName;
}

public String toString() {
return jsonName;
}
}

/**
* the JSON value
* @return json value
*/
@JsonValue
String getJsonName();

/**
* the enum value
* @return name
*/
String name();

/**
* convert value to string
* @return string representation
*/
String toString();

/**
* factory method for a enum value of BusinessUnitApprovalRuleMode
* if no enum has been found an anonymous instance will be created
* @param value the enum value to be wrapped
* @return enum instance
*/
@JsonCreator
public static BusinessUnitApprovalRuleMode findEnum(String value) {
return findEnumViaJsonName(value).orElse(new BusinessUnitApprovalRuleMode() {
@Override
public String getJsonName() {
return value;
}

@Override
public String name() {
return value.toUpperCase();
}

public String toString() {
return value;
}
});
}

/**
* method to find enum using the JSON value
* @param jsonName the json value to be wrapped
* @return optional of enum instance
*/
public static Optional<BusinessUnitApprovalRuleMode> findEnumViaJsonName(String jsonName) {
return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst();
}

/**
* possible enum values
* @return array of possible enum values
*/
public static BusinessUnitApprovalRuleMode[] values() {
return BusinessUnitApprovalRuleModeEnum.values();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

package com.commercetools.api.models.business_unit;

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

import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

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

import jakarta.validation.constraints.NotNull;

/**
* <p>Updates Approval Rules inheritance behavior between Business Units.</p>
* <p>Only Business Units of type <code>Division</code> can be changed to <code>ExplicitAndFromParent</code>.</p>
* <p>This update action generates a BusinessUnitApprovalRuleModeChanged Message.</p>
*
* <hr>
* Example to create an instance using the builder pattern
* <div class=code-example>
* <pre><code class='java'>
* BusinessUnitChangeApprovalRuleModeAction businessUnitChangeApprovalRuleModeAction = BusinessUnitChangeApprovalRuleModeAction.builder()
* .approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
* .build()
* </code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@JsonDeserialize(as = BusinessUnitChangeApprovalRuleModeActionImpl.class)
public interface BusinessUnitChangeApprovalRuleModeAction extends BusinessUnitUpdateAction {

/**
* discriminator value for BusinessUnitChangeApprovalRuleModeAction
*/
String CHANGE_APPROVAL_RULE_MODE = "changeApprovalRuleMode";

/**
* <p>The new value for <code>approvalRuleMode</code>.</p>
* @return approvalRuleMode
*/
@NotNull
@JsonProperty("approvalRuleMode")
public BusinessUnitApprovalRuleMode getApprovalRuleMode();

/**
* <p>The new value for <code>approvalRuleMode</code>.</p>
* @param approvalRuleMode value to be set
*/

public void setApprovalRuleMode(final BusinessUnitApprovalRuleMode approvalRuleMode);

/**
* factory method
* @return instance of BusinessUnitChangeApprovalRuleModeAction
*/
public static BusinessUnitChangeApprovalRuleModeAction of() {
return new BusinessUnitChangeApprovalRuleModeActionImpl();
}

/**
* factory method to create a shallow copy BusinessUnitChangeApprovalRuleModeAction
* @param template instance to be copied
* @return copy instance
*/
public static BusinessUnitChangeApprovalRuleModeAction of(final BusinessUnitChangeApprovalRuleModeAction template) {
BusinessUnitChangeApprovalRuleModeActionImpl instance = new BusinessUnitChangeApprovalRuleModeActionImpl();
instance.setApprovalRuleMode(template.getApprovalRuleMode());
return instance;
}

/**
* factory method to create a deep copy of BusinessUnitChangeApprovalRuleModeAction
* @param template instance to be copied
* @return copy instance
*/
@Nullable
public static BusinessUnitChangeApprovalRuleModeAction deepCopy(
@Nullable final BusinessUnitChangeApprovalRuleModeAction template) {
if (template == null) {
return null;
}
BusinessUnitChangeApprovalRuleModeActionImpl instance = new BusinessUnitChangeApprovalRuleModeActionImpl();
instance.setApprovalRuleMode(template.getApprovalRuleMode());
return instance;
}

/**
* builder factory method for BusinessUnitChangeApprovalRuleModeAction
* @return builder
*/
public static BusinessUnitChangeApprovalRuleModeActionBuilder builder() {
return BusinessUnitChangeApprovalRuleModeActionBuilder.of();
}

/**
* create builder for BusinessUnitChangeApprovalRuleModeAction instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static BusinessUnitChangeApprovalRuleModeActionBuilder builder(
final BusinessUnitChangeApprovalRuleModeAction template) {
return BusinessUnitChangeApprovalRuleModeActionBuilder.of(template);
}

/**
* accessor map function
* @param <T> mapped type
* @param helper function to map the object
* @return mapped value
*/
default <T> T withBusinessUnitChangeApprovalRuleModeAction(
Function<BusinessUnitChangeApprovalRuleModeAction, T> helper) {
return helper.apply(this);
}

/**
* gives a TypeReference for usage with Jackson DataBind
* @return TypeReference
*/
public static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitChangeApprovalRuleModeAction> typeReference() {
return new com.fasterxml.jackson.core.type.TypeReference<BusinessUnitChangeApprovalRuleModeAction>() {
@Override
public String toString() {
return "TypeReference<BusinessUnitChangeApprovalRuleModeAction>";
}
};
}
}
Loading