Interface UnauthorizedError

All Superinterfaces:
ErrorObject

public interface UnauthorizedError extends ErrorObject

Returned when one of the following conditions occurs:

  • A Customer reference (for example, associates[*].customer or inheritedAssociates[*].customer) is expanded on the My Business Unit endpoint.
  • A Cart Discount cannot be modified due to missing permissions for its assigned Stores.

Example to create an instance using the builder pattern

     UnauthorizedError unauthorizedError = UnauthorizedError.builder()
             .message("{message}")
             .build()
 
  • Field Details

  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      "Customer reference expansion not permitted on my business unit" or "Not allowed to edit this CartDiscount."

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getStoresWithoutPermission

      List<String> getStoresWithoutPermission()

      Keys of Stores for which the required permission to modify is missing.

      This field is returned only for Cart Discounts.

      Returns:
      storesWithoutPermission
    • setMessage

      void setMessage(String message)

      "Customer reference expansion not permitted on my business unit" or "Not allowed to edit this CartDiscount."

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setStoresWithoutPermission

      void setStoresWithoutPermission(String... storesWithoutPermission)

      Keys of Stores for which the required permission to modify is missing.

      This field is returned only for Cart Discounts.

      Parameters:
      storesWithoutPermission - values to be set
    • setStoresWithoutPermission

      void setStoresWithoutPermission(List<String> storesWithoutPermission)

      Keys of Stores for which the required permission to modify is missing.

      This field is returned only for Cart Discounts.

      Parameters:
      storesWithoutPermission - values to be set
    • of

      static UnauthorizedError of()
      factory method
      Returns:
      instance of UnauthorizedError
    • of

      static UnauthorizedError of(UnauthorizedError template)
      factory method to create a shallow copy UnauthorizedError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      UnauthorizedError copyDeep()
      Specified by:
      copyDeep in interface ErrorObject
    • deepCopy

      @Nullable static UnauthorizedError deepCopy(@Nullable UnauthorizedError template)
      factory method to create a deep copy of UnauthorizedError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static UnauthorizedErrorBuilder builder()
      builder factory method for UnauthorizedError
      Returns:
      builder
    • builder

      static UnauthorizedErrorBuilder builder(UnauthorizedError template)
      create builder for UnauthorizedError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withUnauthorizedError

      default <T> T withUnauthorizedError(Function<UnauthorizedError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static tools.jackson.core.type.TypeReference<UnauthorizedError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference