public Request<ListBootstrapActionsRequest> marshall( ListBootstrapActionsRequest listBootstrapActionsRequest) { if (listBootstrapActionsRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<ListBootstrapActionsRequest> request = new DefaultRequest<ListBootstrapActionsRequest>( listBootstrapActionsRequest, "AmazonElasticMapReduce"); String target = "ElasticMapReduce.ListBootstrapActions"; request.addHeader("X-Amz-Target", target); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); jsonWriter.object(); if (listBootstrapActionsRequest.getClusterId() != null) { jsonWriter.key("ClusterId").value(listBootstrapActionsRequest.getClusterId()); } if (listBootstrapActionsRequest.getMarker() != null) { jsonWriter.key("Marker").value(listBootstrapActionsRequest.getMarker()); } jsonWriter.endObject(); String snippet = stringWriter.toString(); byte[] content = snippet.getBytes(UTF8); request.setContent(new StringInputStream(snippet)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", "application/x-amz-json-1.1"); } catch (Throwable t) { throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t); } return request; }
public Request<DescribeInterconnectsRequest> marshall( DescribeInterconnectsRequest describeInterconnectsRequest) { if (describeInterconnectsRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<DescribeInterconnectsRequest> request = new DefaultRequest<DescribeInterconnectsRequest>( describeInterconnectsRequest, "AmazonDirectConnect"); String target = "OvertureService.DescribeInterconnects"; request.addHeader("X-Amz-Target", target); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); jsonWriter.object(); if (describeInterconnectsRequest.getInterconnectId() != null) { jsonWriter.key("interconnectId").value(describeInterconnectsRequest.getInterconnectId()); } jsonWriter.endObject(); String snippet = stringWriter.toString(); byte[] content = snippet.getBytes(UTF8); request.setContent(new StringInputStream(snippet)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", "application/x-amz-json-1.1"); } catch (Throwable t) { throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t); } return request; }
public Request<EnableDomainTransferLockRequest> marshall( EnableDomainTransferLockRequest enableDomainTransferLockRequest) { if (enableDomainTransferLockRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<EnableDomainTransferLockRequest> request = new DefaultRequest<EnableDomainTransferLockRequest>( enableDomainTransferLockRequest, "AmazonRoute53Domains"); String target = "Route53Domains_v20140515.EnableDomainTransferLock"; request.addHeader("X-Amz-Target", target); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); jsonWriter.object(); if (enableDomainTransferLockRequest.getDomainName() != null) { jsonWriter.key("DomainName").value(enableDomainTransferLockRequest.getDomainName()); } jsonWriter.endObject(); String snippet = stringWriter.toString(); byte[] content = snippet.getBytes(UTF8); request.setContent(new StringInputStream(snippet)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", "application/x-amz-json-1.1"); } catch (Throwable t) { throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t); } return request; }