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

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

    try {
      jsonGenerator.writeStartObject();

      if (accountSettings.getAwsAccountNumber() != null) {
        jsonGenerator
            .writeFieldName("awsAccountNumber")
            .writeValue(accountSettings.getAwsAccountNumber());
      }

      java.util.Map<String, Integer> unmeteredDevicesMap = accountSettings.getUnmeteredDevices();
      if (unmeteredDevicesMap != null) {
        jsonGenerator.writeFieldName("unmeteredDevices");
        jsonGenerator.writeStartObject();

        for (Map.Entry<String, Integer> unmeteredDevicesMapValue : unmeteredDevicesMap.entrySet()) {
          if (unmeteredDevicesMapValue.getValue() != null) {
            jsonGenerator.writeFieldName(unmeteredDevicesMapValue.getKey());

            jsonGenerator.writeValue(unmeteredDevicesMapValue.getValue());
          }
        }
        jsonGenerator.writeEndObject();
      }

      java.util.Map<String, Integer> unmeteredRemoteAccessDevicesMap =
          accountSettings.getUnmeteredRemoteAccessDevices();
      if (unmeteredRemoteAccessDevicesMap != null) {
        jsonGenerator.writeFieldName("unmeteredRemoteAccessDevices");
        jsonGenerator.writeStartObject();

        for (Map.Entry<String, Integer> unmeteredRemoteAccessDevicesMapValue :
            unmeteredRemoteAccessDevicesMap.entrySet()) {
          if (unmeteredRemoteAccessDevicesMapValue.getValue() != null) {
            jsonGenerator.writeFieldName(unmeteredRemoteAccessDevicesMapValue.getKey());

            jsonGenerator.writeValue(unmeteredRemoteAccessDevicesMapValue.getValue());
          }
        }
        jsonGenerator.writeEndObject();
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(TransferData transferData, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (transferData.getTransferMessage() != null) {
        jsonGenerator
            .writeFieldName("transferMessage")
            .writeValue(transferData.getTransferMessage());
      }
      if (transferData.getRejectReason() != null) {
        jsonGenerator.writeFieldName("rejectReason").writeValue(transferData.getRejectReason());
      }
      if (transferData.getTransferDate() != null) {
        jsonGenerator.writeFieldName("transferDate").writeValue(transferData.getTransferDate());
      }
      if (transferData.getAcceptDate() != null) {
        jsonGenerator.writeFieldName("acceptDate").writeValue(transferData.getAcceptDate());
      }
      if (transferData.getRejectDate() != null) {
        jsonGenerator.writeFieldName("rejectDate").writeValue(transferData.getRejectDate());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      VaultNotificationConfig vaultNotificationConfig, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (vaultNotificationConfig.getSNSTopic() != null) {
        jsonGenerator.writeFieldName("SNSTopic").writeValue(vaultNotificationConfig.getSNSTopic());
      }

      java.util.List<String> eventsList = vaultNotificationConfig.getEvents();
      if (eventsList != null) {
        jsonGenerator.writeFieldName("Events");
        jsonGenerator.writeStartArray();
        for (String eventsListValue : eventsList) {
          if (eventsListValue != null) {
            jsonGenerator.writeValue(eventsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(PipelineContext pipelineContext, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (pipelineContext.getPipelineName() != null) {
        jsonGenerator.writeFieldName("pipelineName").writeValue(pipelineContext.getPipelineName());
      }
      if (pipelineContext.getStage() != null) {
        jsonGenerator.writeFieldName("stage");
        StageContextJsonMarshaller.getInstance()
            .marshall(pipelineContext.getStage(), jsonGenerator);
      }
      if (pipelineContext.getAction() != null) {
        jsonGenerator.writeFieldName("action");
        ActionContextJsonMarshaller.getInstance()
            .marshall(pipelineContext.getAction(), jsonGenerator);
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(IPSet iPSet, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (iPSet.getIPSetId() != null) {
        jsonGenerator.writeFieldName("IPSetId").writeValue(iPSet.getIPSetId());
      }
      if (iPSet.getName() != null) {
        jsonGenerator.writeFieldName("Name").writeValue(iPSet.getName());
      }

      java.util.List<IPSetDescriptor> iPSetDescriptorsList = iPSet.getIPSetDescriptors();
      if (iPSetDescriptorsList != null) {
        jsonGenerator.writeFieldName("IPSetDescriptors");
        jsonGenerator.writeStartArray();
        for (IPSetDescriptor iPSetDescriptorsListValue : iPSetDescriptorsList) {
          if (iPSetDescriptorsListValue != null) {

            IPSetDescriptorJsonMarshaller.getInstance()
                .marshall(iPSetDescriptorsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(OptionStatus optionStatus, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (optionStatus.getCreationDate() != null) {
        jsonGenerator.writeFieldName("CreationDate").writeValue(optionStatus.getCreationDate());
      }
      if (optionStatus.getUpdateDate() != null) {
        jsonGenerator.writeFieldName("UpdateDate").writeValue(optionStatus.getUpdateDate());
      }
      if (optionStatus.getUpdateVersion() != null) {
        jsonGenerator.writeFieldName("UpdateVersion").writeValue(optionStatus.getUpdateVersion());
      }
      if (optionStatus.getState() != null) {
        jsonGenerator.writeFieldName("State").writeValue(optionStatus.getState());
      }
      if (optionStatus.getPendingDeletion() != null) {
        jsonGenerator
            .writeFieldName("PendingDeletion")
            .writeValue(optionStatus.getPendingDeletion());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      SegmentImportResource segmentImportResource, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (segmentImportResource.getExternalId() != null) {
        jsonGenerator
            .writeFieldName("ExternalId")
            .writeValue(segmentImportResource.getExternalId());
      }
      if (segmentImportResource.getFormat() != null) {
        jsonGenerator.writeFieldName("Format").writeValue(segmentImportResource.getFormat());
      }
      if (segmentImportResource.getRoleArn() != null) {
        jsonGenerator.writeFieldName("RoleArn").writeValue(segmentImportResource.getRoleArn());
      }
      if (segmentImportResource.getS3Url() != null) {
        jsonGenerator.writeFieldName("S3Url").writeValue(segmentImportResource.getS3Url());
      }
      if (segmentImportResource.getSize() != null) {
        jsonGenerator.writeFieldName("Size").writeValue(segmentImportResource.getSize());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(TaskOverride taskOverride, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      com.amazonaws.internal.SdkInternalList<ContainerOverride> containerOverridesList =
          (com.amazonaws.internal.SdkInternalList<ContainerOverride>)
              taskOverride.getContainerOverrides();
      if (!containerOverridesList.isEmpty() || !containerOverridesList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("containerOverrides");
        jsonGenerator.writeStartArray();
        for (ContainerOverride containerOverridesListValue : containerOverridesList) {
          if (containerOverridesListValue != null) {

            ContainerOverrideJsonMarshaller.getInstance()
                .marshall(containerOverridesListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

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

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

    Request<CancelJobRequest> request =
        new DefaultRequest<CancelJobRequest>(cancelJobRequest, "AmazonSnowball");
    request.addHeader("X-Amz-Target", "AWSIESnowballJobManagementService.CancelJob");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      if (cancelJobRequest.getJobId() != null) {
        jsonGenerator.writeFieldName("JobId").writeValue(cancelJobRequest.getJobId());
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(DirectoryLimits directoryLimits, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (directoryLimits.getCloudOnlyDirectoriesLimit() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyDirectoriesLimit")
            .writeValue(directoryLimits.getCloudOnlyDirectoriesLimit());
      }
      if (directoryLimits.getCloudOnlyDirectoriesCurrentCount() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyDirectoriesCurrentCount")
            .writeValue(directoryLimits.getCloudOnlyDirectoriesCurrentCount());
      }
      if (directoryLimits.getCloudOnlyDirectoriesLimitReached() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyDirectoriesLimitReached")
            .writeValue(directoryLimits.getCloudOnlyDirectoriesLimitReached());
      }
      if (directoryLimits.getCloudOnlyMicrosoftADLimit() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyMicrosoftADLimit")
            .writeValue(directoryLimits.getCloudOnlyMicrosoftADLimit());
      }
      if (directoryLimits.getCloudOnlyMicrosoftADCurrentCount() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyMicrosoftADCurrentCount")
            .writeValue(directoryLimits.getCloudOnlyMicrosoftADCurrentCount());
      }
      if (directoryLimits.getCloudOnlyMicrosoftADLimitReached() != null) {
        jsonGenerator
            .writeFieldName("CloudOnlyMicrosoftADLimitReached")
            .writeValue(directoryLimits.getCloudOnlyMicrosoftADLimitReached());
      }
      if (directoryLimits.getConnectedDirectoriesLimit() != null) {
        jsonGenerator
            .writeFieldName("ConnectedDirectoriesLimit")
            .writeValue(directoryLimits.getConnectedDirectoriesLimit());
      }
      if (directoryLimits.getConnectedDirectoriesCurrentCount() != null) {
        jsonGenerator
            .writeFieldName("ConnectedDirectoriesCurrentCount")
            .writeValue(directoryLimits.getConnectedDirectoriesCurrentCount());
      }
      if (directoryLimits.getConnectedDirectoriesLimitReached() != null) {
        jsonGenerator
            .writeFieldName("ConnectedDirectoriesLimitReached")
            .writeValue(directoryLimits.getConnectedDirectoriesLimitReached());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(DocumentParameter documentParameter, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (documentParameter.getName() != null) {
        jsonGenerator.writeFieldName("Name").writeValue(documentParameter.getName());
      }
      if (documentParameter.getType() != null) {
        jsonGenerator.writeFieldName("Type").writeValue(documentParameter.getType());
      }
      if (documentParameter.getDescription() != null) {
        jsonGenerator.writeFieldName("Description").writeValue(documentParameter.getDescription());
      }
      if (documentParameter.getDefaultValue() != null) {
        jsonGenerator
            .writeFieldName("DefaultValue")
            .writeValue(documentParameter.getDefaultValue());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  public Request<DescribeAccountAttributesRequest> marshall(
      DescribeAccountAttributesRequest describeAccountAttributesRequest) {

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

    Request<DescribeAccountAttributesRequest> request =
        new DefaultRequest<DescribeAccountAttributesRequest>(
            describeAccountAttributesRequest, "AWSOpsWorksCM");
    request.addHeader("X-Amz-Target", "OpsWorksCM_V2016_11_01.DescribeAccountAttributes");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      MaintenanceWindowFilter maintenanceWindowFilter, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (maintenanceWindowFilter.getKey() != null) {
        jsonGenerator.writeFieldName("Key").writeValue(maintenanceWindowFilter.getKey());
      }

      com.amazonaws.internal.SdkInternalList<String> valuesList =
          (com.amazonaws.internal.SdkInternalList<String>) maintenanceWindowFilter.getValues();
      if (!valuesList.isEmpty() || !valuesList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("Values");
        jsonGenerator.writeStartArray();
        for (String valuesListValue : valuesList) {
          if (valuesListValue != null) {
            jsonGenerator.writeValue(valuesListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      CodeDeliveryDetailsType codeDeliveryDetailsType, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (codeDeliveryDetailsType.getDestination() != null) {
        jsonGenerator
            .writeFieldName("Destination")
            .writeValue(codeDeliveryDetailsType.getDestination());
      }
      if (codeDeliveryDetailsType.getDeliveryMedium() != null) {
        jsonGenerator
            .writeFieldName("DeliveryMedium")
            .writeValue(codeDeliveryDetailsType.getDeliveryMedium());
      }
      if (codeDeliveryDetailsType.getAttributeName() != null) {
        jsonGenerator
            .writeFieldName("AttributeName")
            .writeValue(codeDeliveryDetailsType.getAttributeName());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      CloudWatchLoggingOptions cloudWatchLoggingOptions, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (cloudWatchLoggingOptions.getEnabled() != null) {
        jsonGenerator.writeFieldName("Enabled").writeValue(cloudWatchLoggingOptions.getEnabled());
      }
      if (cloudWatchLoggingOptions.getLogGroupName() != null) {
        jsonGenerator
            .writeFieldName("LogGroupName")
            .writeValue(cloudWatchLoggingOptions.getLogGroupName());
      }
      if (cloudWatchLoggingOptions.getLogStreamName() != null) {
        jsonGenerator
            .writeFieldName("LogStreamName")
            .writeValue(cloudWatchLoggingOptions.getLogStreamName());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(ServerEvent serverEvent, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (serverEvent.getCreatedAt() != null) {
        jsonGenerator.writeFieldName("CreatedAt").writeValue(serverEvent.getCreatedAt());
      }
      if (serverEvent.getServerName() != null) {
        jsonGenerator.writeFieldName("ServerName").writeValue(serverEvent.getServerName());
      }
      if (serverEvent.getMessage() != null) {
        jsonGenerator.writeFieldName("Message").writeValue(serverEvent.getMessage());
      }
      if (serverEvent.getLogUrl() != null) {
        jsonGenerator.writeFieldName("LogUrl").writeValue(serverEvent.getLogUrl());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  public Request<LookupEventsRequest> marshall(LookupEventsRequest lookupEventsRequest) {

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

    Request<LookupEventsRequest> request =
        new DefaultRequest<LookupEventsRequest>(lookupEventsRequest, "AWSCloudTrail");
    request.addHeader(
        "X-Amz-Target", "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.LookupEvents");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      com.amazonaws.internal.SdkInternalList<LookupAttribute> lookupAttributesList =
          (com.amazonaws.internal.SdkInternalList<LookupAttribute>)
              lookupEventsRequest.getLookupAttributes();
      if (!lookupAttributesList.isEmpty() || !lookupAttributesList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("LookupAttributes");
        jsonGenerator.writeStartArray();
        for (LookupAttribute lookupAttributesListValue : lookupAttributesList) {
          if (lookupAttributesListValue != null) {

            LookupAttributeJsonMarshaller.getInstance()
                .marshall(lookupAttributesListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (lookupEventsRequest.getStartTime() != null) {
        jsonGenerator.writeFieldName("StartTime").writeValue(lookupEventsRequest.getStartTime());
      }
      if (lookupEventsRequest.getEndTime() != null) {
        jsonGenerator.writeFieldName("EndTime").writeValue(lookupEventsRequest.getEndTime());
      }
      if (lookupEventsRequest.getMaxResults() != null) {
        jsonGenerator.writeFieldName("MaxResults").writeValue(lookupEventsRequest.getMaxResults());
      }
      if (lookupEventsRequest.getNextToken() != null) {
        jsonGenerator.writeFieldName("NextToken").writeValue(lookupEventsRequest.getNextToken());
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      FailWorkflowExecutionFailedEventAttributes failWorkflowExecutionFailedEventAttributes,
      StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (failWorkflowExecutionFailedEventAttributes.getCause() != null) {
        jsonGenerator
            .writeFieldName("cause")
            .writeValue(failWorkflowExecutionFailedEventAttributes.getCause());
      }
      if (failWorkflowExecutionFailedEventAttributes.getDecisionTaskCompletedEventId() != null) {
        jsonGenerator
            .writeFieldName("decisionTaskCompletedEventId")
            .writeValue(
                failWorkflowExecutionFailedEventAttributes.getDecisionTaskCompletedEventId());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(OfferingStatus offeringStatus, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (offeringStatus.getType() != null) {
        jsonGenerator.writeFieldName("type").writeValue(offeringStatus.getType());
      }
      if (offeringStatus.getOffering() != null) {
        jsonGenerator.writeFieldName("offering");
        OfferingJsonMarshaller.getInstance().marshall(offeringStatus.getOffering(), jsonGenerator);
      }
      if (offeringStatus.getQuantity() != null) {
        jsonGenerator.writeFieldName("quantity").writeValue(offeringStatus.getQuantity());
      }
      if (offeringStatus.getEffectiveOn() != null) {
        jsonGenerator.writeFieldName("effectiveOn").writeValue(offeringStatus.getEffectiveOn());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      RejectedLogEventsInfo rejectedLogEventsInfo, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (rejectedLogEventsInfo.getTooNewLogEventStartIndex() != null) {
        jsonGenerator
            .writeFieldName("tooNewLogEventStartIndex")
            .writeValue(rejectedLogEventsInfo.getTooNewLogEventStartIndex());
      }
      if (rejectedLogEventsInfo.getTooOldLogEventEndIndex() != null) {
        jsonGenerator
            .writeFieldName("tooOldLogEventEndIndex")
            .writeValue(rejectedLogEventsInfo.getTooOldLogEventEndIndex());
      }
      if (rejectedLogEventsInfo.getExpiredLogEventEndIndex() != null) {
        jsonGenerator
            .writeFieldName("expiredLogEventEndIndex")
            .writeValue(rejectedLogEventsInfo.getExpiredLogEventEndIndex());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(PolicyVersion policyVersion, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (policyVersion.getVersionId() != null) {
        jsonGenerator.writeFieldName("versionId").writeValue(policyVersion.getVersionId());
      }
      if (policyVersion.getIsDefaultVersion() != null) {
        jsonGenerator
            .writeFieldName("isDefaultVersion")
            .writeValue(policyVersion.getIsDefaultVersion());
      }
      if (policyVersion.getCreateDate() != null) {
        jsonGenerator.writeFieldName("createDate").writeValue(policyVersion.getCreateDate());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(CurrentRevision currentRevision, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (currentRevision.getRevision() != null) {
        jsonGenerator.writeFieldName("revision").writeValue(currentRevision.getRevision());
      }
      if (currentRevision.getChangeIdentifier() != null) {
        jsonGenerator
            .writeFieldName("changeIdentifier")
            .writeValue(currentRevision.getChangeIdentifier());
      }
      if (currentRevision.getCreated() != null) {
        jsonGenerator.writeFieldName("created").writeValue(currentRevision.getCreated());
      }
      if (currentRevision.getRevisionSummary() != null) {
        jsonGenerator
            .writeFieldName("revisionSummary")
            .writeValue(currentRevision.getRevisionSummary());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(JobWatermark jobWatermark, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (jobWatermark.getPresetWatermarkId() != null) {
        jsonGenerator
            .writeFieldName("PresetWatermarkId")
            .writeValue(jobWatermark.getPresetWatermarkId());
      }
      if (jobWatermark.getInputKey() != null) {
        jsonGenerator.writeFieldName("InputKey").writeValue(jobWatermark.getInputKey());
      }
      if (jobWatermark.getEncryption() != null) {
        jsonGenerator.writeFieldName("Encryption");
        EncryptionJsonMarshaller.getInstance()
            .marshall(jobWatermark.getEncryption(), jsonGenerator);
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(S3Location s3Location, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (s3Location.getBucket() != null) {
        jsonGenerator.writeFieldName("bucket").writeValue(s3Location.getBucket());
      }
      if (s3Location.getKey() != null) {
        jsonGenerator.writeFieldName("key").writeValue(s3Location.getKey());
      }
      if (s3Location.getBundleType() != null) {
        jsonGenerator.writeFieldName("bundleType").writeValue(s3Location.getBundleType());
      }
      if (s3Location.getVersion() != null) {
        jsonGenerator.writeFieldName("version").writeValue(s3Location.getVersion());
      }
      if (s3Location.getETag() != null) {
        jsonGenerator.writeFieldName("eTag").writeValue(s3Location.getETag());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(Encryption encryption, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (encryption.getMode() != null) {
        jsonGenerator.writeFieldName("Mode").writeValue(encryption.getMode());
      }
      if (encryption.getKey() != null) {
        jsonGenerator.writeFieldName("Key").writeValue(encryption.getKey());
      }
      if (encryption.getKeyMd5() != null) {
        jsonGenerator.writeFieldName("KeyMd5").writeValue(encryption.getKeyMd5());
      }
      if (encryption.getInitializationVector() != null) {
        jsonGenerator
            .writeFieldName("InitializationVector")
            .writeValue(encryption.getInitializationVector());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(LoadBalancer loadBalancer, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (loadBalancer.getLoadBalancerName() != null) {
        jsonGenerator
            .writeFieldName("loadBalancerName")
            .writeValue(loadBalancer.getLoadBalancerName());
      }
      if (loadBalancer.getContainerName() != null) {
        jsonGenerator.writeFieldName("containerName").writeValue(loadBalancer.getContainerName());
      }
      if (loadBalancer.getContainerPort() != null) {
        jsonGenerator.writeFieldName("containerPort").writeValue(loadBalancer.getContainerPort());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(ByteMatchTuple byteMatchTuple, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (byteMatchTuple.getFieldToMatch() != null) {
        jsonGenerator.writeFieldName("FieldToMatch");
        FieldToMatchJsonMarshaller.getInstance()
            .marshall(byteMatchTuple.getFieldToMatch(), jsonGenerator);
      }
      if (byteMatchTuple.getTargetString() != null) {
        jsonGenerator.writeFieldName("TargetString").writeValue(byteMatchTuple.getTargetString());
      }
      if (byteMatchTuple.getTextTransformation() != null) {
        jsonGenerator
            .writeFieldName("TextTransformation")
            .writeValue(byteMatchTuple.getTextTransformation());
      }
      if (byteMatchTuple.getPositionalConstraint() != null) {
        jsonGenerator
            .writeFieldName("PositionalConstraint")
            .writeValue(byteMatchTuple.getPositionalConstraint());
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  public Request<DeletePipelineRequest> marshall(DeletePipelineRequest deletePipelineRequest) {

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

    Request<DeletePipelineRequest> request =
        new DefaultRequest<DeletePipelineRequest>(deletePipelineRequest, "AWSCodePipeline");
    request.addHeader("X-Amz-Target", "CodePipeline_20150709.DeletePipeline");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      if (deletePipelineRequest.getName() != null) {
        jsonGenerator.writeFieldName("name").writeValue(deletePipelineRequest.getName());
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(UniqueProblem uniqueProblem, StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (uniqueProblem.getMessage() != null) {
        jsonGenerator.writeFieldName("message").writeValue(uniqueProblem.getMessage());
      }

      java.util.List<Problem> problemsList = uniqueProblem.getProblems();
      if (problemsList != null) {
        jsonGenerator.writeFieldName("problems");
        jsonGenerator.writeStartArray();
        for (Problem problemsListValue : problemsList) {
          if (problemsListValue != null) {

            ProblemJsonMarshaller.getInstance().marshall(problemsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();
    } catch (Throwable t) {
      throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  /** Marshall the given parameter object, and output to a SdkJsonGenerator */
  public void marshall(
      UpdateProvisioningParameter updateProvisioningParameter,
      StructuredJsonGenerator jsonGenerator) {

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

    try {
      jsonGenerator.writeStartObject();

      if (updateProvisioningParameter.getKey() != null) {
        jsonGenerator.writeFieldName("Key").writeValue(updateProvisioningParameter.getKey());
      }
      if (updateProvisioningParameter.getValue() != null) {
        jsonGenerator.writeFieldName("Value").writeValue(updateProvisioningParameter.getValue());
      }
      if (updateProvisioningParameter.getUsePreviousValue() != null) {
        jsonGenerator
            .writeFieldName("UsePreviousValue")
            .writeValue(updateProvisioningParameter.getUsePreviousValue());
      }

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