/* 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, CountFromJSON, IdListToJSON, JoinTeamSignedTokenToJSON, ListWrapperOfTeamFromJSON, ListWrapperOfTeamMemberFromJSON, PaginatedResultsOfTeamFromJSON, PaginatedResultsOfTeamMemberFromJSON, PaginatedTeamIdsFromJSON, ResponseMessageFromJSON, TeamFromJSON, TeamToJSON, TeamMemberFromJSON, TeamMembershipStatusFromJSON, } from '../models/index';
/**
 *
 */
export class TeamServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1TeamIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1TeamId().');
        }
        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/team/{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 deleteRepoV1TeamId(requestParameters, initOverrides) {
        await this.deleteRepoV1TeamIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async deleteRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1TeamIdMemberPrincipalId().');
        }
        if (requestParameters['principalId'] == null) {
            throw new runtime.RequiredError('principalId', 'Required parameter "principalId" was null or undefined when calling deleteRepoV1TeamIdMemberPrincipalId().');
        }
        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/team/{id}/member/{principalId}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"principalId"}}`, encodeURIComponent(String(requestParameters['principalId'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1TeamIdMemberPrincipalId(requestParameters, initOverrides) {
        await this.deleteRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1TeamIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/team/{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) => TeamFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TeamId(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamIdAclRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamIdAcl().');
        }
        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/team/{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 getRepoV1TeamIdAcl(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamIdIconRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamIdIcon().');
        }
        const queryParameters = {};
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        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/team/{id}/icon`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1TeamIdIcon(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdIconRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamIdIconPreviewRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamIdIconPreview().');
        }
        const queryParameters = {};
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        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/team/{id}/icon/preview`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1TeamIdIconPreview(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdIconPreviewRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamIdMemberPrincipalId().');
        }
        if (requestParameters['principalId'] == null) {
            throw new runtime.RequiredError('principalId', 'Required parameter "principalId" was null or undefined when calling getRepoV1TeamIdMemberPrincipalId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/team/{id}/member/{principalId}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"principalId"}}`, encodeURIComponent(String(requestParameters['principalId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TeamMemberFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TeamIdMemberPrincipalId(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamIdMemberPrincipalIdMembershipStatusRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamIdMemberPrincipalIdMembershipStatus().');
        }
        if (requestParameters['principalId'] == null) {
            throw new runtime.RequiredError('principalId', 'Required parameter "principalId" was null or undefined when calling getRepoV1TeamIdMemberPrincipalIdMembershipStatus().');
        }
        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/team/{id}/member/{principalId}/membershipStatus`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"principalId"}}`, encodeURIComponent(String(requestParameters['principalId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TeamMembershipStatusFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TeamIdMemberPrincipalIdMembershipStatus(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamIdMemberPrincipalIdMembershipStatusRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamMembersCountIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamMembersCountId().');
        }
        const queryParameters = {};
        if (requestParameters['fragment'] != null) {
            queryParameters['fragment'] = requestParameters['fragment'];
        }
        const headerParameters = {};
        let urlPath = `/repo/v1/teamMembers/count/{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) => CountFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TeamMembersCountId(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamMembersCountIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamMembersIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1TeamMembersId().');
        }
        const queryParameters = {};
        if (requestParameters['fragment'] != null) {
            queryParameters['fragment'] = requestParameters['fragment'];
        }
        if (requestParameters['memberType'] != null) {
            queryParameters['memberType'] = requestParameters['memberType'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        const headerParameters = {};
        let urlPath = `/repo/v1/teamMembers/{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) => PaginatedResultsOfTeamMemberFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TeamMembersId(requestParameters, initOverrides) {
        const response = await this.getRepoV1TeamMembersIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TeamsRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['fragment'] != null) {
            queryParameters['fragment'] = requestParameters['fragment'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        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/teams`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfTeamFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1Teams(requestParameters = {}, initOverrides) {
        const response = await this.getRepoV1TeamsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1UserIdTeamRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1UserIdTeam().');
        }
        const queryParameters = {};
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        const headerParameters = {};
        let urlPath = `/repo/v1/user/{id}/team`;
        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) => PaginatedResultsOfTeamFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1UserIdTeam(requestParameters, initOverrides) {
        const response = await this.getRepoV1UserIdTeamRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1UserIdTeamIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1UserIdTeamId().');
        }
        const queryParameters = {};
        if (requestParameters['nextPageToken'] != null) {
            queryParameters['nextPageToken'] = requestParameters['nextPageToken'];
        }
        if (requestParameters['sort'] != null) {
            queryParameters['sort'] = requestParameters['sort'];
        }
        if (requestParameters['ascending'] != null) {
            queryParameters['ascending'] = requestParameters['ascending'];
        }
        const headerParameters = {};
        let urlPath = `/repo/v1/user/{id}/team/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) => PaginatedTeamIdsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1UserIdTeamId(requestParameters, initOverrides) {
        const response = await this.getRepoV1UserIdTeamIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1TeamRaw(requestParameters, initOverrides) {
        if (requestParameters['team'] == null) {
            throw new runtime.RequiredError('team', 'Required parameter "team" was null or undefined when calling postRepoV1Team().');
        }
        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/team`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TeamToJSON(requestParameters['team']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TeamFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1Team(requestParameters, initOverrides) {
        const response = await this.postRepoV1TeamRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1TeamIdMemberListRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1TeamIdMemberList().');
        }
        if (requestParameters['idList'] == null) {
            throw new runtime.RequiredError('idList', 'Required parameter "idList" was null or undefined when calling postRepoV1TeamIdMemberList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/team/{id}/memberList`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: IdListToJSON(requestParameters['idList']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListWrapperOfTeamMemberFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1TeamIdMemberList(requestParameters, initOverrides) {
        const response = await this.postRepoV1TeamIdMemberListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1TeamListRaw(requestParameters, initOverrides) {
        if (requestParameters['idList'] == null) {
            throw new runtime.RequiredError('idList', 'Required parameter "idList" was null or undefined when calling postRepoV1TeamList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/teamList`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: IdListToJSON(requestParameters['idList']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListWrapperOfTeamFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1TeamList(requestParameters, initOverrides) {
        const response = await this.postRepoV1TeamListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1UserIdMemberListRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1UserIdMemberList().');
        }
        if (requestParameters['idList'] == null) {
            throw new runtime.RequiredError('idList', 'Required parameter "idList" was null or undefined when calling postRepoV1UserIdMemberList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/user/{id}/memberList`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: IdListToJSON(requestParameters['idList']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListWrapperOfTeamMemberFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1UserIdMemberList(requestParameters, initOverrides) {
        const response = await this.postRepoV1UserIdMemberListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1TeamRaw(requestParameters, initOverrides) {
        if (requestParameters['team'] == null) {
            throw new runtime.RequiredError('team', 'Required parameter "team" was null or undefined when calling putRepoV1Team().');
        }
        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/team`;
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: TeamToJSON(requestParameters['team']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TeamFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1Team(requestParameters, initOverrides) {
        const response = await this.putRepoV1TeamRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1TeamAclRaw(requestParameters, initOverrides) {
        if (requestParameters['accessControlList'] == null) {
            throw new runtime.RequiredError('accessControlList', 'Required parameter "accessControlList" was null or undefined when calling putRepoV1TeamAcl().');
        }
        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/team/acl`;
        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 putRepoV1TeamAcl(requestParameters, initOverrides) {
        const response = await this.putRepoV1TeamAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1TeamIdMemberPrincipalId().');
        }
        if (requestParameters['principalId'] == null) {
            throw new runtime.RequiredError('principalId', 'Required parameter "principalId" was null or undefined when calling putRepoV1TeamIdMemberPrincipalId().');
        }
        const queryParameters = {};
        if (requestParameters['teamEndpoint'] != null) {
            queryParameters['teamEndpoint'] = requestParameters['teamEndpoint'];
        }
        if (requestParameters['notificationUnsubscribeEndpoint'] != null) {
            queryParameters['notificationUnsubscribeEndpoint'] = requestParameters['notificationUnsubscribeEndpoint'];
        }
        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/team/{id}/member/{principalId}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"principalId"}}`, encodeURIComponent(String(requestParameters['principalId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async putRepoV1TeamIdMemberPrincipalId(requestParameters, initOverrides) {
        await this.putRepoV1TeamIdMemberPrincipalIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async putRepoV1TeamMemberRaw(requestParameters, initOverrides) {
        if (requestParameters['joinTeamSignedToken'] == null) {
            throw new runtime.RequiredError('joinTeamSignedToken', 'Required parameter "joinTeamSignedToken" was null or undefined when calling putRepoV1TeamMember().');
        }
        const queryParameters = {};
        if (requestParameters['teamEndpoint'] != null) {
            queryParameters['teamEndpoint'] = requestParameters['teamEndpoint'];
        }
        if (requestParameters['notificationUnsubscribeEndpoint'] != null) {
            queryParameters['notificationUnsubscribeEndpoint'] = requestParameters['notificationUnsubscribeEndpoint'];
        }
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/teamMember`;
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: JoinTeamSignedTokenToJSON(requestParameters['joinTeamSignedToken']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ResponseMessageFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1TeamMember(requestParameters, initOverrides) {
        const response = await this.putRepoV1TeamMemberRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=TeamServicesApi.js.map