public Request<DeleteLifecycleHookRequest> marshall(
      DeleteLifecycleHookRequest deleteLifecycleHookRequest) {

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

    Request<DeleteLifecycleHookRequest> request =
        new DefaultRequest<DeleteLifecycleHookRequest>(
            deleteLifecycleHookRequest, "AmazonAutoScaling");
    request.addParameter("Action", "DeleteLifecycleHook");
    request.addParameter("Version", "2011-01-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (deleteLifecycleHookRequest.getLifecycleHookName() != null) {
      request.addParameter(
          "LifecycleHookName",
          StringUtils.fromString(deleteLifecycleHookRequest.getLifecycleHookName()));
    }

    if (deleteLifecycleHookRequest.getAutoScalingGroupName() != null) {
      request.addParameter(
          "AutoScalingGroupName",
          StringUtils.fromString(deleteLifecycleHookRequest.getAutoScalingGroupName()));
    }

    return request;
  }
  public Request<DeleteNotificationConfigurationRequest> marshall(
      DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest) {

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

    Request<DeleteNotificationConfigurationRequest> request =
        new DefaultRequest<DeleteNotificationConfigurationRequest>(
            deleteNotificationConfigurationRequest, "AmazonAutoScaling");
    request.addParameter("Action", "DeleteNotificationConfiguration");
    request.addParameter("Version", "2011-01-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (deleteNotificationConfigurationRequest.getAutoScalingGroupName() != null) {
      request.addParameter(
          "AutoScalingGroupName",
          StringUtils.fromString(deleteNotificationConfigurationRequest.getAutoScalingGroupName()));
    }

    if (deleteNotificationConfigurationRequest.getTopicARN() != null) {
      request.addParameter(
          "TopicARN", StringUtils.fromString(deleteNotificationConfigurationRequest.getTopicARN()));
    }

    return request;
  }
  public Request<CopyImageRequest> marshall(CopyImageRequest copyImageRequest) {

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

    Request<CopyImageRequest> request =
        new DefaultRequest<CopyImageRequest>(copyImageRequest, "AmazonEC2");
    request.addParameter("Action", "CopyImage");
    request.addParameter("Version", "2015-10-01");

    if (copyImageRequest.getSourceRegion() != null) {
      request.addParameter(
          "SourceRegion", StringUtils.fromString(copyImageRequest.getSourceRegion()));
    }
    if (copyImageRequest.getSourceImageId() != null) {
      request.addParameter(
          "SourceImageId", StringUtils.fromString(copyImageRequest.getSourceImageId()));
    }
    if (copyImageRequest.getName() != null) {
      request.addParameter("Name", StringUtils.fromString(copyImageRequest.getName()));
    }
    if (copyImageRequest.getDescription() != null) {
      request.addParameter(
          "Description", StringUtils.fromString(copyImageRequest.getDescription()));
    }
    if (copyImageRequest.getClientToken() != null) {
      request.addParameter(
          "ClientToken", StringUtils.fromString(copyImageRequest.getClientToken()));
    }

    return request;
  }
  public Request<DeleteClusterRequest> marshall(DeleteClusterRequest deleteClusterRequest) {

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

    Request<DeleteClusterRequest> request =
        new DefaultRequest<DeleteClusterRequest>(deleteClusterRequest, "AmazonRedshift");
    request.addParameter("Action", "DeleteCluster");
    request.addParameter("Version", "2012-12-01");

    if (deleteClusterRequest.getClusterIdentifier() != null) {
      request.addParameter(
          "ClusterIdentifier", StringUtils.fromString(deleteClusterRequest.getClusterIdentifier()));
    }
    if (deleteClusterRequest.isSkipFinalClusterSnapshot() != null) {
      request.addParameter(
          "SkipFinalClusterSnapshot",
          StringUtils.fromBoolean(deleteClusterRequest.isSkipFinalClusterSnapshot()));
    }
    if (deleteClusterRequest.getFinalClusterSnapshotIdentifier() != null) {
      request.addParameter(
          "FinalClusterSnapshotIdentifier",
          StringUtils.fromString(deleteClusterRequest.getFinalClusterSnapshotIdentifier()));
    }

    return request;
  }
  public Request<DescribeEngineDefaultParametersRequest> marshall(
      DescribeEngineDefaultParametersRequest describeEngineDefaultParametersRequest) {

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

    Request<DescribeEngineDefaultParametersRequest> request =
        new DefaultRequest<DescribeEngineDefaultParametersRequest>(
            describeEngineDefaultParametersRequest, "AmazonRDS");
    request.addParameter("Action", "DescribeEngineDefaultParameters");
    request.addParameter("Version", "2013-09-09");

    if (describeEngineDefaultParametersRequest.getDBParameterGroupFamily() != null) {
      request.addParameter(
          "DBParameterGroupFamily",
          StringUtils.fromString(
              describeEngineDefaultParametersRequest.getDBParameterGroupFamily()));
    }
    if (describeEngineDefaultParametersRequest.getMaxRecords() != null) {
      request.addParameter(
          "MaxRecords",
          StringUtils.fromInteger(describeEngineDefaultParametersRequest.getMaxRecords()));
    }
    if (describeEngineDefaultParametersRequest.getMarker() != null) {
      request.addParameter(
          "Marker", StringUtils.fromString(describeEngineDefaultParametersRequest.getMarker()));
    }

    return request;
  }
  private AWSCredentials fromStaticCredentials() {
    if (StringUtils.isNullOrEmpty(profile.getAwsAccessIdKey())) {
      throw new SdkClientException(
          String.format(
              "Unable to load credentials into profile [%s]: AWS Access Key ID is not specified.",
              profile.getProfileName()));
    }
    if (StringUtils.isNullOrEmpty(profile.getAwsSecretAccessKey())) {
      throw new SdkClientException(
          String.format(
              "Unable to load credentials into profile [%s]: AWS Secret Access Key is not specified.",
              profile.getAwsSecretAccessKey()));
    }

    if (profile.getAwsSessionToken() == null) {
      return new BasicAWSCredentials(profile.getAwsAccessIdKey(), profile.getAwsSecretAccessKey());
    } else {
      if (profile.getAwsSessionToken().isEmpty()) {
        throw new SdkClientException(
            String.format(
                "Unable to load credentials into profile [%s]: AWS Session Token is empty.",
                profile.getProfileName()));
      }

      return new BasicSessionCredentials(
          profile.getAwsAccessIdKey(),
          profile.getAwsSecretAccessKey(),
          profile.getAwsSessionToken());
    }
  }
  public Request<ChangeMessageVisibilityRequest> marshall(
      ChangeMessageVisibilityRequest changeMessageVisibilityRequest) {

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

    Request<ChangeMessageVisibilityRequest> request =
        new DefaultRequest<ChangeMessageVisibilityRequest>(
            changeMessageVisibilityRequest, "AmazonSQS");
    request.addParameter("Action", "ChangeMessageVisibility");
    request.addParameter("Version", "2012-11-05");
    request.setHttpMethod(HttpMethodName.POST);

    if (changeMessageVisibilityRequest.getQueueUrl() != null) {
      request.addParameter(
          "QueueUrl", StringUtils.fromString(changeMessageVisibilityRequest.getQueueUrl()));
    }

    if (changeMessageVisibilityRequest.getReceiptHandle() != null) {
      request.addParameter(
          "ReceiptHandle",
          StringUtils.fromString(changeMessageVisibilityRequest.getReceiptHandle()));
    }

    if (changeMessageVisibilityRequest.getVisibilityTimeout() != null) {
      request.addParameter(
          "VisibilityTimeout",
          StringUtils.fromInteger(changeMessageVisibilityRequest.getVisibilityTimeout()));
    }

    return request;
  }
  public Request<DeleteEnvironmentConfigurationRequest> marshall(
      DeleteEnvironmentConfigurationRequest deleteEnvironmentConfigurationRequest) {

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

    Request<DeleteEnvironmentConfigurationRequest> request =
        new DefaultRequest<DeleteEnvironmentConfigurationRequest>(
            deleteEnvironmentConfigurationRequest, "AWSElasticBeanstalk");
    request.addParameter("Action", "DeleteEnvironmentConfiguration");
    request.addParameter("Version", "2010-12-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (deleteEnvironmentConfigurationRequest.getApplicationName() != null) {
      request.addParameter(
          "ApplicationName",
          StringUtils.fromString(deleteEnvironmentConfigurationRequest.getApplicationName()));
    }

    if (deleteEnvironmentConfigurationRequest.getEnvironmentName() != null) {
      request.addParameter(
          "EnvironmentName",
          StringUtils.fromString(deleteEnvironmentConfigurationRequest.getEnvironmentName()));
    }

    return request;
  }
  public Request<DescribeClusterSubnetGroupsRequest> marshall(
      DescribeClusterSubnetGroupsRequest describeClusterSubnetGroupsRequest) {

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

    Request<DescribeClusterSubnetGroupsRequest> request =
        new DefaultRequest<DescribeClusterSubnetGroupsRequest>(
            describeClusterSubnetGroupsRequest, "AmazonRedshift");
    request.addParameter("Action", "DescribeClusterSubnetGroups");
    request.addParameter("Version", "2012-12-01");

    if (describeClusterSubnetGroupsRequest.getClusterSubnetGroupName() != null) {
      request.addParameter(
          "ClusterSubnetGroupName",
          StringUtils.fromString(describeClusterSubnetGroupsRequest.getClusterSubnetGroupName()));
    }
    if (describeClusterSubnetGroupsRequest.getMaxRecords() != null) {
      request.addParameter(
          "MaxRecords",
          StringUtils.fromInteger(describeClusterSubnetGroupsRequest.getMaxRecords()));
    }
    if (describeClusterSubnetGroupsRequest.getMarker() != null) {
      request.addParameter(
          "Marker", StringUtils.fromString(describeClusterSubnetGroupsRequest.getMarker()));
    }

    return request;
  }
  public Request<StopInstancesRequest> marshall(StopInstancesRequest stopInstancesRequest) {

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

    Request<StopInstancesRequest> request =
        new DefaultRequest<StopInstancesRequest>(stopInstancesRequest, "AmazonEC2");
    request.addParameter("Action", "StopInstances");
    request.addParameter("Version", "2016-04-01");
    request.setHttpMethod(HttpMethodName.POST);

    com.amazonaws.internal.SdkInternalList<String> instanceIdsList =
        (com.amazonaws.internal.SdkInternalList<String>) stopInstancesRequest.getInstanceIds();
    if (!instanceIdsList.isEmpty() || !instanceIdsList.isAutoConstruct()) {
      int instanceIdsListIndex = 1;

      for (String instanceIdsListValue : instanceIdsList) {
        if (instanceIdsListValue != null) {
          request.addParameter(
              "InstanceId." + instanceIdsListIndex, StringUtils.fromString(instanceIdsListValue));
        }
        instanceIdsListIndex++;
      }
    }

    if (stopInstancesRequest.getForce() != null) {
      request.addParameter("Force", StringUtils.fromBoolean(stopInstancesRequest.getForce()));
    }

    return request;
  }
  public Request<CreateAppCookieStickinessPolicyRequest> marshall(
      CreateAppCookieStickinessPolicyRequest createAppCookieStickinessPolicyRequest) {

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

    Request<CreateAppCookieStickinessPolicyRequest> request =
        new DefaultRequest<CreateAppCookieStickinessPolicyRequest>(
            createAppCookieStickinessPolicyRequest, "AmazonElasticLoadBalancing");
    request.addParameter("Action", "CreateAppCookieStickinessPolicy");
    request.addParameter("Version", "2011-11-15");

    if (createAppCookieStickinessPolicyRequest.getLoadBalancerName() != null) {
      request.addParameter(
          "LoadBalancerName",
          StringUtils.fromString(createAppCookieStickinessPolicyRequest.getLoadBalancerName()));
    }
    if (createAppCookieStickinessPolicyRequest.getPolicyName() != null) {
      request.addParameter(
          "PolicyName",
          StringUtils.fromString(createAppCookieStickinessPolicyRequest.getPolicyName()));
    }
    if (createAppCookieStickinessPolicyRequest.getCookieName() != null) {
      request.addParameter(
          "CookieName",
          StringUtils.fromString(createAppCookieStickinessPolicyRequest.getCookieName()));
    }

    return request;
  }
  public Request<DescribeStackEventsRequest> marshall(
      DescribeStackEventsRequest describeStackEventsRequest) {

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

    Request<DescribeStackEventsRequest> request =
        new DefaultRequest<DescribeStackEventsRequest>(
            describeStackEventsRequest, "AmazonCloudFormation");
    request.addParameter("Action", "DescribeStackEvents");
    request.addParameter("Version", "2010-05-15");
    request.setHttpMethod(HttpMethodName.POST);

    if (describeStackEventsRequest.getStackName() != null) {
      request.addParameter(
          "StackName", StringUtils.fromString(describeStackEventsRequest.getStackName()));
    }

    if (describeStackEventsRequest.getNextToken() != null) {
      request.addParameter(
          "NextToken", StringUtils.fromString(describeStackEventsRequest.getNextToken()));
    }

    return request;
  }
  public Request<DescribeInstanceAttributeRequest> marshall(
      DescribeInstanceAttributeRequest describeInstanceAttributeRequest) {

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

    Request<DescribeInstanceAttributeRequest> request =
        new DefaultRequest<DescribeInstanceAttributeRequest>(
            describeInstanceAttributeRequest, "AmazonEC2");
    request.addParameter("Action", "DescribeInstanceAttribute");
    request.addParameter("Version", "2015-10-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (describeInstanceAttributeRequest.getInstanceId() != null) {
      request.addParameter(
          "InstanceId", StringUtils.fromString(describeInstanceAttributeRequest.getInstanceId()));
    }

    if (describeInstanceAttributeRequest.getAttribute() != null) {
      request.addParameter(
          "Attribute", StringUtils.fromString(describeInstanceAttributeRequest.getAttribute()));
    }

    return request;
  }
  public Request<RevokeSnapshotAccessRequest> marshall(
      RevokeSnapshotAccessRequest revokeSnapshotAccessRequest) {

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

    Request<RevokeSnapshotAccessRequest> request =
        new DefaultRequest<RevokeSnapshotAccessRequest>(
            revokeSnapshotAccessRequest, "AmazonRedshift");
    request.addParameter("Action", "RevokeSnapshotAccess");
    request.addParameter("Version", "2012-12-01");

    if (revokeSnapshotAccessRequest.getSnapshotIdentifier() != null) {
      request.addParameter(
          "SnapshotIdentifier",
          StringUtils.fromString(revokeSnapshotAccessRequest.getSnapshotIdentifier()));
    }
    if (revokeSnapshotAccessRequest.getSnapshotClusterIdentifier() != null) {
      request.addParameter(
          "SnapshotClusterIdentifier",
          StringUtils.fromString(revokeSnapshotAccessRequest.getSnapshotClusterIdentifier()));
    }
    if (revokeSnapshotAccessRequest.getAccountWithRestoreAccess() != null) {
      request.addParameter(
          "AccountWithRestoreAccess",
          StringUtils.fromString(revokeSnapshotAccessRequest.getAccountWithRestoreAccess()));
    }

    return request;
  }
  public Request<CreateDBParameterGroupRequest> marshall(
      CreateDBParameterGroupRequest createDBParameterGroupRequest) {
    Request<CreateDBParameterGroupRequest> request =
        new DefaultRequest<CreateDBParameterGroupRequest>(
            createDBParameterGroupRequest, "AmazonRDS");
    request.addParameter("Action", "CreateDBParameterGroup");
    request.addParameter("Version", "2011-04-01");
    if (createDBParameterGroupRequest != null) {
      if (createDBParameterGroupRequest.getDBParameterGroupName() != null) {
        request.addParameter(
            "DBParameterGroupName",
            StringUtils.fromString(createDBParameterGroupRequest.getDBParameterGroupName()));
      }
    }
    if (createDBParameterGroupRequest != null) {
      if (createDBParameterGroupRequest.getDBParameterGroupFamily() != null) {
        request.addParameter(
            "DBParameterGroupFamily",
            StringUtils.fromString(createDBParameterGroupRequest.getDBParameterGroupFamily()));
      }
    }
    if (createDBParameterGroupRequest != null) {
      if (createDBParameterGroupRequest.getDescription() != null) {
        request.addParameter(
            "Description", StringUtils.fromString(createDBParameterGroupRequest.getDescription()));
      }
    }

    return request;
  }
  public Request<AddClientIDToOpenIDConnectProviderRequest> marshall(
      AddClientIDToOpenIDConnectProviderRequest addClientIDToOpenIDConnectProviderRequest) {

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

    Request<AddClientIDToOpenIDConnectProviderRequest> request =
        new DefaultRequest<AddClientIDToOpenIDConnectProviderRequest>(
            addClientIDToOpenIDConnectProviderRequest, "AmazonIdentityManagement");
    request.addParameter("Action", "AddClientIDToOpenIDConnectProvider");
    request.addParameter("Version", "2010-05-08");
    request.setHttpMethod(HttpMethodName.POST);

    if (addClientIDToOpenIDConnectProviderRequest.getOpenIDConnectProviderArn() != null) {
      request.addParameter(
          "OpenIDConnectProviderArn",
          StringUtils.fromString(
              addClientIDToOpenIDConnectProviderRequest.getOpenIDConnectProviderArn()));
    }

    if (addClientIDToOpenIDConnectProviderRequest.getClientID() != null) {
      request.addParameter(
          "ClientID",
          StringUtils.fromString(addClientIDToOpenIDConnectProviderRequest.getClientID()));
    }

    return request;
  }
  public Request<DisableVgwRoutePropagationRequest> marshall(
      DisableVgwRoutePropagationRequest disableVgwRoutePropagationRequest) {

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

    Request<DisableVgwRoutePropagationRequest> request =
        new DefaultRequest<DisableVgwRoutePropagationRequest>(
            disableVgwRoutePropagationRequest, "AmazonEC2");
    request.addParameter("Action", "DisableVgwRoutePropagation");
    request.addParameter("Version", "2015-10-01");

    if (disableVgwRoutePropagationRequest.getRouteTableId() != null) {
      request.addParameter(
          "RouteTableId",
          StringUtils.fromString(disableVgwRoutePropagationRequest.getRouteTableId()));
    }
    if (disableVgwRoutePropagationRequest.getGatewayId() != null) {
      request.addParameter(
          "GatewayId", StringUtils.fromString(disableVgwRoutePropagationRequest.getGatewayId()));
    }

    return request;
  }
  public Request<DetachPrincipalPolicyRequest> marshall(
      DetachPrincipalPolicyRequest detachPrincipalPolicyRequest) {

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

    Request<DetachPrincipalPolicyRequest> request =
        new DefaultRequest<DetachPrincipalPolicyRequest>(detachPrincipalPolicyRequest, "AWSIot");

    request.setHttpMethod(HttpMethodName.DELETE);

    if (detachPrincipalPolicyRequest.getPrincipal() != null) {
      request.addHeader(
          "x-amzn-iot-principal",
          StringUtils.fromString(detachPrincipalPolicyRequest.getPrincipal()));
    }

    String uriResourcePath = "/principal-policies/{policyName}";

    uriResourcePath =
        uriResourcePath.replace(
            "{policyName}",
            (detachPrincipalPolicyRequest.getPolicyName() == null)
                ? ""
                : StringUtils.fromString(detachPrincipalPolicyRequest.getPolicyName()));
    request.setResourcePath(uriResourcePath);

    request.setContent(new ByteArrayInputStream(new byte[0]));
    if (!request.getHeaders().containsKey("Content-Type")) {
      request.addHeader("Content-Type", DEFAULT_CONTENT_TYPE);
    }

    return request;
  }
  public Request<CreateImageRequest> marshall(CreateImageRequest createImageRequest) {

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

    Request<CreateImageRequest> request =
        new DefaultRequest<CreateImageRequest>(createImageRequest, "AmazonEC2");
    request.addParameter("Action", "CreateImage");
    request.addParameter("Version", "2012-04-01");

    if (createImageRequest.getInstanceId() != null) {
      request.addParameter(
          "InstanceId", StringUtils.fromString(createImageRequest.getInstanceId()));
    }
    if (createImageRequest.getName() != null) {
      request.addParameter("Name", StringUtils.fromString(createImageRequest.getName()));
    }
    if (createImageRequest.getDescription() != null) {
      request.addParameter(
          "Description", StringUtils.fromString(createImageRequest.getDescription()));
    }
    if (createImageRequest.isNoReboot() != null) {
      request.addParameter("NoReboot", StringUtils.fromBoolean(createImageRequest.isNoReboot()));
    }

    return request;
  }
  public Request<DeleteDBInstanceRequest> marshall(
      DeleteDBInstanceRequest deleteDBInstanceRequest) {
    Request<DeleteDBInstanceRequest> request =
        new DefaultRequest<DeleteDBInstanceRequest>(deleteDBInstanceRequest, "AmazonRDS");
    request.addParameter("Action", "DeleteDBInstance");
    request.addParameter("Version", "2010-07-28");
    if (deleteDBInstanceRequest != null) {
      if (deleteDBInstanceRequest.getDBInstanceIdentifier() != null) {
        request.addParameter(
            "DBInstanceIdentifier",
            StringUtils.fromString(deleteDBInstanceRequest.getDBInstanceIdentifier()));
      }
    }
    if (deleteDBInstanceRequest != null) {
      if (deleteDBInstanceRequest.isSkipFinalSnapshot() != null) {
        request.addParameter(
            "SkipFinalSnapshot",
            StringUtils.fromBoolean(deleteDBInstanceRequest.isSkipFinalSnapshot()));
      }
    }
    if (deleteDBInstanceRequest != null) {
      if (deleteDBInstanceRequest.getFinalDBSnapshotIdentifier() != null) {
        request.addParameter(
            "FinalDBSnapshotIdentifier",
            StringUtils.fromString(deleteDBInstanceRequest.getFinalDBSnapshotIdentifier()));
      }
    }

    return request;
  }
  public Request<ApplyPendingMaintenanceActionRequest> marshall(
      ApplyPendingMaintenanceActionRequest applyPendingMaintenanceActionRequest) {

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

    Request<ApplyPendingMaintenanceActionRequest> request =
        new DefaultRequest<ApplyPendingMaintenanceActionRequest>(
            applyPendingMaintenanceActionRequest, "AmazonRDS");
    request.addParameter("Action", "ApplyPendingMaintenanceAction");
    request.addParameter("Version", "2014-10-31");
    request.setHttpMethod(HttpMethodName.POST);

    if (applyPendingMaintenanceActionRequest.getResourceIdentifier() != null) {
      request.addParameter(
          "ResourceIdentifier",
          StringUtils.fromString(applyPendingMaintenanceActionRequest.getResourceIdentifier()));
    }

    if (applyPendingMaintenanceActionRequest.getApplyAction() != null) {
      request.addParameter(
          "ApplyAction",
          StringUtils.fromString(applyPendingMaintenanceActionRequest.getApplyAction()));
    }

    if (applyPendingMaintenanceActionRequest.getOptInType() != null) {
      request.addParameter(
          "OptInType", StringUtils.fromString(applyPendingMaintenanceActionRequest.getOptInType()));
    }

    return request;
  }
  public Request<CreateReceiptFilterRequest> marshall(
      CreateReceiptFilterRequest createReceiptFilterRequest) {

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

    Request<CreateReceiptFilterRequest> request =
        new DefaultRequest<CreateReceiptFilterRequest>(
            createReceiptFilterRequest, "AmazonSimpleEmailService");
    request.addParameter("Action", "CreateReceiptFilter");
    request.addParameter("Version", "2010-12-01");

    ReceiptFilter receiptFilterFilter = createReceiptFilterRequest.getFilter();
    if (receiptFilterFilter != null) {
      if (receiptFilterFilter.getName() != null) {
        request.addParameter("Filter.Name", StringUtils.fromString(receiptFilterFilter.getName()));
      }
      ReceiptIpFilter receiptIpFilterIpFilter = receiptFilterFilter.getIpFilter();
      if (receiptIpFilterIpFilter != null) {
        if (receiptIpFilterIpFilter.getPolicy() != null) {
          request.addParameter(
              "Filter.IpFilter.Policy",
              StringUtils.fromString(receiptIpFilterIpFilter.getPolicy()));
        }
        if (receiptIpFilterIpFilter.getCidr() != null) {
          request.addParameter(
              "Filter.IpFilter.Cidr", StringUtils.fromString(receiptIpFilterIpFilter.getCidr()));
        }
      }
    }

    return request;
  }
  public Request<CreateRoleRequest> marshall(CreateRoleRequest createRoleRequest) {

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

    Request<CreateRoleRequest> request =
        new DefaultRequest<CreateRoleRequest>(createRoleRequest, "AmazonIdentityManagement");
    request.addParameter("Action", "CreateRole");
    request.addParameter("Version", "2010-05-08");
    request.setHttpMethod(HttpMethodName.POST);

    if (createRoleRequest.getPath() != null) {
      request.addParameter("Path", StringUtils.fromString(createRoleRequest.getPath()));
    }

    if (createRoleRequest.getRoleName() != null) {
      request.addParameter("RoleName", StringUtils.fromString(createRoleRequest.getRoleName()));
    }

    if (createRoleRequest.getAssumeRolePolicyDocument() != null) {
      request.addParameter(
          "AssumeRolePolicyDocument",
          StringUtils.fromString(createRoleRequest.getAssumeRolePolicyDocument()));
    }

    return request;
  }
  public Request<UpdateUserRequest> marshall(UpdateUserRequest updateUserRequest) {

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

    Request<UpdateUserRequest> request =
        new DefaultRequest<UpdateUserRequest>(updateUserRequest, "AmazonIdentityManagement");
    request.addParameter("Action", "UpdateUser");
    request.addParameter("Version", "2010-05-08");
    request.setHttpMethod(HttpMethodName.POST);

    if (updateUserRequest.getUserName() != null) {
      request.addParameter("UserName", StringUtils.fromString(updateUserRequest.getUserName()));
    }

    if (updateUserRequest.getNewPath() != null) {
      request.addParameter("NewPath", StringUtils.fromString(updateUserRequest.getNewPath()));
    }

    if (updateUserRequest.getNewUserName() != null) {
      request.addParameter(
          "NewUserName", StringUtils.fromString(updateUserRequest.getNewUserName()));
    }

    return request;
  }
  public Request<SendMessageRequest> marshall(SendMessageRequest sendMessageRequest) {

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

    Request<SendMessageRequest> request =
        new DefaultRequest<SendMessageRequest>(sendMessageRequest, "AmazonSQS");
    request.addParameter("Action", "SendMessage");
    request.addParameter("Version", "2012-11-05");

    if (sendMessageRequest.getQueueUrl() != null) {
      request.addParameter("QueueUrl", StringUtils.fromString(sendMessageRequest.getQueueUrl()));
    }
    if (sendMessageRequest.getMessageBody() != null) {
      request.addParameter(
          "MessageBody", StringUtils.fromString(sendMessageRequest.getMessageBody()));
    }
    if (sendMessageRequest.getDelaySeconds() != null) {
      request.addParameter(
          "DelaySeconds", StringUtils.fromInteger(sendMessageRequest.getDelaySeconds()));
    }

    return request;
  }
  public Request<ListInstanceProfilesRequest> marshall(
      ListInstanceProfilesRequest listInstanceProfilesRequest) {

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

    Request<ListInstanceProfilesRequest> request =
        new DefaultRequest<ListInstanceProfilesRequest>(
            listInstanceProfilesRequest, "AmazonIdentityManagement");
    request.addParameter("Action", "ListInstanceProfiles");
    request.addParameter("Version", "2010-05-08");
    request.setHttpMethod(HttpMethodName.POST);

    if (listInstanceProfilesRequest.getPathPrefix() != null) {
      request.addParameter(
          "PathPrefix", StringUtils.fromString(listInstanceProfilesRequest.getPathPrefix()));
    }

    if (listInstanceProfilesRequest.getMarker() != null) {
      request.addParameter(
          "Marker", StringUtils.fromString(listInstanceProfilesRequest.getMarker()));
    }

    if (listInstanceProfilesRequest.getMaxItems() != null) {
      request.addParameter(
          "MaxItems", StringUtils.fromInteger(listInstanceProfilesRequest.getMaxItems()));
    }

    return request;
  }
  public Request<ListCloudFrontOriginAccessIdentitiesRequest> marshall(
      ListCloudFrontOriginAccessIdentitiesRequest listCloudFrontOriginAccessIdentitiesRequest) {

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

    Request<ListCloudFrontOriginAccessIdentitiesRequest> request =
        new DefaultRequest<ListCloudFrontOriginAccessIdentitiesRequest>(
            listCloudFrontOriginAccessIdentitiesRequest, "AmazonCloudFront");

    request.setHttpMethod(HttpMethodName.GET);

    String uriResourcePath = "/2016-01-28/origin-access-identity/cloudfront";

    request.setResourcePath(uriResourcePath);

    if (listCloudFrontOriginAccessIdentitiesRequest.getMarker() != null) {
      request.addParameter(
          "Marker",
          StringUtils.fromString(listCloudFrontOriginAccessIdentitiesRequest.getMarker()));
    }

    if (listCloudFrontOriginAccessIdentitiesRequest.getMaxItems() != null) {
      request.addParameter(
          "MaxItems",
          StringUtils.fromString(listCloudFrontOriginAccessIdentitiesRequest.getMaxItems()));
    }

    return request;
  }
  public Request<DescribeLoadBalancersRequest> marshall(
      DescribeLoadBalancersRequest describeLoadBalancersRequest) {

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

    Request<DescribeLoadBalancersRequest> request =
        new DefaultRequest<DescribeLoadBalancersRequest>(
            describeLoadBalancersRequest, "AmazonAutoScaling");
    request.addParameter("Action", "DescribeLoadBalancers");
    request.addParameter("Version", "2011-01-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (describeLoadBalancersRequest.getAutoScalingGroupName() != null) {
      request.addParameter(
          "AutoScalingGroupName",
          StringUtils.fromString(describeLoadBalancersRequest.getAutoScalingGroupName()));
    }

    if (describeLoadBalancersRequest.getNextToken() != null) {
      request.addParameter(
          "NextToken", StringUtils.fromString(describeLoadBalancersRequest.getNextToken()));
    }

    if (describeLoadBalancersRequest.getMaxRecords() != null) {
      request.addParameter(
          "MaxRecords", StringUtils.fromInteger(describeLoadBalancersRequest.getMaxRecords()));
    }

    return request;
  }
  public Request<UpdateServerCertificateRequest> marshall(
      UpdateServerCertificateRequest updateServerCertificateRequest) {

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

    Request<UpdateServerCertificateRequest> request =
        new DefaultRequest<UpdateServerCertificateRequest>(
            updateServerCertificateRequest, "AmazonIdentityManagement");
    request.addParameter("Action", "UpdateServerCertificate");
    request.addParameter("Version", "2010-05-08");

    if (updateServerCertificateRequest.getServerCertificateName() != null) {
      request.addParameter(
          "ServerCertificateName",
          StringUtils.fromString(updateServerCertificateRequest.getServerCertificateName()));
    }
    if (updateServerCertificateRequest.getNewPath() != null) {
      request.addParameter(
          "NewPath", StringUtils.fromString(updateServerCertificateRequest.getNewPath()));
    }
    if (updateServerCertificateRequest.getNewServerCertificateName() != null) {
      request.addParameter(
          "NewServerCertificateName",
          StringUtils.fromString(updateServerCertificateRequest.getNewServerCertificateName()));
    }

    return request;
  }
  public Request<ResumeProcessesRequest> marshall(ResumeProcessesRequest resumeProcessesRequest) {

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

    Request<ResumeProcessesRequest> request =
        new DefaultRequest<ResumeProcessesRequest>(resumeProcessesRequest, "AmazonAutoScaling");
    request.addParameter("Action", "ResumeProcesses");
    request.addParameter("Version", "2011-01-01");

    if (resumeProcessesRequest.getAutoScalingGroupName() != null) {
      request.addParameter(
          "AutoScalingGroupName",
          StringUtils.fromString(resumeProcessesRequest.getAutoScalingGroupName()));
    }

    java.util.List<String> scalingProcessesList = resumeProcessesRequest.getScalingProcesses();
    int scalingProcessesListIndex = 1;

    for (String scalingProcessesListValue : scalingProcessesList) {
      if (scalingProcessesListValue != null) {
        request.addParameter(
            "ScalingProcesses.member." + scalingProcessesListIndex,
            StringUtils.fromString(scalingProcessesListValue));
      }

      scalingProcessesListIndex++;
    }

    return request;
  }