Interface BusinessUnit
- All Superinterfaces:
BaseResource,WithKey
Generic type to model the fields that all types of Business Units have in common.
Example to create a subtype instance using the builder pattern
BusinessUnit businessUnit = BusinessUnit.companyBuilder()
id("{id}")
version(0.3)
createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
key("{key}")
status(BusinessUnitStatus.ACTIVE)
storeMode(BusinessUnitStoreMode.EXPLICIT)
name("{name}")
plusAddresses(addressesBuilder -> addressesBuilder)
associateMode(BusinessUnitAssociateMode.EXPLICIT)
plusAssociates(associatesBuilder -> associatesBuilder)
topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompanyBuilderbuilder for company subtypecopyDeep()static BusinessUnitdeepCopy(BusinessUnit template) factory method to create a deep copy of BusinessUnitstatic DivisionBuilderbuilder for division subtypeAddresses used by the Business Unit.@NotNull BusinessUnitApprovalRuleModeDetermines whether the Business Unit can inherit Approval Rules from a parent.@NotNull BusinessUnitAssociateModeSet toExplicitto prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParentto enable inheritance.Associates that are part of the Business Unit in specific roles.Unique identifiers of addresses used as billing addresses.Email address of the Business Unit.@NotNull ZonedDateTimeDate and time (UTC) the Business Unit was initially created.@Valid CreatedByIDs and references that created the BusinessUnit.@Valid CustomFieldsCustom Fields for the Business Unit.Unique identifier of the address used as the default billing address.Unique identifier of the address used as the default shipping address.@NotNull StringgetId()Unique identifier of the Business Unit.@Valid List<InheritedAssociate>Associates that are inherited from a parent Business Unit.@Valid List<StoreKeyReference>Stores that are inherited from a parent Business Unit.@NotNull StringgetKey()User-defined unique and immutable identifier of the Business Unit.@NotNull ZonedDateTimeDate and time (UTC) the Business Unit was last updated.@Valid LastModifiedByIDs and references that last modified the BusinessUnit.@NotNull StringgetName()Name of the Business Unit.@Valid BusinessUnitKeyReferenceParent unit of the Business Unit.Unique identifiers of addresses used as shipping addresses.@NotNull BusinessUnitStatusIndicates whether the Business Unit can be edited and used in Orders.@NotNull BusinessUnitStoreModeDefines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.@Valid List<StoreKeyReference>References to Stores the Business Unit is associated with.@NotNull @Valid BusinessUnitKeyReferenceTop-level unit of the Business Unit.@NotNull BusinessUnitTypeType of the Business Unit indicating its position in a hierarchy.@NotNull LongCurrent version of the Business Unit.voidsetAddresses(Address... addresses) Addresses used by the Business Unit.voidsetAddresses(List<Address> 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) Set toExplicitto prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParentto enable inheritance.voidsetAssociates(Associate... associates) Associates that are part of the Business Unit in specific roles.voidsetAssociates(List<Associate> associates) Associates that are part of the Business Unit in specific roles.voidsetBillingAddressIds(String... billingAddressIds) Unique identifiers of addresses used as billing addresses.voidsetBillingAddressIds(List<String> billingAddressIds) Unique identifiers of addresses used as billing addresses.voidsetContactEmail(String contactEmail) Email address of the Business Unit.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Business Unit was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the BusinessUnit.voidsetCustom(CustomFields custom) Custom Fields for the Business Unit.voidsetDefaultBillingAddressId(String defaultBillingAddressId) Unique identifier of the address used as the default billing address.voidsetDefaultShippingAddressId(String defaultShippingAddressId) Unique identifier of the address used as the default shipping address.voidUnique identifier of the Business Unit.voidsetInheritedAssociates(InheritedAssociate... inheritedAssociates) Associates that are inherited from a parent Business Unit.voidsetInheritedAssociates(List<InheritedAssociate> inheritedAssociates) Associates that are inherited from a parent Business Unit.voidsetInheritedStores(StoreKeyReference... inheritedStores) Stores that are inherited from a parent Business Unit.voidsetInheritedStores(List<StoreKeyReference> inheritedStores) Stores that are inherited from a parent Business Unit.voidUser-defined unique and immutable identifier of the Business Unit.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Business Unit was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the BusinessUnit.voidName of the Business Unit.voidsetParentUnit(BusinessUnitKeyReference parentUnit) Parent unit of the Business Unit.voidsetShippingAddressIds(String... shippingAddressIds) Unique identifiers of addresses used as shipping addresses.voidsetShippingAddressIds(List<String> shippingAddressIds) Unique identifiers of addresses used 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(StoreKeyReference... stores) References to Stores the Business Unit is associated with.voidsetStores(List<StoreKeyReference> stores) References to Stores the Business Unit is associated with.voidsetTopLevelUnit(BusinessUnitKeyReference topLevelUnit) Top-level unit of the Business Unit.voidsetVersion(Long version) Current version of the Business Unit.static com.fasterxml.jackson.core.type.TypeReference<BusinessUnit>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithBusinessUnit(Function<BusinessUnit, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
-
Method Details
-
getId
Unique identifier of the Business Unit.
- Specified by:
getIdin interfaceBaseResource- Returns:
- id
-
getVersion
Current version of the Business Unit.
- Specified by:
getVersionin interfaceBaseResource- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Business Unit was initially created.
- Specified by:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Specified by:
getLastModifiedAtin interfaceBaseResource- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the BusinessUnit.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the BusinessUnit.
- Returns:
- createdBy
-
getKey
User-defined unique and immutable identifier of the Business Unit.
-
getStatus
Indicates whether the Business Unit can be edited and used in Orders.
- Returns:
- status
-
getStores
References to Stores the Business Unit is associated with. Only present when
storeModeisExplicit.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
-
getInheritedStores
Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
storeModeis set toFromParent.- Returns:
- inheritedStores
-
getStoreMode
Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.
- 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
-
getCustom
Custom Fields for the Business Unit.
- Returns:
- custom
-
getAddresses
Addresses used by the Business Unit.
- Returns:
- addresses
-
getShippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Returns:
- shippingAddressIds
-
getDefaultShippingAddressId
String getDefaultShippingAddressId()Unique identifier of the address used as the default shipping address.
- Returns:
- defaultShippingAddressId
-
getBillingAddressIds
Unique identifiers of addresses used as billing addresses.
- Returns:
- billingAddressIds
-
getDefaultBillingAddressId
String getDefaultBillingAddressId()Unique identifier of the address used as the default billing address.
- Returns:
- defaultBillingAddressId
-
getAssociateMode
Set to
Explicitto prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParentto enable inheritance.- Returns:
- associateMode
-
getAssociates
Associates that are part of the Business Unit in specific roles.
- Returns:
- associates
-
getInheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateModeis set toExplicitAndFromParent.- Returns:
- inheritedAssociates
-
getParentUnit
Parent unit of the Business Unit. Only present when the
unitTypeisDivision.- Returns:
- parentUnit
-
getTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitTypeCompany.- Returns:
- topLevelUnit
-
getApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. Always
Explicitfor Companies and defaults toExplicitAndFromParentfor Divisions.- Returns:
- approvalRuleMode
-
setId
Unique identifier of the Business Unit.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Business Unit.
- Specified by:
setVersionin interfaceBaseResource- Parameters:
version- value to be set
-
setCreatedAt
Date and time (UTC) the Business Unit was initially created.
- Specified by:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Specified by:
setLastModifiedAtin interfaceBaseResource- Parameters:
lastModifiedAt- value to be set
-
setLastModifiedBy
IDs and references that last modified the BusinessUnit.
- Parameters:
lastModifiedBy- value to be set
-
setCreatedBy
IDs and references that created the BusinessUnit.
- Parameters:
createdBy- value to be set
-
setKey
User-defined unique and immutable identifier of 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
References to Stores the Business Unit is associated with. Only present when
storeModeisExplicit.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
References to Stores the Business Unit is associated with. Only present when
storeModeisExplicit.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
-
setInheritedStores
Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
storeModeis set toFromParent.- Parameters:
inheritedStores- values to be set
-
setInheritedStores
Stores that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
storeModeis set toFromParent.- Parameters:
inheritedStores- 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.
- 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
-
setCustom
Custom Fields for the Business Unit.
- Parameters:
custom- 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
-
setShippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Parameters:
shippingAddressIds- values to be set
-
setShippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Parameters:
shippingAddressIds- values to be set
-
setDefaultShippingAddressId
Unique identifier of the address used as the default shipping address.
- Parameters:
defaultShippingAddressId- value to be set
-
setBillingAddressIds
Unique identifiers of addresses used as billing addresses.
- Parameters:
billingAddressIds- values to be set
-
setBillingAddressIds
Unique identifiers of addresses used as billing addresses.
- Parameters:
billingAddressIds- values to be set
-
setDefaultBillingAddressId
Unique identifier of the address used as the default billing address.
- Parameters:
defaultBillingAddressId- value to be set
-
setAssociateMode
Set to
Explicitto prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParentto enable inheritance.- Parameters:
associateMode- value to be set
-
setAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
associates- values to be set
-
setAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
associates- values to be set
-
setInheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateModeis set toExplicitAndFromParent.- Parameters:
inheritedAssociates- values to be set
-
setInheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateModeis set toExplicitAndFromParent.- Parameters:
inheritedAssociates- values to be set
-
setParentUnit
Parent unit of the Business Unit. Only present when the
unitTypeisDivision.- Parameters:
parentUnit- value to be set
-
setTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitTypeCompany.- Parameters:
topLevelUnit- value to be set
-
setApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. Always
Explicitfor Companies and defaults toExplicitAndFromParentfor Divisions.- Parameters:
approvalRuleMode- value to be set
-
copyDeep
BusinessUnit copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
deepCopy
factory method to create a deep copy of BusinessUnit- Parameters:
template- instance to be copied- Returns:
- copy instance
-
companyBuilder
builder for company subtype- Returns:
- builder
-
divisionBuilder
builder for division subtype- Returns:
- builder
-
withBusinessUnit
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
-