Example usage for com.amazonaws.util StringUtils fromBoolean

List of usage examples for com.amazonaws.util StringUtils fromBoolean

Introduction

In this page you can find the example usage for com.amazonaws.util StringUtils fromBoolean.

Prototype

public static String fromBoolean(Boolean value) 

Source Link

Usage

From source file:com.github.sjones4.youcan.youare.model.transform.DeleteAccountRequestMarshaller.java

License:Open Source License

public Request<DeleteAccountRequest> marshall(DeleteAccountRequest deleteAccountRequest) {
    if (deleteAccountRequest == null) {
        throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }//ww w .  j a v  a2  s . c o  m
    Request<DeleteAccountRequest> request = new DefaultRequest<>(deleteAccountRequest,
            "AmazonIdentityManagement");
    request.addParameter("Action", "DeleteAccount");
    request.addParameter("Version", "2010-05-08");
    if (deleteAccountRequest.getAccountName() != null) {
        request.addParameter("AccountName", StringUtils.fromString(deleteAccountRequest.getAccountName()));
    }
    if (deleteAccountRequest.getRecursive() != null) {
        request.addParameter("Recursive", StringUtils.fromBoolean(deleteAccountRequest.getRecursive()));
    }
    return request;
}

From source file:com.github.sjones4.youcan.youtwo.model.transform.DescribeInstanceTypesRequestMarshaller.java

License:Open Source License

public Request<DescribeInstanceTypesRequest> marshall(
        DescribeInstanceTypesRequest describeInstanceTypesRequest) {

    if (describeInstanceTypesRequest == null) {
        throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }/*from w  w w.j  a v a 2 s .c o  m*/

    Request<DescribeInstanceTypesRequest> request = new DefaultRequest<>(describeInstanceTypesRequest,
            "AmazonEC2");
    request.addParameter("Action", "DescribeInstanceTypes");
    request.addParameter("Version", "2013-10-15");

    List<String> instanceTypesList = describeInstanceTypesRequest.getInstanceTypes();
    int instanceTypesListIndex = 1;

    for (String instanceTypesListValue : instanceTypesList) {
        if (instanceTypesListValue != null) {
            request.addParameter("InstanceType." + instanceTypesListIndex,
                    StringUtils.fromString(instanceTypesListValue));
        }

        instanceTypesListIndex++;
    }
    if (describeInstanceTypesRequest.getAvailability() != null) {
        request.addParameter("Availability",
                StringUtils.fromBoolean(describeInstanceTypesRequest.getAvailability()));
    }
    if (describeInstanceTypesRequest.getVerbose() != null) {
        request.addParameter("Verbose", StringUtils.fromBoolean(describeInstanceTypesRequest.getVerbose()));
    }

    return request;
}