Interface MissingRoleOnChannelError

All Superinterfaces:
ErrorObject

public interface MissingRoleOnChannelError extends ErrorObject

Returned when one of the following states occur:

  • Channel is added or set on a Store with missing Channel roles.
  • Standalone Price references a Channel that does not contain the ProductDistribution role.

The error is returned as a failed response to:

  • Add Distribution Channel, Set Distribution Channel, Add Supply Channel, and Set Supply Channel update actions.
  • Create StandalonePrice request.

Example to create an instance using the builder pattern

     MissingRoleOnChannelError missingRoleOnChannelError = MissingRoleOnChannelError.builder()
             .message("{message}")
             .missingRole(ChannelRoleEnum.INVENTORY_SUPPLY)
             .build()
 
  • Field Details

    • MISSING_ROLE_ON_CHANNEL

      static final String MISSING_ROLE_ON_CHANNEL
      discriminator value for MissingRoleOnChannelError
      See Also:
  • 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()

      "Given channel with $idOrKeyOfChannel does not have the required role $role."

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

      @Valid @Valid ChannelResourceIdentifier getChannel()

      ResourceIdentifier to a given Channel.

      Returns:
      channel
    • getMissingRole

      @NotNull @NotNull ChannelRoleEnum getMissingRole()
      • ProductDistribution for Product Distribution Channels allowed for the Store. Also required for Standalone Prices.
      • InventorySupply for Inventory Supply Channels allowed for the Store.
      Returns:
      missingRole
    • setMessage

      void setMessage(String message)

      "Given channel with $idOrKeyOfChannel does not have the required role $role."

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

      void setChannel(ChannelResourceIdentifier channel)

      ResourceIdentifier to a given Channel.

      Parameters:
      channel - value to be set
    • setMissingRole

      void setMissingRole(ChannelRoleEnum missingRole)
      • ProductDistribution for Product Distribution Channels allowed for the Store. Also required for Standalone Prices.
      • InventorySupply for Inventory Supply Channels allowed for the Store.
      Parameters:
      missingRole - value to be set
    • of

      factory method
      Returns:
      instance of MissingRoleOnChannelError
    • of

      factory method to create a shallow copy MissingRoleOnChannelError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of MissingRoleOnChannelError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for MissingRoleOnChannelError
      Returns:
      builder
    • builder

      create builder for MissingRoleOnChannelError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMissingRoleOnChannelError

      default <T> T withMissingRoleOnChannelError(Function<MissingRoleOnChannelError,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<MissingRoleOnChannelError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference