/* 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 { AccessControlListFromJSON, AccessControlListToJSON, AsyncJobIdFromJSON, CreateOrganizationRequestToJSON, CreateSchemaRequestToJSON, CreateSchemaResponseFromJSON, GetValidationSchemaRequestToJSON, GetValidationSchemaResponseFromJSON, JsonSchemaFromJSON, ListJsonSchemaInfoRequestToJSON, ListJsonSchemaInfoResponseFromJSON, ListJsonSchemaVersionInfoRequestToJSON, ListJsonSchemaVersionInfoResponseFromJSON, ListOrganizationsRequestToJSON, ListOrganizationsResponseFromJSON, OrganizationFromJSON, } from '../models/index';
/**
 *
 */
export class JSONSchemaServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1SchemaOrganizationIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1SchemaOrganizationId().');
        }
        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/schema/organization/{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 deleteRepoV1SchemaOrganizationId(requestParameters, initOverrides) {
        await this.deleteRepoV1SchemaOrganizationIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async deleteRepoV1SchemaTypeRegisteredIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1SchemaTypeRegisteredId().');
        }
        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/schema/type/registered/{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 deleteRepoV1SchemaTypeRegisteredId(requestParameters, initOverrides) {
        await this.deleteRepoV1SchemaTypeRegisteredIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1SchemaOrganizationRaw(requestParameters, initOverrides) {
        if (requestParameters['name'] == null) {
            throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling getRepoV1SchemaOrganization().');
        }
        const queryParameters = {};
        if (requestParameters['name'] != null) {
            queryParameters['name'] = requestParameters['name'];
        }
        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/schema/organization`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OrganizationFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1SchemaOrganization(requestParameters, initOverrides) {
        const response = await this.getRepoV1SchemaOrganizationRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1SchemaOrganizationIdAclRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1SchemaOrganizationIdAcl().');
        }
        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/schema/organization/{id}/acl`;
        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) => AccessControlListFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1SchemaOrganizationIdAcl(requestParameters, initOverrides) {
        const response = await this.getRepoV1SchemaOrganizationIdAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1SchemaTypeCreateAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1SchemaTypeCreateAsyncGetAsyncToken().');
        }
        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/schema/type/create/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"asyncToken"}}`, encodeURIComponent(String(requestParameters['asyncToken'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CreateSchemaResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1SchemaTypeCreateAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1SchemaTypeCreateAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1SchemaTypeRegisteredIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1SchemaTypeRegisteredId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/schema/type/registered/{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) => JsonSchemaFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1SchemaTypeRegisteredId(requestParameters, initOverrides) {
        const response = await this.getRepoV1SchemaTypeRegisteredIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1SchemaTypeValidationAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1SchemaTypeValidationAsyncGetAsyncToken().');
        }
        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/schema/type/validation/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"asyncToken"}}`, encodeURIComponent(String(requestParameters['asyncToken'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => GetValidationSchemaResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1SchemaTypeValidationAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1SchemaTypeValidationAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaListRaw(requestParameters, initOverrides) {
        if (requestParameters['listJsonSchemaInfoRequest'] == null) {
            throw new runtime.RequiredError('listJsonSchemaInfoRequest', 'Required parameter "listJsonSchemaInfoRequest" was null or undefined when calling postRepoV1SchemaList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/schema/list`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListJsonSchemaInfoRequestToJSON(requestParameters['listJsonSchemaInfoRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListJsonSchemaInfoResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaList(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaOrganizationRaw(requestParameters, initOverrides) {
        if (requestParameters['createOrganizationRequest'] == null) {
            throw new runtime.RequiredError('createOrganizationRequest', 'Required parameter "createOrganizationRequest" was null or undefined when calling postRepoV1SchemaOrganization().');
        }
        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/schema/organization`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateOrganizationRequestToJSON(requestParameters['createOrganizationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OrganizationFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaOrganization(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaOrganizationRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaOrganizationListRaw(requestParameters, initOverrides) {
        if (requestParameters['listOrganizationsRequest'] == null) {
            throw new runtime.RequiredError('listOrganizationsRequest', 'Required parameter "listOrganizationsRequest" was null or undefined when calling postRepoV1SchemaOrganizationList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/schema/organization/list`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListOrganizationsRequestToJSON(requestParameters['listOrganizationsRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListOrganizationsResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaOrganizationList(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaOrganizationListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaTypeCreateAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['createSchemaRequest'] == null) {
            throw new runtime.RequiredError('createSchemaRequest', 'Required parameter "createSchemaRequest" was null or undefined when calling postRepoV1SchemaTypeCreateAsyncStart().');
        }
        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/schema/type/create/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateSchemaRequestToJSON(requestParameters['createSchemaRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaTypeCreateAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaTypeCreateAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaTypeValidationAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['getValidationSchemaRequest'] == null) {
            throw new runtime.RequiredError('getValidationSchemaRequest', 'Required parameter "getValidationSchemaRequest" was null or undefined when calling postRepoV1SchemaTypeValidationAsyncStart().');
        }
        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/schema/type/validation/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GetValidationSchemaRequestToJSON(requestParameters['getValidationSchemaRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaTypeValidationAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaTypeValidationAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1SchemaVersionListRaw(requestParameters, initOverrides) {
        if (requestParameters['listJsonSchemaVersionInfoRequest'] == null) {
            throw new runtime.RequiredError('listJsonSchemaVersionInfoRequest', 'Required parameter "listJsonSchemaVersionInfoRequest" was null or undefined when calling postRepoV1SchemaVersionList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/schema/version/list`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListJsonSchemaVersionInfoRequestToJSON(requestParameters['listJsonSchemaVersionInfoRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListJsonSchemaVersionInfoResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1SchemaVersionList(requestParameters, initOverrides) {
        const response = await this.postRepoV1SchemaVersionListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1SchemaOrganizationIdAclRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1SchemaOrganizationIdAcl().');
        }
        if (requestParameters['accessControlList'] == null) {
            throw new runtime.RequiredError('accessControlList', 'Required parameter "accessControlList" was null or undefined when calling putRepoV1SchemaOrganizationIdAcl().');
        }
        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/schema/organization/{id}/acl`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: AccessControlListToJSON(requestParameters['accessControlList']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AccessControlListFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1SchemaOrganizationIdAcl(requestParameters, initOverrides) {
        const response = await this.putRepoV1SchemaOrganizationIdAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=JSONSchemaServicesApi.js.map