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
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for AssociateMissingPermissionError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for AssociateMissingPermissionErrorbuilder(AssociateMissingPermissionError template) create builder for AssociateMissingPermissionError instancecopyDeep()deepCopy(AssociateMissingPermissionError template) factory method to create a deep copy of AssociateMissingPermissionError@NotNull @Valid CustomerResourceIdentifierResourceIdentifier to the Associate that tried to perform the action.@Valid CustomerResourceIdentifierResourceIdentifier of the Associate on whose behalf the action is performed.@NotNull @Valid BusinessUnitResourceIdentifierResourceIdentifier to the BusinessUnit.@NotNull StringgetCode()Error identifier.@NotNull StringWhen 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 AssociateMissingPermissionErrorvoidsetAssociate(CustomerResourceIdentifier associate) ResourceIdentifier to the Associate that tried to perform the action.voidsetAssociateOnBehalf(CustomerResourceIdentifier associateOnBehalf) ResourceIdentifier of the Associate on whose behalf the action is performed.voidsetBusinessUnit(BusinessUnitResourceIdentifier businessUnit) ResourceIdentifier to the BusinessUnit.voidsetMessage(String message) When an action is performed by an Associate:"Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'.voidsetPermissions(Permission... permissions) The Permissions that the Associate performing the action lacks.voidsetPermissions(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> Taccessor 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:ErrorObjectError identifier.
- Specified by:
getCodein 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:
getMessagein 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:
setMessagein 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
-
copyDeep
AssociateMissingPermissionError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
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
-