All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.waiter.SdkFunction.ftl Maven / Gradle / Ivy

Go to download

The AWS SDK for Java - Code Generator module holds the classes and templates required to generate the AWS Java SDK clients for AWS services.

There is a newer version: 1.11.8
Show newest version
${fileHeader}
<#assign inputType = operation.input.variableType>
<#assign outputType = operation.returnType.returnType>
<#assign input = operation.input.variableName>
<#assign operationName = operation.operationName>

package ${metadata.packageName}.waiters;

import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.waiters.SdkFunction;
import ${metadata.packageName}.model.${inputType};
import ${metadata.packageName}.model.${outputType};
import ${metadata.packageName}.${metadata.syncInterface};

@SdkInternalApi
public class ${operationName}Function implements SdkFunction<${inputType}, ${outputType}>{

    /**
     * Represents the service client
     */
    private final ${metadata.syncInterface} client;

    /**
      * Constructs a new ${operationName}Function with the
      * given client
      * @param client
      *         Service client
      */
    public ${operationName}Function(${metadata.syncInterface} client){
        this.client = client;
    }

    /**
      * Makes a call to the operation specified by the
      * waiter by taking the corresponding request and
      * returns the corresponding result
      * @param ${input}
      *          Corresponding request for the operation
      * @return Corresponding result of the operation
      */
    @Override
    public ${outputType} apply(${inputType} ${input}){
        return client.${waiter.operationMethodName}(${input});
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy