import { validateInDev } from '../../utils/dev.mjs';

class HeadlessB2BSCIMClient {
    _networkClient;
    _subscriptionService;
    constructor(_networkClient, _subscriptionService){
        this._networkClient = _networkClient;
        this._subscriptionService = _subscriptionService;
    }
    async createConnection(data) {
        validateInDev('stytch.scim.createConnection', data, {
            display_name: 'optionalString',
            identity_provider: 'optionalString'
        });
        return await this._networkClient.fetchSDK({
            url: '/b2b/scim',
            method: 'POST',
            body: data
        });
    }
    async updateConnection(data) {
        validateInDev('stytch.scim.updateConnection', data, {
            connection_id: 'string',
            display_name: 'optionalString',
            identity_provider: 'optionalString'
        });
        return await this._networkClient.fetchSDK({
            url: `/b2b/scim/${data.connection_id}`,
            method: 'PUT',
            body: data
        });
    }
    async deleteConnection(connectionId) {
        validateInDev('stytch.scim.deleteConnection', {
            connection_id: connectionId
        }, {
            connection_id: 'string'
        });
        return await this._networkClient.fetchSDK({
            url: `/b2b/scim/${connectionId}`,
            method: 'DELETE'
        });
    }
    async getConnection() {
        return await this._networkClient.fetchSDK({
            url: '/b2b/scim',
            method: 'GET'
        });
    }
    async getConnectionGroups(data) {
        validateInDev('stytch.scim.getConnectionGroups', data, {
            limit: 'optionalNumber',
            cursor: 'optionalString'
        });
        return await this._networkClient.fetchSDK({
            url: '/b2b/scim/groups',
            method: 'POST',
            body: data
        });
    }
    async rotateStart(connectionId) {
        validateInDev('stytch.scim.rotateStart', {
            connectionId
        }, {
            connectionId: 'string'
        });
        return await this._networkClient.fetchSDK({
            url: `/b2b/scim/rotate/start`,
            method: 'POST',
            body: {
                connection_id: connectionId
            }
        });
    }
    async rotateComplete(connectionId) {
        validateInDev('stytch.scim.rotateComplete', {
            connectionId
        }, {
            connectionId: 'string'
        });
        return await this._networkClient.fetchSDK({
            url: `/b2b/scim/rotate/complete`,
            method: 'POST',
            body: {
                connection_id: connectionId
            }
        });
    }
    async rotateCancel(connectionId) {
        validateInDev('stytch.scim.rotateCancel', {
            connectionId
        }, {
            connectionId: 'string'
        });
        return await this._networkClient.fetchSDK({
            url: `/b2b/scim/rotate/cancel`,
            method: 'POST',
            body: {
                connection_id: connectionId
            }
        });
    }
}

export { HeadlessB2BSCIMClient };
//# sourceMappingURL=HeadlessB2BSCIMClient.mjs.map
