Interface ApprovalRule

All Superinterfaces:
BaseResource

public interface ApprovalRule extends BaseResource
ApprovalRule
Example to create an instance using the builder pattern

     ApprovalRule approvalRule = ApprovalRule.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .name("{name}")
             .status(ApprovalRuleStatus.ACTIVE)
             .predicate("{predicate}")
             .approvers(approversBuilder -> approversBuilder)
             .plusRequesters(requestersBuilder -> requestersBuilder)
             .businessUnit(businessUnitBuilder -> businessUnitBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Approval Rule.

      Specified by:
      getId in interface BaseResource
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Approval Rule.

      Specified by:
      getVersion in interface BaseResource
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Approval Rule was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the ApprovalRule.

      Returns:
      createdBy
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Approval Rule was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the ApprovalRule.

      Returns:
      lastModifiedBy
    • getKey

      String getKey()

      User-defined unique identifier of the Approval Rule. Must be unique within a Business Unit.

      Returns:
      key
    • getName

      @NotNull @NotNull String getName()

      Name of the Approval Rule.

      Returns:
      name
    • getDescription

      String getDescription()

      Description of the Approval Rule.

      Returns:
      description
    • getStatus

      @NotNull @NotNull ApprovalRuleStatus getStatus()

      Indicates whether the Approval Rule should be matched against Orders or not.

      Returns:
      status
    • getPredicate

      @NotNull @NotNull String getPredicate()

      The Order Predicate describing the Orders the Approval Rule should match against.

      Returns:
      predicate
    • getApprovers

      @NotNull @Valid @NotNull @Valid ApproverHierarchy getApprovers()

      The hierarchy of approvers within the Approval Rule.

      Returns:
      approvers
    • getRequesters

      @NotNull @Valid @NotNull @Valid List<RuleRequester> getRequesters()

      The Associate Roles customers must hold for their Order to require approval.

      Returns:
      requesters
    • getBusinessUnit

      @NotNull @Valid @NotNull @Valid BusinessUnitKeyReference getBusinessUnit()

      The Business Unit the Approval Rule belongs to.

      Returns:
      businessUnit
    • setId

      void setId(String id)

      Unique identifier of the Approval Rule.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Approval Rule.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Approval Rule was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the ApprovalRule.

      Parameters:
      createdBy - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Approval Rule was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the ApprovalRule.

      Parameters:
      lastModifiedBy - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Approval Rule. Must be unique within a Business Unit.

      Parameters:
      key - value to be set
    • setName

      void setName(String name)

      Name of the Approval Rule.

      Parameters:
      name - value to be set
    • setDescription

      void setDescription(String description)

      Description of the Approval Rule.

      Parameters:
      description - value to be set
    • setStatus

      void setStatus(ApprovalRuleStatus status)

      Indicates whether the Approval Rule should be matched against Orders or not.

      Parameters:
      status - value to be set
    • setPredicate

      void setPredicate(String predicate)

      The Order Predicate describing the Orders the Approval Rule should match against.

      Parameters:
      predicate - value to be set
    • setApprovers

      void setApprovers(ApproverHierarchy approvers)

      The hierarchy of approvers within the Approval Rule.

      Parameters:
      approvers - value to be set
    • setRequesters

      void setRequesters(RuleRequester... requesters)

      The Associate Roles customers must hold for their Order to require approval.

      Parameters:
      requesters - values to be set
    • setRequesters

      void setRequesters(List<RuleRequester> requesters)

      The Associate Roles customers must hold for their Order to require approval.

      Parameters:
      requesters - values to be set
    • setBusinessUnit

      void setBusinessUnit(BusinessUnitKeyReference businessUnit)

      The Business Unit the Approval Rule belongs to.

      Parameters:
      businessUnit - value to be set
    • of

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

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

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

      static ApprovalRuleBuilder builder()
      builder factory method for ApprovalRule
      Returns:
      builder
    • builder

      static ApprovalRuleBuilder builder(ApprovalRule template)
      create builder for ApprovalRule instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withApprovalRule

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