/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as runtime from '../runtime';
import { ActivityFromJSON, ActivityToJSON, PaginatedResultsOfReferenceFromJSON, } from '../models/index';
/**
 *
 */
export class ActivityServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1ActivityIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1ActivityId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/activity/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1ActivityId(requestParameters, initOverrides) {
        await this.deleteRepoV1ActivityIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1ActivityIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1ActivityId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/activity/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ActivityFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ActivityId(requestParameters, initOverrides) {
        const response = await this.getRepoV1ActivityIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1ActivityIdGeneratedRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1ActivityIdGenerated().');
        }
        const queryParameters = {};
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/activity/{id}/generated`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfReferenceFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ActivityIdGenerated(requestParameters, initOverrides) {
        const response = await this.getRepoV1ActivityIdGeneratedRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ActivityRaw(requestParameters, initOverrides) {
        if (requestParameters['activity'] == null) {
            throw new runtime.RequiredError('activity', 'Required parameter "activity" was null or undefined when calling postRepoV1Activity().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/activity`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ActivityToJSON(requestParameters['activity']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ActivityFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1Activity(requestParameters, initOverrides) {
        const response = await this.postRepoV1ActivityRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1ActivityIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1ActivityId().');
        }
        if (requestParameters['activity'] == null) {
            throw new runtime.RequiredError('activity', 'Required parameter "activity" was null or undefined when calling putRepoV1ActivityId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/activity/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: ActivityToJSON(requestParameters['activity']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ActivityFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1ActivityId(requestParameters, initOverrides) {
        const response = await this.putRepoV1ActivityIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=ActivityServicesApi.js.map