public JobWatermark unmarshall(JsonUnmarshallerContext context) throws Exception {
    JobWatermark jobWatermark = new JobWatermark();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("PresetWatermarkId", targetDepth)) {
          context.nextToken();
          jobWatermark.setPresetWatermarkId(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("InputKey", targetDepth)) {
          context.nextToken();
          jobWatermark.setInputKey(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Encryption", targetDepth)) {
          context.nextToken();
          jobWatermark.setEncryption(EncryptionJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return jobWatermark;
  }
 /**
  * The ID of the watermark settings that Elastic Transcoder uses to add watermarks to the video
  * during transcoding. The settings are in the preset specified by Preset for the current output.
  * In that preset, the value of Watermarks Id tells Elastic Transcoder which settings to use.
  *
  * @param presetWatermarkId The ID of the watermark settings that Elastic Transcoder uses to add
  *     watermarks to the video during transcoding. The settings are in the preset specified by
  *     Preset for the current output. In that preset, the value of Watermarks Id tells Elastic
  *     Transcoder which settings to use.
  * @return Returns a reference to this object so that method calls can be chained together.
  */
 public JobWatermark withPresetWatermarkId(String presetWatermarkId) {
   setPresetWatermarkId(presetWatermarkId);
   return this;
 }