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

com.arm.mbed.cloud.sdk.common.CloudRequest Maven / Gradle / Ivy

Go to download

The Pelion Cloud SDK (formerly known as Mbed Cloud SDK) provides a simplified interface to the Pelion Cloud APIs by exposing functionality using conventions and paradigms familiar to Java developers.

There is a newer version: 2.5.0
Show newest version
package com.arm.mbed.cloud.sdk.common;

import com.arm.mbed.cloud.sdk.annotations.Preamble;
import com.arm.mbed.cloud.sdk.common.listing.ListOptions;
import com.arm.mbed.cloud.sdk.common.listing.ListResponse;

import retrofit2.Call;

/**
 * Request definition.
 *
 * @param 
 *            type of response object.
 * @param 
 *            service defining the API.
 */
@Preamble(description = "Generic cloud request definition")
public interface CloudRequest {
    /**
     * Defines how to create a request to Pelion Cloud based on parameters;
     *
     * @param service
     *            service defining the API.
     * @param parameters
     *            request parameters
     * @return request definition
     * @throws MbedCloudException
     *             if the parameters are invalid.
     */
    CloudCall defineCall(S service, Object... parameters) throws MbedCloudException;

    /**
     * Request definition for list endpoints/APIs.
     *
     * @param 
     *            type of the model being listed.
     * @param 
     *            service defining the API.
     * @param 
     *            list options.
     */
    interface CloudListRequest {
        /**
         * Defines how to create a request to Pelion Cloud based on parameters;
         *
         * @param service
         *            service defining the API.
         * @param options
         *            list options
         * @param extraParameters
         *            request parameters
         * @return request definition
         * @throws MbedCloudException
         *             if the parameters are invalid.
         */
        CloudCall> defineCall(S service, O options,
                                              Object... extraParameters) throws MbedCloudException;
    }

    /**
     * Defines a call to Pelion Cloud.
     *
     * @param 
     *            type of response object.
     */
    @Preamble(description = "Definition of a call to Pelion Cloud")
    interface CloudCall {
        /**
         * Defines a low level call.
         *
         * @return low level call definition.
         */
        Call call();
    }
}