public Request<GetDeploymentConfigRequest> marshall( GetDeploymentConfigRequest getDeploymentConfigRequest) { if (getDeploymentConfigRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<GetDeploymentConfigRequest> request = new DefaultRequest<GetDeploymentConfigRequest>( getDeploymentConfigRequest, "AmazonCodeDeploy"); request.addHeader("X-Amz-Target", "CodeDeploy_20141006.GetDeploymentConfig"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator(); jsonGenerator.writeStartObject(); if (getDeploymentConfigRequest.getDeploymentConfigName() != null) { jsonGenerator .writeFieldName("deploymentConfigName") .writeValue(getDeploymentConfigRequest.getDeploymentConfigName()); } 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; }