Interface BusinessUnitDraft
- All Superinterfaces:
WithKey
- All Known Subinterfaces:
CompanyDraft,DivisionDraft
Generic draft type to model those fields all Business Units have in common. The additional fields required for creating a Company or Division are represented on CompanyDraft and DivisionDraft.
Example to create a subtype instance using the builder pattern
BusinessUnitDraft businessUnitDraft = BusinessUnitDraft.companyBuilder()
key("{key}")
name("{name}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompanyDraftBuilderbuilder for company subtypecopyDeep()static BusinessUnitDraftdeepCopy(BusinessUnitDraft template) factory method to create a deep copy of BusinessUnitDraftstatic DivisionDraftBuilderbuilder for division subtype@Valid List<BaseAddress>Addresses used by the Business Unit.Determines whether the Business Unit can inherit Approval Rules from a parent.Determines whether the Business Unit can inherit Associates from a parent.@Valid List<AssociateDraft>List of members that are part of the Business Unit in specific roles.Indexes of entries inaddressesto set as billing addresses.Email address of the Business Unit.@Valid CustomFieldsDraftCustom Fields for the Business Unit.Index of the entry inaddressesto set as the default billing address.Index of the entry inaddressesto set as the default shipping address.@NotNull StringgetKey()User-defined unique and immutable identifier for the Business Unit.@NotNull StringgetName()Name of the Business Unit.Indexes of entries inaddressesto set as shipping addresses.Indicates whether the Business Unit can be edited and used in Orders.Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.@Valid List<StoreResourceIdentifier>Sets the Stores the Business Unit is associated with.@NotNull BusinessUnitTypeType of the Business Unit indicating its position in a hierarchy.voidsetAddresses(BaseAddress... addresses) Addresses used by the Business Unit.voidsetAddresses(List<BaseAddress> addresses) Addresses used by the Business Unit.voidsetApprovalRuleMode(BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether the Business Unit can inherit Approval Rules from a parent.voidsetAssociateMode(BusinessUnitAssociateMode associateMode) Determines whether the Business Unit can inherit Associates from a parent.voidsetAssociates(AssociateDraft... associates) List of members that are part of the Business Unit in specific roles.voidsetAssociates(List<AssociateDraft> associates) List of members that are part of the Business Unit in specific roles.voidsetBillingAddresses(Integer... billingAddresses) Indexes of entries inaddressesto set as billing addresses.voidsetBillingAddresses(List<Integer> billingAddresses) Indexes of entries inaddressesto set as billing addresses.voidsetContactEmail(String contactEmail) Email address of the Business Unit.voidsetCustom(CustomFieldsDraft custom) Custom Fields for the Business Unit.voidsetDefaultBillingAddress(Integer defaultBillingAddress) Index of the entry inaddressesto set as the default billing address.voidsetDefaultShippingAddress(Integer defaultShippingAddress) Index of the entry inaddressesto set as the default shipping address.voidUser-defined unique and immutable identifier for the Business Unit.voidName of the Business Unit.voidsetShippingAddresses(Integer... shippingAddresses) Indexes of entries inaddressesto set as shipping addresses.voidsetShippingAddresses(List<Integer> shippingAddresses) Indexes of entries inaddressesto set as shipping addresses.voidsetStatus(BusinessUnitStatus status) Indicates whether the Business Unit can be edited and used in Orders.voidsetStoreMode(BusinessUnitStoreMode storeMode) Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.voidsetStores(StoreResourceIdentifier... stores) Sets the Stores the Business Unit is associated with.voidsetStores(List<StoreResourceIdentifier> stores) Sets the Stores the Business Unit is associated with.static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithBusinessUnitDraft(Function<BusinessUnitDraft, T> helper) accessor map function
-
Method Details
-
getKey
User-defined unique and immutable identifier for the Business Unit.
-
getStatus
BusinessUnitStatus getStatus()Indicates whether the Business Unit can be edited and used in Orders.
- Returns:
- status
-
getStores
Sets the Stores the Business Unit is associated with. Can only be set when
storeModeisExplicit. Defaults to empty for Companies and not set for Divisions.If the Business Unit has Stores defined, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must not belong to any Store.
- Returns:
- stores
-
getStoreMode
BusinessUnitStoreMode getStoreMode()Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.
storeModeis alwaysExplicitfor Companies and defaults toFromParentfor Divisions.- Returns:
- storeMode
-
getUnitType
Type of the Business Unit indicating its position in a hierarchy.
- Returns:
- unitType
-
getName
Name of the Business Unit.
- Returns:
- name
-
getContactEmail
String getContactEmail()Email address of the Business Unit.
- Returns:
- contactEmail
-
getAssociateMode
BusinessUnitAssociateMode getAssociateMode()Determines whether the Business Unit can inherit Associates from a parent. Always
Explicitfor Companies and defaults toExplicitAndFromParentfor Divisions.- Returns:
- associateMode
-
getAssociates
List of members that are part of the Business Unit in specific roles.
- Returns:
- associates
-
getApprovalRuleMode
BusinessUnitApprovalRuleMode getApprovalRuleMode()Determines whether the Business Unit can inherit Approval Rules from a parent. For Companies, the value of this field is always
Explicit. For Divisions, the default value isExplicitAndFromParent.- Returns:
- approvalRuleMode
-
getAddresses
Addresses used by the Business Unit.
- Returns:
- addresses
-
getShippingAddresses
Indexes of entries in
addressesto set as shipping addresses. TheshippingAddressIdsof the Customer will be replaced by these addresses.- Returns:
- shippingAddresses
-
getDefaultShippingAddress
Integer getDefaultShippingAddress()Index of the entry in
addressesto set as the default shipping address.- Returns:
- defaultShippingAddress
-
getBillingAddresses
Indexes of entries in
addressesto set as billing addresses. ThebillingAddressIdsof the Customer will be replaced by these addresses.- Returns:
- billingAddresses
-
getDefaultBillingAddress
Integer getDefaultBillingAddress()Index of the entry in
addressesto set as the default billing address.- Returns:
- defaultBillingAddress
-
getCustom
Custom Fields for the Business Unit.
- Returns:
- custom
-
setKey
User-defined unique and immutable identifier for the Business Unit.
- Parameters:
key- value to be set
-
setStatus
Indicates whether the Business Unit can be edited and used in Orders.
- Parameters:
status- value to be set
-
setStores
Sets the Stores the Business Unit is associated with. Can only be set when
storeModeisExplicit. Defaults to empty for Companies and not set for Divisions.If the Business Unit has Stores defined, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must not belong to any Store.
- Parameters:
stores- values to be set
-
setStores
Sets the Stores the Business Unit is associated with. Can only be set when
storeModeisExplicit. Defaults to empty for Companies and not set for Divisions.If the Business Unit has Stores defined, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Recurring Orders, Quotes, Quote Requests, or Shopping Lists must not belong to any Store.
- Parameters:
stores- values to be set
-
setStoreMode
Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.
storeModeis alwaysExplicitfor Companies and defaults toFromParentfor Divisions.- Parameters:
storeMode- value to be set
-
setName
Name of the Business Unit.
- Parameters:
name- value to be set
-
setContactEmail
Email address of the Business Unit.
- Parameters:
contactEmail- value to be set
-
setAssociateMode
Determines whether the Business Unit can inherit Associates from a parent. Always
Explicitfor Companies and defaults toExplicitAndFromParentfor Divisions.- Parameters:
associateMode- value to be set
-
setAssociates
List of members that are part of the Business Unit in specific roles.
- Parameters:
associates- values to be set
-
setAssociates
List of members that are part of the Business Unit in specific roles.
- Parameters:
associates- values to be set
-
setApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. For Companies, the value of this field is always
Explicit. For Divisions, the default value isExplicitAndFromParent.- Parameters:
approvalRuleMode- value to be set
-
setAddresses
Addresses used by the Business Unit.
- Parameters:
addresses- values to be set
-
setAddresses
Addresses used by the Business Unit.
- Parameters:
addresses- values to be set
-
setShippingAddresses
Indexes of entries in
addressesto set as shipping addresses. TheshippingAddressIdsof the Customer will be replaced by these addresses.- Parameters:
shippingAddresses- values to be set
-
setShippingAddresses
Indexes of entries in
addressesto set as shipping addresses. TheshippingAddressIdsof the Customer will be replaced by these addresses.- Parameters:
shippingAddresses- values to be set
-
setDefaultShippingAddress
Index of the entry in
addressesto set as the default shipping address.- Parameters:
defaultShippingAddress- value to be set
-
setBillingAddresses
Indexes of entries in
addressesto set as billing addresses. ThebillingAddressIdsof the Customer will be replaced by these addresses.- Parameters:
billingAddresses- values to be set
-
setBillingAddresses
Indexes of entries in
addressesto set as billing addresses. ThebillingAddressIdsof the Customer will be replaced by these addresses.- Parameters:
billingAddresses- values to be set
-
setDefaultBillingAddress
Index of the entry in
addressesto set as the default billing address.- Parameters:
defaultBillingAddress- value to be set
-
setCustom
Custom Fields for the Business Unit.
- Parameters:
custom- value to be set
-
copyDeep
BusinessUnitDraft copyDeep() -
deepCopy
factory method to create a deep copy of BusinessUnitDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
companyBuilder
builder for company subtype- Returns:
- builder
-
divisionBuilder
builder for division subtype- Returns:
- builder
-
withBusinessUnitDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-