com.bitmovin.api.sdk.encoding.inputs.azure.AzureApi Maven / Gradle / Ivy
package com.bitmovin.api.sdk.encoding.inputs.azure;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
import feign.Body;
import feign.Headers;
import com.bitmovin.api.sdk.model.*;
import com.bitmovin.api.sdk.common.BitmovinException;
import static com.bitmovin.api.sdk.common.BitmovinExceptionFactory.buildBitmovinException;
import com.bitmovin.api.sdk.common.BitmovinDateExpander;
import com.bitmovin.api.sdk.common.QueryMapWrapper;
import com.bitmovin.api.sdk.common.BitmovinApiBuilder;
import com.bitmovin.api.sdk.common.BitmovinApiClientFactory;
import com.bitmovin.api.sdk.encoding.inputs.azure.customdata.CustomdataApi;
public class AzureApi {
public final CustomdataApi customdata;
private final AzureApiClient apiClient;
public AzureApi(BitmovinApiClientFactory clientFactory) {
if (clientFactory == null)
{
throw new IllegalArgumentException("Parameter 'clientFactory' may not be null.");
}
this.apiClient = clientFactory.createApiClient(AzureApiClient.class);
this.customdata = new CustomdataApi(clientFactory);
}
/**
* Fluent builder for creating an instance of AzureApi
*/
public static BitmovinApiBuilder builder() {
return new BitmovinApiBuilder<>(AzureApi.class);
}
/**
* Create Azure Input
*
* @param azureInput The Azure input to be created (required)
* @return AzureInput
* @throws BitmovinException if fails to make API call
*/
public AzureInput create(AzureInput azureInput) throws BitmovinException {
try {
return this.apiClient.create(azureInput).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* Delete Azure Input
*
* @param inputId Id of the input (required)
* @return AzureInput
* @throws BitmovinException if fails to make API call
*/
public AzureInput delete(String inputId) throws BitmovinException {
try {
return this.apiClient.delete(inputId).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* Azure Input Details
*
* @param inputId Id of the input (required)
* @return AzureInput
* @throws BitmovinException if fails to make API call
*/
public AzureInput get(String inputId) throws BitmovinException {
try {
return this.apiClient.get(inputId).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* List Azure Inputs
*
* @return List<AzureInput>
* @throws BitmovinException if fails to make API call
*/
public PaginationResponse list() throws BitmovinException {
try {
return this.apiClient.list(new QueryMapWrapper()).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* List Azure Inputs
*
* @param queryParams The query parameters for sorting, filtering and paging options (optional)
* @return List<AzureInput>
* @throws BitmovinException if fails to make API call
*/
public PaginationResponse list(AzureInputListQueryParams queryParams) throws BitmovinException {
try {
return this.apiClient.list(new QueryMapWrapper(queryParams)).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
interface AzureApiClient {
@RequestLine("POST /encoding/inputs/azure")
ResponseEnvelope create(AzureInput azureInput) throws BitmovinException;
@RequestLine("DELETE /encoding/inputs/azure/{input_id}")
ResponseEnvelope delete(@Param(value = "input_id") String inputId) throws BitmovinException;
@RequestLine("GET /encoding/inputs/azure/{input_id}")
ResponseEnvelope get(@Param(value = "input_id") String inputId) throws BitmovinException;
@RequestLine("GET /encoding/inputs/azure")
ResponseEnvelope> list(@QueryMap QueryMapWrapper queryParams) throws BitmovinException;
}
}