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

com.logmein.gotowebinar.api.CoorganizersApi 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.Coorganizer;
import com.logmein.gotowebinar.api.model.CoorganizerReqCreate;
import com.sun.jersey.multipart.FormDataMultiPart;

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

public class CoorganizersApi {

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

    /**
      * Initializes a new instance of the CoorganizersApi class using the
      * default endpoint base url for the services being accessed.
      */
    public CoorganizersApi() {
    }
    
    /**
      * Initializes a new instance of the CoorganizersApi 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 CoorganizersApi(String basePath) {
        this.basePath = basePath;
    }

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

    /**
     * Create co-organizers
     * Creates co-organizers for the specified webinar. For co-organizers that have a GoToWebinar account you have to set the parameter 'external' to 'false'. In this case you have to pass the parameter 'organizerKey' only. For co-organizers that have no GoToWebinar account you have to set the parameter 'external' to 'true'. In this case you have to pass the parameters 'givenName' and 'email'. Since there is no parameter for 'surname' you should pass first and last name to the parameter 'givenName'.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param body The co-organizer details
     * @return List<Coorganizer>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List createCoorganizers(String authorization, Long organizerKey, Long webinarKey, List body) throws ApiException {

        Object postBody = body;

        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(body == null) {
            throw new ApiException("Required parameter body is null.");
        }

        // create path and map variables
        String path = "/organizers/{organizerKey}/webinars/{webinarKey}/coorganizers"
                .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();

        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, "POST", queryParams, postBody, headerParams, formParams, contentType);
        if(response != null){
            return (List) ApiInvoker.deserialize(response, "List", Coorganizer.class);
        }
        return null;
    }

    /**
     * Delete co-organizer
     * Deletes an internal co-organizer specified by the coorganizerKey (memberKey).
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param coorganizerKey The key of the internal or external co-organizer (memberKey)
     * @param external By default only internal co-organizers (with a GoToWebinar account) can be deleted. If you want to use this call for external co-organizers you have to set this parameter to 'true'.
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public void deleteCoorganizer(String authorization, Long organizerKey, Long webinarKey, Long coorganizerKey, Boolean external) 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(coorganizerKey == null) {
            throw new ApiException("Required parameter coorganizerKey is null.");
        }

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

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

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

        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 {
        }

        apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
    }

    /**
     * Get co-organizers
     * Returns the co-organizers for the specified webinar. The original organizer who created the webinar is filtered out of the list. If the webinar has no co-organizers, an empty array is returned. Co-organizers that do not have a GoToWebinar account are returned as external co-organizers. For those organizers no surname is returned.
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @return List<Coorganizer>
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public List getCoorganizers(String authorization, Long organizerKey, Long webinarKey) 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}/coorganizers"
                .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();

        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", Coorganizer.class);
        }
        return null;
    }

    /**
     * Resend invitation
     * Resends an invitation email to the specified co-organizer
     * @param authorization Access token
     * @param organizerKey The key of the organizer
     * @param webinarKey The key of the webinar
     * @param coorganizerKey The key of the internal or external co-organizer (memberKey)
     * @param external By default only internal co-organizers (with a GoToWebinar account) will retrieve the resent invitation email. If you want to use this call for external co-organizers you have to set this parameter to 'true'.
     * @throws ApiException If the response status code is not Successful 2xx, or an error has occurred during parameter serialization or response deserialization
     */
    public void resendCoorganizerInvitation(String authorization, Long organizerKey, Long webinarKey, Long coorganizerKey, Boolean external) 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(coorganizerKey == null) {
            throw new ApiException("Required parameter coorganizerKey is null.");
        }

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

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

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

        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 {
        }

        apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy