/** Marshall the given parameter object, and output to a JSONWriter */
  public void marshall(ElasticsearchDomainConfig elasticsearchDomainConfig, JSONWriter jsonWriter) {
    if (elasticsearchDomainConfig == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonWriter.object();

      if (elasticsearchDomainConfig.getElasticsearchClusterConfig() != null) {
        jsonWriter.key("ElasticsearchClusterConfig");
        ElasticsearchClusterConfigStatusJsonMarshaller.getInstance()
            .marshall(elasticsearchDomainConfig.getElasticsearchClusterConfig(), jsonWriter);
      }

      if (elasticsearchDomainConfig.getEBSOptions() != null) {
        jsonWriter.key("EBSOptions");
        EBSOptionsStatusJsonMarshaller.getInstance()
            .marshall(elasticsearchDomainConfig.getEBSOptions(), jsonWriter);
      }

      if (elasticsearchDomainConfig.getAccessPolicies() != null) {
        jsonWriter.key("AccessPolicies");
        AccessPoliciesStatusJsonMarshaller.getInstance()
            .marshall(elasticsearchDomainConfig.getAccessPolicies(), jsonWriter);
      }

      if (elasticsearchDomainConfig.getSnapshotOptions() != null) {
        jsonWriter.key("SnapshotOptions");
        SnapshotOptionsStatusJsonMarshaller.getInstance()
            .marshall(elasticsearchDomainConfig.getSnapshotOptions(), jsonWriter);
      }

      if (elasticsearchDomainConfig.getAdvancedOptions() != null) {
        jsonWriter.key("AdvancedOptions");
        AdvancedOptionsStatusJsonMarshaller.getInstance()
            .marshall(elasticsearchDomainConfig.getAdvancedOptions(), jsonWriter);
      }

      jsonWriter.endObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
コード例 #2
0
  /** Marshall the given parameter object, and output to a JSONWriter */
  public void marshall(Tag tag, JSONWriter jsonWriter) {
    if (tag == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonWriter.object();

      if (tag.getKey() != null) {
        jsonWriter.key("Key").value(tag.getKey());
      }

      if (tag.getValue() != null) {
        jsonWriter.key("Value").value(tag.getValue());
      }

      jsonWriter.endObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }