Class AssociateMissingPermissionErrorBuilder
- All Implemented Interfaces:
Builder<AssociateMissingPermissionError>
Example to create an instance using the builder pattern
AssociateMissingPermissionError associateMissingPermissionError = AssociateMissingPermissionError.builder()
.message("{message}")
.associate(associateBuilder -> associateBuilder)
.businessUnit(businessUnitBuilder -> businessUnitBuilder)
.plusPermissions(permissionsBuilder -> permissionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionError-specific additional fields.associate
(CustomerResourceIdentifier associate) ResourceIdentifier to the Associate that tried to perform the action.ResourceIdentifier to the Associate that tried to perform the action.associateOnBehalf
(CustomerResourceIdentifier associateOnBehalf) ResourceIdentifier of the Associate on whose behalf the action is performed.associateOnBehalf
(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifierBuilder> builder) ResourceIdentifier of the Associate on whose behalf the action is performed.build()
builds AssociateMissingPermissionError with checking for non-null required valuesbuilds AssociateMissingPermissionError without checking for non-null required valuesbusinessUnit
(BusinessUnitResourceIdentifier businessUnit) ResourceIdentifier to the BusinessUnit.businessUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) ResourceIdentifier to the BusinessUnit.ResourceIdentifier to the Associate that tried to perform the action.ResourceIdentifier of the Associate on whose behalf the action is performed.ResourceIdentifier to the BusinessUnit.When an action is performed by an Associate:"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'.
The Permissions that the Associate performing the action lacks.Error-specific additional fields.When an action is performed by an Associate:"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'.
of()
factory method for an instance of AssociateMissingPermissionErrorBuilderof
(AssociateMissingPermissionError template) create builder for AssociateMissingPermissionError instancepermissions
(Permission... permissions) The Permissions that the Associate performing the action lacks.permissions
(List<Permission> permissions) The Permissions that the Associate performing the action lacks.plusPermissions
(Permission... permissions) The Permissions that the Associate performing the action lacks.Error-specific additional fields.ResourceIdentifier to the Associate that tried to perform the action.withAssociateOnBehalf
(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifier> builder) ResourceIdentifier of the Associate on whose behalf the action is performed.withBusinessUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) ResourceIdentifier to the BusinessUnit.
-
Constructor Details
-
AssociateMissingPermissionErrorBuilder
public AssociateMissingPermissionErrorBuilder()
-
-
Method Details
-
message
- When an action is performed by an Associate:
"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
- When an action is performed for another Associate, like viewing their Cart:
"Associate '$idOfAssociate' has no rights to $action for customer '$idOfCustomer' in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
- When viewing an entity:
"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredViewMyPermission' or '$requiredViewOthersPermission'."
- Parameters:
message
- value to be set- Returns:
- Builder
- When an action is performed by an Associate:
-
values
Error-specific additional fields.
- Parameters:
values
- properties to be set- Returns:
- Builder
-
addValue
Error-specific additional fields.
- Parameters:
key
- property namevalue
- property value- Returns:
- Builder
-
associate
public AssociateMissingPermissionErrorBuilder associate(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifierBuilder> builder) ResourceIdentifier to the Associate that tried to perform the action.
- Parameters:
builder
- function to build the associate value- Returns:
- Builder
-
withAssociate
public AssociateMissingPermissionErrorBuilder withAssociate(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifier> builder) ResourceIdentifier to the Associate that tried to perform the action.
- Parameters:
builder
- function to build the associate value- Returns:
- Builder
-
associate
ResourceIdentifier to the Associate that tried to perform the action.
- Parameters:
associate
- value to be set- Returns:
- Builder
-
businessUnit
public AssociateMissingPermissionErrorBuilder businessUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) ResourceIdentifier to the BusinessUnit.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
withBusinessUnit
public AssociateMissingPermissionErrorBuilder withBusinessUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) ResourceIdentifier to the BusinessUnit.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
businessUnit
public AssociateMissingPermissionErrorBuilder businessUnit(BusinessUnitResourceIdentifier businessUnit) ResourceIdentifier to the BusinessUnit.
- Parameters:
businessUnit
- value to be set- Returns:
- Builder
-
associateOnBehalf
public AssociateMissingPermissionErrorBuilder associateOnBehalf(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifierBuilder> builder) ResourceIdentifier of the Associate on whose behalf the action is performed.
- Parameters:
builder
- function to build the associateOnBehalf value- Returns:
- Builder
-
withAssociateOnBehalf
public AssociateMissingPermissionErrorBuilder withAssociateOnBehalf(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifier> builder) ResourceIdentifier of the Associate on whose behalf the action is performed.
- Parameters:
builder
- function to build the associateOnBehalf value- Returns:
- Builder
-
associateOnBehalf
public AssociateMissingPermissionErrorBuilder associateOnBehalf(@Nullable CustomerResourceIdentifier associateOnBehalf) ResourceIdentifier of the Associate on whose behalf the action is performed.
- Parameters:
associateOnBehalf
- value to be set- Returns:
- Builder
-
permissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Parameters:
permissions
- value to be set- Returns:
- Builder
-
permissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Parameters:
permissions
- value to be set- Returns:
- Builder
-
plusPermissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Parameters:
permissions
- value to be set- Returns:
- Builder
-
getMessage
- When an action is performed by an Associate:
"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
- When an action is performed for another Associate, like viewing their Cart:
"Associate '$idOfAssociate' has no rights to $action for customer '$idOfCustomer' in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
- When viewing an entity:
"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredViewMyPermission' or '$requiredViewOthersPermission'."
- Returns:
- message
- When an action is performed by an Associate:
-
getValues
Error-specific additional fields.
- Returns:
- pattern properties
-
getAssociate
ResourceIdentifier to the Associate that tried to perform the action.
- Returns:
- associate
-
getBusinessUnit
ResourceIdentifier to the BusinessUnit.
- Returns:
- businessUnit
-
getAssociateOnBehalf
ResourceIdentifier of the Associate on whose behalf the action is performed.
- Returns:
- associateOnBehalf
-
getPermissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Returns:
- permissions
-
build
builds AssociateMissingPermissionError with checking for non-null required values- Specified by:
build
in interfaceBuilder<AssociateMissingPermissionError>
- Returns:
- AssociateMissingPermissionError
-
buildUnchecked
builds AssociateMissingPermissionError without checking for non-null required values- Returns:
- AssociateMissingPermissionError
-
of
factory method for an instance of AssociateMissingPermissionErrorBuilder- Returns:
- builder
-
of
create builder for AssociateMissingPermissionError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-