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

com.logmein.gotowebinar.api.SessionsApi Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
/*
 * © 2017 LogMeIn, Inc. All Rights Reserved.
 * All rights reserved.
 * 
 * This software is distributed under the terms and conditions of the
 * LogMeIn SDK License Agreement. Please see file LICENSE for details.
 * 
 * Auto-generated file.
 */


package com.logmein.gotowebinar.api;

import com.logmein.gotowebinar.api.common.ApiException;
import com.logmein.gotowebinar.api.common.ApiInvoker;
import com.logmein.gotowebinar.api.common.JsonUtil;
import com.logmein.gotowebinar.api.model.Attendee;
import com.logmein.gotowebinar.api.model.AttendeeQuestion;
import com.logmein.gotowebinar.api.model.Poll;
import com.logmein.gotowebinar.api.model.ReportingSessionsResponse;
import com.logmein.gotowebinar.api.model.SessionPerformance;
import com.sun.jersey.multipart.FormDataMultiPart;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SessionsApi {

    private String basePath = "https://api.getgo.com/G2W/rest/v2";
    private ApiInvoker apiInvoker = ApiInvoker.getInstance();

    /**
      * Initializes a new instance of the SessionsApi class using the
      * default endpoint base url for the services being accessed.
      */
    public SessionsApi() {
    }
    
    /**
      * Initializes a new instance of the SessionsApi class using an endpoint base
      * url other than the default. Use this constructor only if you should need
      * to override the default endpoint base url.
      * @param basePath The endpoint base url for the services being accessed.
      */
    public SessionsApi(String basePath) {
        this.basePath = basePath;
    }

    public ApiInvoker getInvoker() {
        return apiInvoker;
    }
  
    public String getBasePath() {
        return basePath;
    }

    /**
     * Get webinar sessions
     * Retrieves details for all past sessions of a specific webinar.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param page The page number to be displayed. The first page is 0.
     * @param size The size of the page.
     * @return ReportingSessionsResponse
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public ReportingSessionsResponse getAllSessions(String authorization, Long organizerKey, Long webinarKey, Long page, Long size) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        String pageString = JsonUtil.Stringify(page);
        if(!"null".equals(pageString)){
            queryParams.put("page", pageString);
        }

        String sizeString = JsonUtil.Stringify(size);
        if(!"null".equals(sizeString)){
            queryParams.put("size", sizeString);
        }

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (ReportingSessionsResponse) ApiInvoker.deserialize(response, "", ReportingSessionsResponse.class);
        }
        return null;
    }

    /**
     * Get organizer sessions
     * Retrieve all completed sessions of all the webinars of a given organizer.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param fromTime A required start of datetime range in ISO8601 UTC format, e.g. 2015-07-13T10:00:00Z
     * @param toTime A required end of datetime range in ISO8601 UTC format, e.g. 2015-07-13T22:00:00Z
     * @param page The page number to be displayed. The first page is 0.
     * @param size The size of the page.
     * @return ReportingSessionsResponse
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public ReportingSessionsResponse getOrganizerSessions(String authorization, Long organizerKey, Date fromTime, Date toTime, Long page, Long size) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(fromTime == null) {
            throw new ApiException("Required parameter fromTime is null.");
        }

        if(toTime == null) {
            throw new ApiException("Required parameter toTime is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/sessions"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        String fromTimeString = JsonUtil.Stringify(fromTime);
        if(!"null".equals(fromTimeString)){
            queryParams.put("fromTime", fromTimeString);
        }

        String toTimeString = JsonUtil.Stringify(toTime);
        if(!"null".equals(toTimeString)){
            queryParams.put("toTime", toTimeString);
        }

        String pageString = JsonUtil.Stringify(page);
        if(!"null".equals(pageString)){
            queryParams.put("page", pageString);
        }

        String sizeString = JsonUtil.Stringify(size);
        if(!"null".equals(sizeString)){
            queryParams.put("size", sizeString);
        }

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (ReportingSessionsResponse) ApiInvoker.deserialize(response, "", ReportingSessionsResponse.class);
        }
        return null;
    }

    /**
     * Get session performance
     * Get performance details for a session.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param sessionKey The key of the webinar session
     * @return SessionPerformance
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public SessionPerformance getPerformance(String authorization, Long organizerKey, Long webinarKey, Long sessionKey) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        if(sessionKey == null) {
            throw new ApiException("Required parameter sessionKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions/{sessionKey}/performance"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()))
                .replaceAll("\\{" + "sessionKey" + "\\}", apiInvoker.escapeString(sessionKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (SessionPerformance) ApiInvoker.deserialize(response, "", SessionPerformance.class);
        }
        return null;
    }

    /**
     * Get session polls
     * Retrieve all collated attendee questions and answers for polls from a specific webinar session.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param sessionKey The key of the webinar session
     * @return List<Poll>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List getPolls(String authorization, Long organizerKey, Long webinarKey, Long sessionKey) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        if(sessionKey == null) {
            throw new ApiException("Required parameter sessionKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions/{sessionKey}/polls"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()))
                .replaceAll("\\{" + "sessionKey" + "\\}", apiInvoker.escapeString(sessionKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (List) ApiInvoker.deserialize(response, "List", Poll.class);
        }
        return null;
    }

    /**
     * Get session questions
     * Retrieve questions and answers for a past webinar session.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param sessionKey The key of the webinar session
     * @return List<AttendeeQuestion>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List getQuestions(String authorization, Long organizerKey, Long webinarKey, Long sessionKey) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        if(sessionKey == null) {
            throw new ApiException("Required parameter sessionKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions/{sessionKey}/questions"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()))
                .replaceAll("\\{" + "sessionKey" + "\\}", apiInvoker.escapeString(sessionKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (List) ApiInvoker.deserialize(response, "List", AttendeeQuestion.class);
        }
        return null;
    }

    /**
     * Get session surveys
     * Retrieve surveys for a past webinar session.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param sessionKey The key of the webinar session
     * @return List<Poll>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List getSurveys(String authorization, Long organizerKey, Long webinarKey, Long sessionKey) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        if(sessionKey == null) {
            throw new ApiException("Required parameter sessionKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions/{sessionKey}/surveys"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()))
                .replaceAll("\\{" + "sessionKey" + "\\}", apiInvoker.escapeString(sessionKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (List) ApiInvoker.deserialize(response, "List", Poll.class);
        }
        return null;
    }

    /**
     * Get webinar session
     * Retrieves attendance details for a specific webinar session that has ended. If attendees attended the session ('registrantsAttended'), specific attendance details, such as attendenceTime for a registrant, will also be retrieved.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param sessionKey The key of the webinar session
     * @return List<Attendee>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List getWebinarSession(String authorization, Long organizerKey, Long webinarKey, Long sessionKey) throws ApiException {

        Object postBody = null;

        if(authorization == null) {
            throw new ApiException("Required parameter authorization is null.");
        }

        if(organizerKey == null) {
            throw new ApiException("Required parameter organizerKey is null.");
        }

        if(webinarKey == null) {
            throw new ApiException("Required parameter webinarKey is null.");
        }

        if(sessionKey == null) {
            throw new ApiException("Required parameter sessionKey is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/sessions/{sessionKey}"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "organizerKey" + "\\}", apiInvoker.escapeString(organizerKey.toString()))
                .replaceAll("\\{" + "webinarKey" + "\\}", apiInvoker.escapeString(webinarKey.toString()))
                .replaceAll("\\{" + "sessionKey" + "\\}", apiInvoker.escapeString(sessionKey.toString()));

        // query params
        Map queryParams = new HashMap();
        Map headerParams = new HashMap();
        Map formParams = new HashMap();

        headerParams.put("Authorization", authorization);

        String[] contentTypes = {
            "application/json"
        };
        String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";

        if(contentType.startsWith("multipart/form-data")) {
            boolean hasFields = false;
            FormDataMultiPart mp = new FormDataMultiPart();

            if(hasFields)
                postBody = mp;
        }
        else {
        }

        String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (List) ApiInvoker.deserialize(response, "List", Attendee.class);
        }
        return null;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy