001package com.box.sdk;
002
003/**
004 * Defines the role of the signer in the sign request. Signers will need to sign the document,
005 * Approvers may just approve the document. Finally, FinalCopyReader will only receive the finished
006 * sign request with a sign log.
007 */
008public enum BoxSignRequestSignerRole {
009
010  /** Signer role. Needs to sign the document. */
011  Signer("signer"),
012
013  /** Approver role. Approves the document. */
014  Approver("approver"),
015
016  /** Final copy reader role. Receives finished sign request with sign log. */
017  FinalCopyReader("final_copy_reader");
018
019  private final String jsonValue;
020
021  BoxSignRequestSignerRole(String jsonValue) {
022    this.jsonValue = jsonValue;
023  }
024
025  static BoxSignRequestSignerRole fromJSONString(String jsonValue) {
026    if ("signer".equals(jsonValue)) {
027      return Signer;
028    } else if ("approver".equals(jsonValue)) {
029      return Approver;
030    } else if ("final_copy_reader".equals(jsonValue)) {
031      return FinalCopyReader;
032    }
033    throw new IllegalArgumentException(
034        "The provided JSON value isn't a valid BoxSignRequestSignerRole.");
035  }
036}