/** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      DirectoryVpcSettings directoryVpcSettings, StructuredJsonGenerator jsonGenerator) {

    if (directoryVpcSettings == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonGenerator.writeStartObject();

      if (directoryVpcSettings.getVpcId() != null) {
        jsonGenerator.writeFieldName("VpcId").writeValue(directoryVpcSettings.getVpcId());
      }

      com.amazonaws.internal.SdkInternalList<String> subnetIdsList =
          (com.amazonaws.internal.SdkInternalList<String>) directoryVpcSettings.getSubnetIds();
      if (!subnetIdsList.isEmpty() || !subnetIdsList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("SubnetIds");
        jsonGenerator.writeStartArray();
        for (String subnetIdsListValue : subnetIdsList) {
          if (subnetIdsListValue != null) {
            jsonGenerator.writeValue(subnetIdsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

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