com.bitmovin.api.sdk.encoding.inputs.genericS3.GenericS3Api Maven / Gradle / Ivy
package com.bitmovin.api.sdk.encoding.inputs.genericS3;
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.genericS3.customdata.CustomdataApi;
public class GenericS3Api {
public final CustomdataApi customdata;
private final GenericS3ApiClient apiClient;
public GenericS3Api(BitmovinApiClientFactory clientFactory) {
if (clientFactory == null)
{
throw new IllegalArgumentException("Parameter 'clientFactory' may not be null.");
}
this.apiClient = clientFactory.createApiClient(GenericS3ApiClient.class);
this.customdata = new CustomdataApi(clientFactory);
}
/**
* Fluent builder for creating an instance of GenericS3Api
*/
public static BitmovinApiBuilder builder() {
return new BitmovinApiBuilder<>(GenericS3Api.class);
}
/**
* Create Generic S3 Input
*
* @param genericS3Input The GenericS3 input to be created (required)
* @return GenericS3Input
* @throws BitmovinException if fails to make API call
*/
public GenericS3Input create(GenericS3Input genericS3Input) throws BitmovinException {
try {
return this.apiClient.create(genericS3Input).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* Delete Generic S3 Input
*
* @param inputId Id of the input (required)
* @return GenericS3Input
* @throws BitmovinException if fails to make API call
*/
public GenericS3Input delete(String inputId) throws BitmovinException {
try {
return this.apiClient.delete(inputId).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* Generic S3 Input Details
*
* @param inputId Id of the input (required)
* @return GenericS3Input
* @throws BitmovinException if fails to make API call
*/
public GenericS3Input get(String inputId) throws BitmovinException {
try {
return this.apiClient.get(inputId).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
/**
* List Generic S3 Inputs
*
* @return List<GenericS3Input>
* @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 Generic S3 Inputs
*
* @param queryParams The query parameters for sorting, filtering and paging options (optional)
* @return List<GenericS3Input>
* @throws BitmovinException if fails to make API call
*/
public PaginationResponse list(GenericS3InputListQueryParams queryParams) throws BitmovinException {
try {
return this.apiClient.list(new QueryMapWrapper(queryParams)).getData().getResult();
} catch (Exception ex) {
throw buildBitmovinException(ex);
}
}
interface GenericS3ApiClient {
@RequestLine("POST /encoding/inputs/generic-s3")
ResponseEnvelope create(GenericS3Input genericS3Input) throws BitmovinException;
@RequestLine("DELETE /encoding/inputs/generic-s3/{input_id}")
ResponseEnvelope delete(@Param(value = "input_id") String inputId) throws BitmovinException;
@RequestLine("GET /encoding/inputs/generic-s3/{input_id}")
ResponseEnvelope get(@Param(value = "input_id") String inputId) throws BitmovinException;
@RequestLine("GET /encoding/inputs/generic-s3")
ResponseEnvelope> list(@QueryMap QueryMapWrapper queryParams) throws BitmovinException;
}
}