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 CompanyBuilder
builder for company subtypestatic BusinessUnit
deepCopy
(BusinessUnit template) factory method to create a deep copy of BusinessUnitstatic DivisionBuilder
builder for division subtypeAddresses used by the Business Unit.@NotNull BusinessUnitApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent.@NotNull BusinessUnitAssociateMode
Set toExplicit
to prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParent
to 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 ZonedDateTime
Date and time (UTC) the Business Unit was initially created.@Valid CreatedBy
IDs and references that created the BusinessUnit.@Valid CustomFields
Custom 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 String
getId()
Unique identifier of the Business Unit.@Valid List<InheritedAssociate>
Associates that are inherited from a parent Business Unit.@NotNull String
getKey()
User-defined unique and immutable identifier of the Business Unit.@NotNull ZonedDateTime
Date and time (UTC) the Business Unit was last updated.@Valid LastModifiedBy
IDs and references that last modified the BusinessUnit.@NotNull String
getName()
Name of the Business Unit.@Valid BusinessUnitKeyReference
Parent unit of the Business Unit.Unique identifiers of addresses used as shipping addresses.@NotNull BusinessUnitStatus
Indicates whether the Business Unit can be edited and used in Orders.@NotNull BusinessUnitStoreMode
Defines 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 BusinessUnitKeyReference
Top-level unit of the Business Unit.@NotNull BusinessUnitType
Type of the Business Unit indicating its position in a hierarchy.@NotNull Long
Current version of the Business Unit.void
setAddresses
(Address... addresses) Addresses used by the Business Unit.void
setAddresses
(List<Address> addresses) Addresses used by the Business Unit.void
setApprovalRuleMode
(BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether the Business Unit can inherit Approval Rules from a parent.void
setAssociateMode
(BusinessUnitAssociateMode associateMode) Set toExplicit
to prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParent
to enable inheritance.void
setAssociates
(Associate... associates) Associates that are part of the Business Unit in specific roles.void
setAssociates
(List<Associate> associates) Associates that are part of the Business Unit in specific roles.void
setBillingAddressIds
(String... billingAddressIds) Unique identifiers of addresses used as billing addresses.void
setBillingAddressIds
(List<String> billingAddressIds) Unique identifiers of addresses used as billing addresses.void
setContactEmail
(String contactEmail) Email address of the Business Unit.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Business Unit was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the BusinessUnit.void
setCustom
(CustomFields custom) Custom Fields for the Business Unit.void
setDefaultBillingAddressId
(String defaultBillingAddressId) Unique identifier of the address used as the default billing address.void
setDefaultShippingAddressId
(String defaultShippingAddressId) Unique identifier of the address used as the default shipping address.void
Unique identifier of the Business Unit.void
setInheritedAssociates
(InheritedAssociate... inheritedAssociates) Associates that are inherited from a parent Business Unit.void
setInheritedAssociates
(List<InheritedAssociate> inheritedAssociates) Associates that are inherited from a parent Business Unit.void
User-defined unique and immutable identifier of the Business Unit.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Business Unit was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the BusinessUnit.void
Name of the Business Unit.void
setParentUnit
(BusinessUnitKeyReference parentUnit) Parent unit of the Business Unit.void
setShippingAddressIds
(String... shippingAddressIds) Unique identifiers of addresses used as shipping addresses.void
setShippingAddressIds
(List<String> shippingAddressIds) Unique identifiers of addresses used as shipping addresses.void
setStatus
(BusinessUnitStatus status) Indicates whether the Business Unit can be edited and used in Orders.void
setStoreMode
(BusinessUnitStoreMode storeMode) Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.void
setStores
(StoreKeyReference... stores) References to Stores the Business Unit is associated with.void
setStores
(List<StoreKeyReference> stores) References to Stores the Business Unit is associated with.void
setTopLevelUnit
(BusinessUnitKeyReference topLevelUnit) Top-level unit of the Business Unit.void
setVersion
(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> T
withBusinessUnit
(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:
getId
in interfaceBaseResource
- Returns:
- id
-
getVersion
Current version of the Business Unit.
- Specified by:
getVersion
in interfaceBaseResource
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Business Unit was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Specified by:
getLastModifiedAt
in 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
storeMode
isExplicit
.If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.
- Returns:
- stores
-
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
Explicit
to prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParent
to 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
associateMode
is set toExplicitAndFromParent
.- Returns:
- inheritedAssociates
-
getParentUnit
Parent unit of the Business Unit. Only present when the
unitType
isDivision
.- Returns:
- parentUnit
-
getTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Returns:
- topLevelUnit
-
getApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. Always
Explicit
for Companies and defaults toExplicitAndFromParent
for Divisions.- Returns:
- approvalRuleMode
-
setId
Unique identifier of the Business Unit.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Business Unit.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setCreatedAt
Date and time (UTC) the Business Unit was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Specified by:
setLastModifiedAt
in 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
storeMode
isExplicit
.If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests 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
storeMode
isExplicit
.If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.
If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests 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.
- 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
Explicit
to prevent the Business Unit inheriting Associates from a parent, set toExplicitAndFromParent
to 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
associateMode
is 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
associateMode
is set toExplicitAndFromParent
.- Parameters:
inheritedAssociates
- values to be set
-
setParentUnit
Parent unit of the Business Unit. Only present when the
unitType
isDivision
.- Parameters:
parentUnit
- value to be set
-
setTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Parameters:
topLevelUnit
- value to be set
-
setApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. Always
Explicit
for Companies and defaults toExplicitAndFromParent
for Divisions.- Parameters:
approvalRuleMode
- value to be set
-
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
-