Class UnauthorizedErrorBuilder

java.lang.Object
com.commercetools.api.models.error.UnauthorizedErrorBuilder
All Implemented Interfaces:
Builder<UnauthorizedError>

public class UnauthorizedErrorBuilder extends Object implements Builder<UnauthorizedError>
UnauthorizedErrorBuilder
Example to create an instance using the builder pattern

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

    • UnauthorizedErrorBuilder

      public UnauthorizedErrorBuilder()
  • Method Details

    • message

      public UnauthorizedErrorBuilder message(String message)

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

      Parameters:
      message - value to be set
      Returns:
      Builder
    • values

      public UnauthorizedErrorBuilder values(Map<String,Object> values)

      Error-specific additional fields.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public UnauthorizedErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • storesWithoutPermission

      public UnauthorizedErrorBuilder storesWithoutPermission(@Nullable String... storesWithoutPermission)

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

      This field is returned only for Cart Discounts.

      Parameters:
      storesWithoutPermission - value to be set
      Returns:
      Builder
    • storesWithoutPermission

      public UnauthorizedErrorBuilder storesWithoutPermission(@Nullable 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 - value to be set
      Returns:
      Builder
    • plusStoresWithoutPermission

      public UnauthorizedErrorBuilder plusStoresWithoutPermission(@Nullable String... storesWithoutPermission)

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

      This field is returned only for Cart Discounts.

      Parameters:
      storesWithoutPermission - value to be set
      Returns:
      Builder
    • getMessage

      public String getMessage()

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

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getStoresWithoutPermission

      @Nullable public 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
    • build

      public UnauthorizedError build()
      builds UnauthorizedError with checking for non-null required values
      Specified by:
      build in interface Builder<UnauthorizedError>
      Returns:
      UnauthorizedError
    • buildUnchecked

      public UnauthorizedError buildUnchecked()
      builds UnauthorizedError without checking for non-null required values
      Returns:
      UnauthorizedError
    • of

      public static UnauthorizedErrorBuilder of()
      factory method for an instance of UnauthorizedErrorBuilder
      Returns:
      builder
    • of

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