Interface AssociateMissingPermissionError
- All Superinterfaces:
ErrorObject
Returned when an Associate is missing a Permission on a B2B resource.
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()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for AssociateMissingPermissionError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for AssociateMissingPermissionErrorbuilder
(AssociateMissingPermissionError template) create builder for AssociateMissingPermissionError instancedeepCopy
(AssociateMissingPermissionError template) factory method to create a deep copy of AssociateMissingPermissionError@NotNull @Valid CustomerResourceIdentifier
ResourceIdentifier to the Associate that tried to perform the action.@Valid CustomerResourceIdentifier
ResourceIdentifier of the Associate on whose behalf the action is performed.@NotNull @Valid BusinessUnitResourceIdentifier
ResourceIdentifier to the BusinessUnit.@NotNull String
getCode()
Error identifier.@NotNull String
When an action is performed by an Associate:"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'.
@NotNull List<Permission>
The Permissions that the Associate performing the action lacks.of()
factory methodof
(AssociateMissingPermissionError template) factory method to create a shallow copy AssociateMissingPermissionErrorvoid
setAssociate
(CustomerResourceIdentifier associate) ResourceIdentifier to the Associate that tried to perform the action.void
setAssociateOnBehalf
(CustomerResourceIdentifier associateOnBehalf) ResourceIdentifier of the Associate on whose behalf the action is performed.void
setBusinessUnit
(BusinessUnitResourceIdentifier businessUnit) ResourceIdentifier to the BusinessUnit.void
setMessage
(String message) When an action is performed by an Associate:"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'.
void
setPermissions
(Permission... permissions) The Permissions that the Associate performing the action lacks.void
setPermissions
(List<Permission> permissions) The Permissions that the Associate performing the action lacks.static com.fasterxml.jackson.core.type.TypeReference<AssociateMissingPermissionError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
ASSOCIATE_MISSING_PERMISSION
discriminator value for AssociateMissingPermissionError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
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'."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
- When an action is performed by an Associate:
-
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
-
setMessage
- 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'."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
- When an action is performed by an Associate:
-
setAssociate
ResourceIdentifier to the Associate that tried to perform the action.
- Parameters:
associate
- value to be set
-
setBusinessUnit
ResourceIdentifier to the BusinessUnit.
- Parameters:
businessUnit
- value to be set
-
setAssociateOnBehalf
ResourceIdentifier of the Associate on whose behalf the action is performed.
- Parameters:
associateOnBehalf
- value to be set
-
setPermissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Parameters:
permissions
- values to be set
-
setPermissions
The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.
- Parameters:
permissions
- values to be set
-
of
factory method- Returns:
- instance of AssociateMissingPermissionError
-
of
factory method to create a shallow copy AssociateMissingPermissionError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static AssociateMissingPermissionError deepCopy(@Nullable AssociateMissingPermissionError template) factory method to create a deep copy of AssociateMissingPermissionError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for AssociateMissingPermissionError- Returns:
- builder
-
builder
create builder for AssociateMissingPermissionError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withAssociateMissingPermissionError
default <T> T withAssociateMissingPermissionError(Function<AssociateMissingPermissionError, T> helper) accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<AssociateMissingPermissionError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-