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;
  }
  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;
  }
  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;
  }
  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;
  }
  public Request<ListOnPremisesInstancesRequest> marshall(
      ListOnPremisesInstancesRequest listOnPremisesInstancesRequest) {

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

    Request<ListOnPremisesInstancesRequest> request =
        new DefaultRequest<ListOnPremisesInstancesRequest>(
            listOnPremisesInstancesRequest, "AmazonCodeDeploy");
    request.addHeader("X-Amz-Target", "CodeDeploy_20141006.ListOnPremisesInstances");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (listOnPremisesInstancesRequest.getRegistrationStatus() != null) {
        jsonGenerator
            .writeFieldName("registrationStatus")
            .writeValue(listOnPremisesInstancesRequest.getRegistrationStatus());
      }

      com.amazonaws.internal.SdkInternalList<TagFilter> tagFiltersList =
          (com.amazonaws.internal.SdkInternalList<TagFilter>)
              listOnPremisesInstancesRequest.getTagFilters();
      if (!tagFiltersList.isEmpty() || !tagFiltersList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("tagFilters");
        jsonGenerator.writeStartArray();
        for (TagFilter tagFiltersListValue : tagFiltersList) {
          if (tagFiltersListValue != null) {

            TagFilterJsonMarshaller.getInstance().marshall(tagFiltersListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (listOnPremisesInstancesRequest.getNextToken() != null) {
        jsonGenerator
            .writeFieldName("nextToken")
            .writeValue(listOnPremisesInstancesRequest.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 SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  public Request<TerminateProvisionedProductRequest> marshall(
      TerminateProvisionedProductRequest terminateProvisionedProductRequest) {

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

    Request<TerminateProvisionedProductRequest> request =
        new DefaultRequest<TerminateProvisionedProductRequest>(
            terminateProvisionedProductRequest, "AWSServiceCatalog");
    request.addHeader("X-Amz-Target", "AWS242ServiceCatalogService.TerminateProvisionedProduct");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (terminateProvisionedProductRequest.getProvisionedProductName() != null) {
        jsonGenerator
            .writeFieldName("ProvisionedProductName")
            .writeValue(terminateProvisionedProductRequest.getProvisionedProductName());
      }
      if (terminateProvisionedProductRequest.getProvisionedProductId() != null) {
        jsonGenerator
            .writeFieldName("ProvisionedProductId")
            .writeValue(terminateProvisionedProductRequest.getProvisionedProductId());
      }
      jsonGenerator
          .writeFieldName("TerminateToken")
          .writeValue(
              IdempotentUtils.resolveString(
                  terminateProvisionedProductRequest.getTerminateToken()));
      if (terminateProvisionedProductRequest.getIgnoreErrors() != null) {
        jsonGenerator
            .writeFieldName("IgnoreErrors")
            .writeValue(terminateProvisionedProductRequest.getIgnoreErrors());
      }
      if (terminateProvisionedProductRequest.getAcceptLanguage() != null) {
        jsonGenerator
            .writeFieldName("AcceptLanguage")
            .writeValue(terminateProvisionedProductRequest.getAcceptLanguage());
      }

      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;
  }
  public Request<ListClustersRequest> marshall(ListClustersRequest listClustersRequest) {

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

    Request<ListClustersRequest> request =
        new DefaultRequest<ListClustersRequest>(listClustersRequest, "AmazonElasticMapReduce");
    request.addHeader("X-Amz-Target", "ElasticMapReduce.ListClusters");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (listClustersRequest.getCreatedAfter() != null) {
        jsonGenerator
            .writeFieldName("CreatedAfter")
            .writeValue(listClustersRequest.getCreatedAfter());
      }
      if (listClustersRequest.getCreatedBefore() != null) {
        jsonGenerator
            .writeFieldName("CreatedBefore")
            .writeValue(listClustersRequest.getCreatedBefore());
      }

      com.amazonaws.internal.SdkInternalList<String> clusterStatesList =
          (com.amazonaws.internal.SdkInternalList<String>) listClustersRequest.getClusterStates();
      if (!clusterStatesList.isEmpty() || !clusterStatesList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("ClusterStates");
        jsonGenerator.writeStartArray();
        for (String clusterStatesListValue : clusterStatesList) {
          if (clusterStatesListValue != null) {
            jsonGenerator.writeValue(clusterStatesListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (listClustersRequest.getMarker() != null) {
        jsonGenerator.writeFieldName("Marker").writeValue(listClustersRequest.getMarker());
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<CreateConditionalForwarderRequest> marshall(
      CreateConditionalForwarderRequest createConditionalForwarderRequest) {

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

    Request<CreateConditionalForwarderRequest> request =
        new DefaultRequest<CreateConditionalForwarderRequest>(
            createConditionalForwarderRequest, "AWSDirectoryService");
    request.addHeader("X-Amz-Target", "DirectoryService_20150416.CreateConditionalForwarder");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (createConditionalForwarderRequest.getDirectoryId() != null) {
        jsonGenerator
            .writeFieldName("DirectoryId")
            .writeValue(createConditionalForwarderRequest.getDirectoryId());
      }
      if (createConditionalForwarderRequest.getRemoteDomainName() != null) {
        jsonGenerator
            .writeFieldName("RemoteDomainName")
            .writeValue(createConditionalForwarderRequest.getRemoteDomainName());
      }

      com.amazonaws.internal.SdkInternalList<String> dnsIpAddrsList =
          (com.amazonaws.internal.SdkInternalList<String>)
              createConditionalForwarderRequest.getDnsIpAddrs();
      if (!dnsIpAddrsList.isEmpty() || !dnsIpAddrsList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("DnsIpAddrs");
        jsonGenerator.writeStartArray();
        for (String dnsIpAddrsListValue : dnsIpAddrsList) {
          if (dnsIpAddrsListValue != null) {
            jsonGenerator.writeValue(dnsIpAddrsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<UpdateByteMatchSetRequest> marshall(
      UpdateByteMatchSetRequest updateByteMatchSetRequest) {

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

    Request<UpdateByteMatchSetRequest> request =
        new DefaultRequest<UpdateByteMatchSetRequest>(updateByteMatchSetRequest, "AWSWAF");
    request.addHeader("X-Amz-Target", "AWSWAF_20150824.UpdateByteMatchSet");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (updateByteMatchSetRequest.getByteMatchSetId() != null) {
        jsonGenerator
            .writeFieldName("ByteMatchSetId")
            .writeValue(updateByteMatchSetRequest.getByteMatchSetId());
      }
      if (updateByteMatchSetRequest.getChangeToken() != null) {
        jsonGenerator
            .writeFieldName("ChangeToken")
            .writeValue(updateByteMatchSetRequest.getChangeToken());
      }

      java.util.List<ByteMatchSetUpdate> updatesList = updateByteMatchSetRequest.getUpdates();
      if (updatesList != null) {
        jsonGenerator.writeFieldName("Updates");
        jsonGenerator.writeStartArray();
        for (ByteMatchSetUpdate updatesListValue : updatesList) {
          if (updatesListValue != null) {

            ByteMatchSetUpdateJsonMarshaller.getInstance()
                .marshall(updatesListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      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;
  }
  public Request<RespondDecisionTaskCompletedRequest> marshall(
      RespondDecisionTaskCompletedRequest respondDecisionTaskCompletedRequest) {

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

    Request<RespondDecisionTaskCompletedRequest> request =
        new DefaultRequest<RespondDecisionTaskCompletedRequest>(
            respondDecisionTaskCompletedRequest, "AmazonSimpleWorkflow");
    request.addHeader("X-Amz-Target", "SimpleWorkflowService.RespondDecisionTaskCompleted");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (respondDecisionTaskCompletedRequest.getTaskToken() != null) {
        jsonGenerator
            .writeFieldName("taskToken")
            .writeValue(respondDecisionTaskCompletedRequest.getTaskToken());
      }

      java.util.List<Decision> decisionsList = respondDecisionTaskCompletedRequest.getDecisions();
      if (decisionsList != null) {
        jsonGenerator.writeFieldName("decisions");
        jsonGenerator.writeStartArray();
        for (Decision decisionsListValue : decisionsList) {
          if (decisionsListValue != null) {

            DecisionJsonMarshaller.getInstance().marshall(decisionsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (respondDecisionTaskCompletedRequest.getExecutionContext() != null) {
        jsonGenerator
            .writeFieldName("executionContext")
            .writeValue(respondDecisionTaskCompletedRequest.getExecutionContext());
      }

      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;
  }
  public Request<DeleteTagsRequest> marshall(DeleteTagsRequest deleteTagsRequest) {

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

    Request<DeleteTagsRequest> request =
        new DefaultRequest<DeleteTagsRequest>(deleteTagsRequest, "AWSApplicationDiscovery");
    request.addHeader("X-Amz-Target", "AWSPoseidonService_V2015_11_01.DeleteTags");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      java.util.List<String> configurationIdsList = deleteTagsRequest.getConfigurationIds();
      if (configurationIdsList != null) {
        jsonGenerator.writeFieldName("configurationIds");
        jsonGenerator.writeStartArray();
        for (String configurationIdsListValue : configurationIdsList) {
          if (configurationIdsListValue != null) {
            jsonGenerator.writeValue(configurationIdsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      java.util.List<Tag> tagsList = deleteTagsRequest.getTags();
      if (tagsList != null) {
        jsonGenerator.writeFieldName("tags");
        jsonGenerator.writeStartArray();
        for (Tag tagsListValue : tagsList) {
          if (tagsListValue != null) {

            TagJsonMarshaller.getInstance().marshall(tagsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<UpdateMethodRequest> marshall(UpdateMethodRequest updateMethodRequest) {

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

    Request<UpdateMethodRequest> request =
        new DefaultRequest<UpdateMethodRequest>(updateMethodRequest, "AmazonApiGateway");

    request.setHttpMethod(HttpMethodName.PATCH);

    String uriResourcePath = "/restapis/{restapi_id}/resources/{resource_id}/methods/{http_method}";

    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "restapi_id", updateMethodRequest.getRestApiId());
    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "resource_id", updateMethodRequest.getResourceId());
    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "http_method", updateMethodRequest.getHttpMethod());
    request.setResourcePath(uriResourcePath);

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

      java.util.List<PatchOperation> patchOperationsList = updateMethodRequest.getPatchOperations();
      if (patchOperationsList != null) {
        jsonGenerator.writeFieldName("patchOperations");
        jsonGenerator.writeStartArray();
        for (PatchOperation patchOperationsListValue : patchOperationsList) {
          if (patchOperationsListValue != null) {

            PatchOperationJsonMarshaller.getInstance()
                .marshall(patchOperationsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<DescribeRaidArraysRequest> marshall(
      DescribeRaidArraysRequest describeRaidArraysRequest) {

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

    Request<DescribeRaidArraysRequest> request =
        new DefaultRequest<DescribeRaidArraysRequest>(describeRaidArraysRequest, "AWSOpsWorks");
    request.addHeader("X-Amz-Target", "OpsWorks_20130218.DescribeRaidArrays");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (describeRaidArraysRequest.getInstanceId() != null) {
        jsonGenerator
            .writeFieldName("InstanceId")
            .writeValue(describeRaidArraysRequest.getInstanceId());
      }
      if (describeRaidArraysRequest.getStackId() != null) {
        jsonGenerator.writeFieldName("StackId").writeValue(describeRaidArraysRequest.getStackId());
      }

      com.amazonaws.internal.SdkInternalList<String> raidArrayIdsList =
          (com.amazonaws.internal.SdkInternalList<String>)
              describeRaidArraysRequest.getRaidArrayIds();
      if (!raidArrayIdsList.isEmpty() || !raidArrayIdsList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("RaidArrayIds");
        jsonGenerator.writeStartArray();
        for (String raidArrayIdsListValue : raidArrayIdsList) {
          if (raidArrayIdsListValue != null) {
            jsonGenerator.writeValue(raidArrayIdsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      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;
  }
  public Request<ListDocumentsRequest> marshall(ListDocumentsRequest listDocumentsRequest) {

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

    Request<ListDocumentsRequest> request =
        new DefaultRequest<ListDocumentsRequest>(
            listDocumentsRequest, "AWSSimpleSystemsManagement");
    request.addHeader("X-Amz-Target", "AmazonSSM.ListDocuments");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      com.amazonaws.internal.SdkInternalList<DocumentFilter> documentFilterListList =
          (com.amazonaws.internal.SdkInternalList<DocumentFilter>)
              listDocumentsRequest.getDocumentFilterList();
      if (!documentFilterListList.isEmpty() || !documentFilterListList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("DocumentFilterList");
        jsonGenerator.writeStartArray();
        for (DocumentFilter documentFilterListListValue : documentFilterListList) {
          if (documentFilterListListValue != null) {

            DocumentFilterJsonMarshaller.getInstance()
                .marshall(documentFilterListListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (listDocumentsRequest.getMaxResults() != null) {
        jsonGenerator.writeFieldName("MaxResults").writeValue(listDocumentsRequest.getMaxResults());
      }
      if (listDocumentsRequest.getNextToken() != null) {
        jsonGenerator.writeFieldName("NextToken").writeValue(listDocumentsRequest.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 SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }
  public Request<AddInstanceGroupsRequest> marshall(
      AddInstanceGroupsRequest addInstanceGroupsRequest) {

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

    Request<AddInstanceGroupsRequest> request =
        new DefaultRequest<AddInstanceGroupsRequest>(
            addInstanceGroupsRequest, "AmazonElasticMapReduce");
    request.addHeader("X-Amz-Target", "ElasticMapReduce.AddInstanceGroups");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      com.amazonaws.internal.SdkInternalList<InstanceGroupConfig> instanceGroupsList =
          (com.amazonaws.internal.SdkInternalList<InstanceGroupConfig>)
              addInstanceGroupsRequest.getInstanceGroups();
      if (!instanceGroupsList.isEmpty() || !instanceGroupsList.isAutoConstruct()) {
        jsonGenerator.writeFieldName("InstanceGroups");
        jsonGenerator.writeStartArray();
        for (InstanceGroupConfig instanceGroupsListValue : instanceGroupsList) {
          if (instanceGroupsListValue != null) {

            InstanceGroupConfigJsonMarshaller.getInstance()
                .marshall(instanceGroupsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (addInstanceGroupsRequest.getJobFlowId() != null) {
        jsonGenerator
            .writeFieldName("JobFlowId")
            .writeValue(addInstanceGroupsRequest.getJobFlowId());
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<AdminUpdateDeviceStatusRequest> marshall(
      AdminUpdateDeviceStatusRequest adminUpdateDeviceStatusRequest) {

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

    Request<AdminUpdateDeviceStatusRequest> request =
        new DefaultRequest<AdminUpdateDeviceStatusRequest>(
            adminUpdateDeviceStatusRequest, "AWSCognitoIdentityProvider");
    request.addHeader("X-Amz-Target", "AWSCognitoIdentityProviderService.AdminUpdateDeviceStatus");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (adminUpdateDeviceStatusRequest.getUserPoolId() != null) {
        jsonGenerator
            .writeFieldName("UserPoolId")
            .writeValue(adminUpdateDeviceStatusRequest.getUserPoolId());
      }
      if (adminUpdateDeviceStatusRequest.getUsername() != null) {
        jsonGenerator
            .writeFieldName("Username")
            .writeValue(adminUpdateDeviceStatusRequest.getUsername());
      }
      if (adminUpdateDeviceStatusRequest.getDeviceKey() != null) {
        jsonGenerator
            .writeFieldName("DeviceKey")
            .writeValue(adminUpdateDeviceStatusRequest.getDeviceKey());
      }
      if (adminUpdateDeviceStatusRequest.getDeviceRememberedStatus() != null) {
        jsonGenerator
            .writeFieldName("DeviceRememberedStatus")
            .writeValue(adminUpdateDeviceStatusRequest.getDeviceRememberedStatus());
      }

      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;
  }
  public Request<DescribeProvisioningParametersRequest> marshall(
      DescribeProvisioningParametersRequest describeProvisioningParametersRequest) {

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

    Request<DescribeProvisioningParametersRequest> request =
        new DefaultRequest<DescribeProvisioningParametersRequest>(
            describeProvisioningParametersRequest, "AWSServiceCatalog");
    request.addHeader("X-Amz-Target", "AWS242ServiceCatalogService.DescribeProvisioningParameters");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (describeProvisioningParametersRequest.getAcceptLanguage() != null) {
        jsonGenerator
            .writeFieldName("AcceptLanguage")
            .writeValue(describeProvisioningParametersRequest.getAcceptLanguage());
      }
      if (describeProvisioningParametersRequest.getProductId() != null) {
        jsonGenerator
            .writeFieldName("ProductId")
            .writeValue(describeProvisioningParametersRequest.getProductId());
      }
      if (describeProvisioningParametersRequest.getProvisioningArtifactId() != null) {
        jsonGenerator
            .writeFieldName("ProvisioningArtifactId")
            .writeValue(describeProvisioningParametersRequest.getProvisioningArtifactId());
      }
      if (describeProvisioningParametersRequest.getPathId() != null) {
        jsonGenerator
            .writeFieldName("PathId")
            .writeValue(describeProvisioningParametersRequest.getPathId());
      }

      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;
  }
  public Request<SetLoadBasedAutoScalingRequest> marshall(
      SetLoadBasedAutoScalingRequest setLoadBasedAutoScalingRequest) {

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

    Request<SetLoadBasedAutoScalingRequest> request =
        new DefaultRequest<SetLoadBasedAutoScalingRequest>(
            setLoadBasedAutoScalingRequest, "AWSOpsWorks");
    request.addHeader("X-Amz-Target", "OpsWorks_20130218.SetLoadBasedAutoScaling");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (setLoadBasedAutoScalingRequest.getLayerId() != null) {
        jsonGenerator
            .writeFieldName("LayerId")
            .writeValue(setLoadBasedAutoScalingRequest.getLayerId());
      }
      if (setLoadBasedAutoScalingRequest.getEnable() != null) {
        jsonGenerator
            .writeFieldName("Enable")
            .writeValue(setLoadBasedAutoScalingRequest.getEnable());
      }
      if (setLoadBasedAutoScalingRequest.getUpScaling() != null) {
        jsonGenerator.writeFieldName("UpScaling");
        AutoScalingThresholdsJsonMarshaller.getInstance()
            .marshall(setLoadBasedAutoScalingRequest.getUpScaling(), jsonGenerator);
      }
      if (setLoadBasedAutoScalingRequest.getDownScaling() != null) {
        jsonGenerator.writeFieldName("DownScaling");
        AutoScalingThresholdsJsonMarshaller.getInstance()
            .marshall(setLoadBasedAutoScalingRequest.getDownScaling(), jsonGenerator);
      }

      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;
  }
  public Request<MergeDeveloperIdentitiesRequest> marshall(
      MergeDeveloperIdentitiesRequest mergeDeveloperIdentitiesRequest) {

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

    Request<MergeDeveloperIdentitiesRequest> request =
        new DefaultRequest<MergeDeveloperIdentitiesRequest>(
            mergeDeveloperIdentitiesRequest, "AmazonCognitoIdentity");
    request.addHeader("X-Amz-Target", "AWSCognitoIdentityService.MergeDeveloperIdentities");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (mergeDeveloperIdentitiesRequest.getSourceUserIdentifier() != null) {
        jsonGenerator
            .writeFieldName("SourceUserIdentifier")
            .writeValue(mergeDeveloperIdentitiesRequest.getSourceUserIdentifier());
      }
      if (mergeDeveloperIdentitiesRequest.getDestinationUserIdentifier() != null) {
        jsonGenerator
            .writeFieldName("DestinationUserIdentifier")
            .writeValue(mergeDeveloperIdentitiesRequest.getDestinationUserIdentifier());
      }
      if (mergeDeveloperIdentitiesRequest.getDeveloperProviderName() != null) {
        jsonGenerator
            .writeFieldName("DeveloperProviderName")
            .writeValue(mergeDeveloperIdentitiesRequest.getDeveloperProviderName());
      }
      if (mergeDeveloperIdentitiesRequest.getIdentityPoolId() != null) {
        jsonGenerator
            .writeFieldName("IdentityPoolId")
            .writeValue(mergeDeveloperIdentitiesRequest.getIdentityPoolId());
      }

      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;
  }
  public Request<BatchGetImageRequest> marshall(BatchGetImageRequest batchGetImageRequest) {

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

    Request<BatchGetImageRequest> request =
        new DefaultRequest<BatchGetImageRequest>(batchGetImageRequest, "AmazonECR");
    request.addHeader("X-Amz-Target", "AmazonEC2ContainerRegistry_V20150921.BatchGetImage");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (batchGetImageRequest.getRegistryId() != null) {
        jsonGenerator.writeFieldName("registryId").writeValue(batchGetImageRequest.getRegistryId());
      }
      if (batchGetImageRequest.getRepositoryName() != null) {
        jsonGenerator
            .writeFieldName("repositoryName")
            .writeValue(batchGetImageRequest.getRepositoryName());
      }

      java.util.List<ImageIdentifier> imageIdsList = batchGetImageRequest.getImageIds();
      if (imageIdsList != null) {
        jsonGenerator.writeFieldName("imageIds");
        jsonGenerator.writeStartArray();
        for (ImageIdentifier imageIdsListValue : imageIdsList) {
          if (imageIdsListValue != null) {

            ImageIdentifierJsonMarshaller.getInstance().marshall(imageIdsListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      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;
  }
  public Request<UpdateServiceRequest> marshall(UpdateServiceRequest updateServiceRequest) {

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

    Request<UpdateServiceRequest> request =
        new DefaultRequest<UpdateServiceRequest>(updateServiceRequest, "AmazonECS");
    request.addHeader("X-Amz-Target", "AmazonEC2ContainerServiceV20141113.UpdateService");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (updateServiceRequest.getCluster() != null) {
        jsonGenerator.writeFieldName("cluster").writeValue(updateServiceRequest.getCluster());
      }
      if (updateServiceRequest.getService() != null) {
        jsonGenerator.writeFieldName("service").writeValue(updateServiceRequest.getService());
      }
      if (updateServiceRequest.getDesiredCount() != null) {
        jsonGenerator
            .writeFieldName("desiredCount")
            .writeValue(updateServiceRequest.getDesiredCount());
      }
      if (updateServiceRequest.getTaskDefinition() != null) {
        jsonGenerator
            .writeFieldName("taskDefinition")
            .writeValue(updateServiceRequest.getTaskDefinition());
      }
      if (updateServiceRequest.getDeploymentConfiguration() != null) {
        jsonGenerator.writeFieldName("deploymentConfiguration");
        DeploymentConfigurationJsonMarshaller.getInstance()
            .marshall(updateServiceRequest.getDeploymentConfiguration(), jsonGenerator);
      }

      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;
  }
  public Request<CreateBasePathMappingRequest> marshall(
      CreateBasePathMappingRequest createBasePathMappingRequest) {

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

    Request<CreateBasePathMappingRequest> request =
        new DefaultRequest<CreateBasePathMappingRequest>(
            createBasePathMappingRequest, "AmazonApiGateway");

    request.setHttpMethod(HttpMethodName.POST);

    String uriResourcePath = "/domainnames/{domain_name}/basepathmappings";

    uriResourcePath =
        com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(
            uriResourcePath, "domain_name", createBasePathMappingRequest.getDomainName());
    request.setResourcePath(uriResourcePath);

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

      if (createBasePathMappingRequest.getBasePath() != null) {
        jsonGenerator
            .writeFieldName("basePath")
            .writeValue(createBasePathMappingRequest.getBasePath());
      }
      if (createBasePathMappingRequest.getRestApiId() != null) {
        jsonGenerator
            .writeFieldName("restApiId")
            .writeValue(createBasePathMappingRequest.getRestApiId());
      }
      if (createBasePathMappingRequest.getStage() != null) {
        jsonGenerator.writeFieldName("stage").writeValue(createBasePathMappingRequest.getStage());
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<CreatePlayerSessionsRequest> marshall(
      CreatePlayerSessionsRequest createPlayerSessionsRequest) {

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

    Request<CreatePlayerSessionsRequest> request =
        new DefaultRequest<CreatePlayerSessionsRequest>(
            createPlayerSessionsRequest, "AmazonGameLift");
    request.addHeader("X-Amz-Target", "GameLift.CreatePlayerSessions");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (createPlayerSessionsRequest.getGameSessionId() != null) {
        jsonGenerator
            .writeFieldName("GameSessionId")
            .writeValue(createPlayerSessionsRequest.getGameSessionId());
      }

      java.util.List<String> playerIdsList = createPlayerSessionsRequest.getPlayerIds();
      if (playerIdsList != null) {
        jsonGenerator.writeFieldName("PlayerIds");
        jsonGenerator.writeStartArray();
        for (String playerIdsListValue : playerIdsList) {
          if (playerIdsListValue != null) {
            jsonGenerator.writeValue(playerIdsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }

      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;
  }
  public Request<SetTaskStatusRequest> marshall(SetTaskStatusRequest setTaskStatusRequest) {

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

    Request<SetTaskStatusRequest> request =
        new DefaultRequest<SetTaskStatusRequest>(setTaskStatusRequest, "DataPipeline");
    request.addHeader("X-Amz-Target", "DataPipeline.SetTaskStatus");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (setTaskStatusRequest.getTaskId() != null) {
        jsonGenerator.writeFieldName("taskId").writeValue(setTaskStatusRequest.getTaskId());
      }
      if (setTaskStatusRequest.getTaskStatus() != null) {
        jsonGenerator.writeFieldName("taskStatus").writeValue(setTaskStatusRequest.getTaskStatus());
      }
      if (setTaskStatusRequest.getErrorId() != null) {
        jsonGenerator.writeFieldName("errorId").writeValue(setTaskStatusRequest.getErrorId());
      }
      if (setTaskStatusRequest.getErrorMessage() != null) {
        jsonGenerator
            .writeFieldName("errorMessage")
            .writeValue(setTaskStatusRequest.getErrorMessage());
      }
      if (setTaskStatusRequest.getErrorStackTrace() != null) {
        jsonGenerator
            .writeFieldName("errorStackTrace")
            .writeValue(setTaskStatusRequest.getErrorStackTrace());
      }

      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;
  }
  public Request<AddTagsRequest> marshall(AddTagsRequest addTagsRequest) {

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

    Request<AddTagsRequest> request =
        new DefaultRequest<AddTagsRequest>(addTagsRequest, "AWSElasticsearch");

    request.setHttpMethod(HttpMethodName.POST);

    String uriResourcePath = "/2015-01-01/tags";

    request.setResourcePath(uriResourcePath);

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

      if (addTagsRequest.getARN() != null) {
        jsonGenerator.writeFieldName("ARN").writeValue(addTagsRequest.getARN());
      }

      java.util.List<Tag> tagListList = addTagsRequest.getTagList();
      if (tagListList != null) {
        jsonGenerator.writeFieldName("TagList");
        jsonGenerator.writeStartArray();
        for (Tag tagListListValue : tagListList) {
          if (tagListListValue != null) {

            TagJsonMarshaller.getInstance().marshall(tagListListValue, jsonGenerator);
          }
        }
        jsonGenerator.writeEndArray();
      }

      jsonGenerator.writeEndObject();

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

    return request;
  }
  public Request<CreateKeyRequest> marshall(CreateKeyRequest createKeyRequest) {

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

    Request<CreateKeyRequest> request =
        new DefaultRequest<CreateKeyRequest>(createKeyRequest, "AWSKMS");
    request.addHeader("X-Amz-Target", "TrentService.CreateKey");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (createKeyRequest.getPolicy() != null) {
        jsonGenerator.writeFieldName("Policy").writeValue(createKeyRequest.getPolicy());
      }
      if (createKeyRequest.getDescription() != null) {
        jsonGenerator.writeFieldName("Description").writeValue(createKeyRequest.getDescription());
      }
      if (createKeyRequest.getKeyUsage() != null) {
        jsonGenerator.writeFieldName("KeyUsage").writeValue(createKeyRequest.getKeyUsage());
      }
      if (createKeyRequest.getOrigin() != null) {
        jsonGenerator.writeFieldName("Origin").writeValue(createKeyRequest.getOrigin());
      }
      if (createKeyRequest.getBypassPolicyLockoutSafetyCheck() != null) {
        jsonGenerator
            .writeFieldName("BypassPolicyLockoutSafetyCheck")
            .writeValue(createKeyRequest.getBypassPolicyLockoutSafetyCheck());
      }

      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;
  }
  public Request<RespondActivityTaskFailedRequest> marshall(
      RespondActivityTaskFailedRequest respondActivityTaskFailedRequest) {

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

    Request<RespondActivityTaskFailedRequest> request =
        new DefaultRequest<RespondActivityTaskFailedRequest>(
            respondActivityTaskFailedRequest, "AmazonSimpleWorkflow");
    request.addHeader("X-Amz-Target", "SimpleWorkflowService.RespondActivityTaskFailed");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (respondActivityTaskFailedRequest.getTaskToken() != null) {
        jsonGenerator
            .writeFieldName("taskToken")
            .writeValue(respondActivityTaskFailedRequest.getTaskToken());
      }
      if (respondActivityTaskFailedRequest.getReason() != null) {
        jsonGenerator
            .writeFieldName("reason")
            .writeValue(respondActivityTaskFailedRequest.getReason());
      }
      if (respondActivityTaskFailedRequest.getDetails() != null) {
        jsonGenerator
            .writeFieldName("details")
            .writeValue(respondActivityTaskFailedRequest.getDetails());
      }

      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;
  }
  public Request<DescribeRulesPackagesRequest> marshall(
      DescribeRulesPackagesRequest describeRulesPackagesRequest) {

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

    Request<DescribeRulesPackagesRequest> request =
        new DefaultRequest<DescribeRulesPackagesRequest>(
            describeRulesPackagesRequest, "AmazonInspector");
    request.addHeader("X-Amz-Target", "InspectorService.DescribeRulesPackages");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      java.util.List<String> rulesPackageArnsList =
          describeRulesPackagesRequest.getRulesPackageArns();
      if (rulesPackageArnsList != null) {
        jsonGenerator.writeFieldName("rulesPackageArns");
        jsonGenerator.writeStartArray();
        for (String rulesPackageArnsListValue : rulesPackageArnsList) {
          if (rulesPackageArnsListValue != null) {
            jsonGenerator.writeValue(rulesPackageArnsListValue);
          }
        }
        jsonGenerator.writeEndArray();
      }
      if (describeRulesPackagesRequest.getLocale() != null) {
        jsonGenerator.writeFieldName("locale").writeValue(describeRulesPackagesRequest.getLocale());
      }

      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;
  }
  public Request<CreateWebACLRequest> marshall(CreateWebACLRequest createWebACLRequest) {

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

    Request<CreateWebACLRequest> request =
        new DefaultRequest<CreateWebACLRequest>(createWebACLRequest, "AWSWAFRegional");
    request.addHeader("X-Amz-Target", "AWSWAF_Regional_20161128.CreateWebACL");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (createWebACLRequest.getName() != null) {
        jsonGenerator.writeFieldName("Name").writeValue(createWebACLRequest.getName());
      }
      if (createWebACLRequest.getMetricName() != null) {
        jsonGenerator.writeFieldName("MetricName").writeValue(createWebACLRequest.getMetricName());
      }
      if (createWebACLRequest.getDefaultAction() != null) {
        jsonGenerator.writeFieldName("DefaultAction");
        WafActionJsonMarshaller.getInstance()
            .marshall(createWebACLRequest.getDefaultAction(), jsonGenerator);
      }
      if (createWebACLRequest.getChangeToken() != null) {
        jsonGenerator
            .writeFieldName("ChangeToken")
            .writeValue(createWebACLRequest.getChangeToken());
      }

      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;
  }
  public Request<UpdateShardCountRequest> marshall(
      UpdateShardCountRequest updateShardCountRequest) {

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

    Request<UpdateShardCountRequest> request =
        new DefaultRequest<UpdateShardCountRequest>(updateShardCountRequest, "AmazonKinesis");
    request.addHeader("X-Amz-Target", "Kinesis_20131202.UpdateShardCount");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

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

      jsonGenerator.writeStartObject();

      if (updateShardCountRequest.getStreamName() != null) {
        jsonGenerator
            .writeFieldName("StreamName")
            .writeValue(updateShardCountRequest.getStreamName());
      }
      if (updateShardCountRequest.getTargetShardCount() != null) {
        jsonGenerator
            .writeFieldName("TargetShardCount")
            .writeValue(updateShardCountRequest.getTargetShardCount());
      }
      if (updateShardCountRequest.getScalingType() != null) {
        jsonGenerator
            .writeFieldName("ScalingType")
            .writeValue(updateShardCountRequest.getScalingType());
      }

      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;
  }