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

com.bitmovin.api.sdk.analytics.queries.avg.AvgApi Maven / Gradle / Ivy

There is a newer version: 1.205.0
Show newest version
package com.bitmovin.api.sdk.analytics.queries.avg;

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;

public class AvgApi {

    private final AvgApiClient apiClient;

    public AvgApi(BitmovinApiClientFactory clientFactory) {
        if (clientFactory == null)
        {
            throw new IllegalArgumentException("Parameter 'clientFactory' may not be null.");
        }

        this.apiClient = clientFactory.createApiClient(AvgApiClient.class);

    }

    /**
     * Fluent builder for creating an instance of AvgApi
     */
    public static BitmovinApiBuilder builder() {
        return new BitmovinApiBuilder<>(AvgApi.class);
    }

    /**
     * Avg
     * 
     * @param analyticsAvgQueryRequest Analytics Query Object (required)
     * @return AnalyticsResponse
     * @throws BitmovinException if fails to make API call
     */
    public AnalyticsResponse create(AnalyticsAvgQueryRequest analyticsAvgQueryRequest) throws BitmovinException {
        try {
            return this.apiClient.create(analyticsAvgQueryRequest).getData().getResult();
        } catch (Exception ex) {
            throw buildBitmovinException(ex);
        }
    }

    interface AvgApiClient {

        @RequestLine("POST /analytics/queries/avg")
        ResponseEnvelope create(AnalyticsAvgQueryRequest analyticsAvgQueryRequest) throws BitmovinException;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy