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<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 = "2013-09-27/origin-access-identity/cloudfront?Marker={Marker}&MaxItems={MaxItems}"; uriResourcePath = uriResourcePath.replace( "{Marker}", getString(listCloudFrontOriginAccessIdentitiesRequest.getMarker())); uriResourcePath = uriResourcePath.replace( "{MaxItems}", getString(listCloudFrontOriginAccessIdentitiesRequest.getMaxItems())); if (uriResourcePath.contains("?")) { String queryString = uriResourcePath.substring(uriResourcePath.indexOf("?") + 1); uriResourcePath = uriResourcePath.substring(0, uriResourcePath.indexOf("?")); for (String s : queryString.split("[;&]")) { String[] nameValuePair = s.split("="); if (nameValuePair.length == 2) { request.addParameter(nameValuePair[0], nameValuePair[1]); } else { request.addParameter(s, null); } } } request.setResourcePath(uriResourcePath); return request; }