/* tslint:disable */
/* eslint-disable */
/**
 * Unleash API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.11.0-beta.2
 * 
 *
 * 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 {
    CloneFeatureSchema,
    CloneFeatureSchemaFromJSON,
    CloneFeatureSchemaToJSON,
    CreateFeatureSchema,
    CreateFeatureSchemaFromJSON,
    CreateFeatureSchemaToJSON,
    CreateStrategySchema,
    CreateStrategySchemaFromJSON,
    CreateStrategySchemaToJSON,
    FeatureEnvironmentSchema,
    FeatureEnvironmentSchemaFromJSON,
    FeatureEnvironmentSchemaToJSON,
    FeatureSchema,
    FeatureSchemaFromJSON,
    FeatureSchemaToJSON,
    FeatureStrategySchema,
    FeatureStrategySchemaFromJSON,
    FeatureStrategySchemaToJSON,
    FeaturesSchema,
    FeaturesSchemaFromJSON,
    FeaturesSchemaToJSON,
    PatchOperationSchema,
    PatchOperationSchemaFromJSON,
    PatchOperationSchemaToJSON,
    StrategySchema,
    StrategySchemaFromJSON,
    StrategySchemaToJSON,
    TagSchema,
    TagSchemaFromJSON,
    TagSchemaToJSON,
    TagsResponseSchema,
    TagsResponseSchemaFromJSON,
    TagsResponseSchemaToJSON,
    UpdateFeatureSchema,
    UpdateFeatureSchemaFromJSON,
    UpdateFeatureSchemaToJSON,
    UpdateStrategySchema,
    UpdateStrategySchemaFromJSON,
    UpdateStrategySchemaToJSON,
} from '../models';

export interface AddStrategyRequest {
    projectId: string;
    featureName: string;
    environment: string;
    createStrategySchema: CreateStrategySchema;
}

export interface AddTagRequest {
    featureName: string;
    tagSchema: TagSchema;
}

export interface ApiAdminArchiveFeaturesProjectIdGetRequest {
    projectId: string;
}

export interface ArchiveFeatureRequest {
    projectId: string;
    featureName: string;
}

export interface CloneFeatureRequest {
    projectId: string;
    featureName: string;
    cloneFeatureSchema: CloneFeatureSchema;
}

export interface CreateFeatureRequest {
    projectId: string;
    createFeatureSchema: CreateFeatureSchema;
}

export interface DeleteStrategyRequest {
    projectId: string;
    featureName: string;
    environment: string;
    strategyId: string;
}

export interface GetEnvironmentRequest {
    projectId: string;
    featureName: string;
    environment: string;
}

export interface GetFeatureRequest {
    projectId: string;
    featureName: string;
}

export interface GetFeaturesRequest {
    projectId: string;
}

export interface GetStrategiesRequest {
    projectId: string;
    featureName: string;
    environment: string;
}

export interface GetStrategyRequest {
    projectId: string;
    featureName: string;
    environment: string;
    strategyId: string;
}

export interface ListTagsRequest {
    featureName: string;
}

export interface PatchFeatureRequest {
    projectId: string;
    featureName: string;
    patchOperationSchema: Array<PatchOperationSchema>;
}

export interface PatchStrategyRequest {
    projectId: string;
    featureName: string;
    environment: string;
    strategyId: string;
    patchOperationSchema: Array<PatchOperationSchema>;
}

export interface RemoveTagRequest {
    featureName: string;
    type: string;
    value: string;
}

export interface ToggleEnvironmentOffRequest {
    projectId: string;
    featureName: string;
    environment: string;
}

export interface ToggleEnvironmentOnRequest {
    projectId: string;
    featureName: string;
    environment: string;
}

export interface UpdateFeatureRequest {
    projectId: string;
    featureName: string;
    updateFeatureSchema: UpdateFeatureSchema;
}

export interface UpdateStrategyRequest {
    projectId: string;
    featureName: string;
    environment: string;
    strategyId: string;
    updateStrategySchema: UpdateStrategySchema;
}

/**
 * 
 */
export class AdminApi extends runtime.BaseAPI {

    /**
     */
    async addStrategyRaw(requestParameters: AddStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureStrategySchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling addStrategy.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling addStrategy.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling addStrategy.');
        }

        if (requestParameters.createStrategySchema === null || requestParameters.createStrategySchema === undefined) {
            throw new runtime.RequiredError('createStrategySchema','Required parameter requestParameters.createStrategySchema was null or undefined when calling addStrategy.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateStrategySchemaToJSON(requestParameters.createStrategySchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue));
    }

    /**
     */
    async addStrategy(requestParameters: AddStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureStrategySchema> {
        const response = await this.addStrategyRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async addTagRaw(requestParameters: AddTagRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TagSchema>> {
        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling addTag.');
        }

        if (requestParameters.tagSchema === null || requestParameters.tagSchema === undefined) {
            throw new runtime.RequiredError('tagSchema','Required parameter requestParameters.tagSchema was null or undefined when calling addTag.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/features/{featureName}/tags`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TagSchemaToJSON(requestParameters.tagSchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TagSchemaFromJSON(jsonValue));
    }

    /**
     */
    async addTag(requestParameters: AddTagRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TagSchema> {
        const response = await this.addTagRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiAdminArchiveFeaturesGetRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeaturesSchema>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/archive/features`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue));
    }

    /**
     */
    async apiAdminArchiveFeaturesGet(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeaturesSchema> {
        const response = await this.apiAdminArchiveFeaturesGetRaw(initOverrides);
        return await response.value();
    }

    /**
     */
    async apiAdminArchiveFeaturesProjectIdGetRaw(requestParameters: ApiAdminArchiveFeaturesProjectIdGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeaturesSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminArchiveFeaturesProjectIdGet.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/archive/features/{projectId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue));
    }

    /**
     */
    async apiAdminArchiveFeaturesProjectIdGet(requestParameters: ApiAdminArchiveFeaturesProjectIdGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeaturesSchema> {
        const response = await this.apiAdminArchiveFeaturesProjectIdGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async archiveFeatureRaw(requestParameters: ArchiveFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<object>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling archiveFeature.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling archiveFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     */
    async archiveFeature(requestParameters: ArchiveFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<object> {
        const response = await this.archiveFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async cloneFeatureRaw(requestParameters: CloneFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling cloneFeature.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling cloneFeature.');
        }

        if (requestParameters.cloneFeatureSchema === null || requestParameters.cloneFeatureSchema === undefined) {
            throw new runtime.RequiredError('cloneFeatureSchema','Required parameter requestParameters.cloneFeatureSchema was null or undefined when calling cloneFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/clone`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CloneFeatureSchemaToJSON(requestParameters.cloneFeatureSchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async cloneFeature(requestParameters: CloneFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.cloneFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async createFeatureRaw(requestParameters: CreateFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling createFeature.');
        }

        if (requestParameters.createFeatureSchema === null || requestParameters.createFeatureSchema === undefined) {
            throw new runtime.RequiredError('createFeatureSchema','Required parameter requestParameters.createFeatureSchema was null or undefined when calling createFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateFeatureSchemaToJSON(requestParameters.createFeatureSchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async createFeature(requestParameters: CreateFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.createFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async deleteStrategyRaw(requestParameters: DeleteStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<object>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling deleteStrategy.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling deleteStrategy.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling deleteStrategy.');
        }

        if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) {
            throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling deleteStrategy.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     */
    async deleteStrategy(requestParameters: DeleteStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<object> {
        const response = await this.deleteStrategyRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async getAllTogglesRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeaturesSchema>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/features`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue));
    }

    /**
     */
    async getAllToggles(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeaturesSchema> {
        const response = await this.getAllTogglesRaw(initOverrides);
        return await response.value();
    }

    /**
     */
    async getEnvironmentRaw(requestParameters: GetEnvironmentRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureEnvironmentSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getEnvironment.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getEnvironment.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getEnvironment.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureEnvironmentSchemaFromJSON(jsonValue));
    }

    /**
     */
    async getEnvironment(requestParameters: GetEnvironmentRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureEnvironmentSchema> {
        const response = await this.getEnvironmentRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async getFeatureRaw(requestParameters: GetFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getFeature.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async getFeature(requestParameters: GetFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.getFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async getFeaturesRaw(requestParameters: GetFeaturesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeaturesSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getFeatures.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue));
    }

    /**
     */
    async getFeatures(requestParameters: GetFeaturesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeaturesSchema> {
        const response = await this.getFeaturesRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async getStrategiesRaw(requestParameters: GetStrategiesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Array<StrategySchema>>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getStrategies.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getStrategies.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getStrategies.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(StrategySchemaFromJSON));
    }

    /**
     */
    async getStrategies(requestParameters: GetStrategiesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Array<StrategySchema>> {
        const response = await this.getStrategiesRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async getStrategyRaw(requestParameters: GetStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureStrategySchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getStrategy.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getStrategy.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getStrategy.');
        }

        if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) {
            throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling getStrategy.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue));
    }

    /**
     */
    async getStrategy(requestParameters: GetStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureStrategySchema> {
        const response = await this.getStrategyRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async listTagsRaw(requestParameters: ListTagsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TagsResponseSchema>> {
        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling listTags.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/features/{featureName}/tags`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => TagsResponseSchemaFromJSON(jsonValue));
    }

    /**
     */
    async listTags(requestParameters: ListTagsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TagsResponseSchema> {
        const response = await this.listTagsRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async patchFeatureRaw(requestParameters: PatchFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling patchFeature.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling patchFeature.');
        }

        if (requestParameters.patchOperationSchema === null || requestParameters.patchOperationSchema === undefined) {
            throw new runtime.RequiredError('patchOperationSchema','Required parameter requestParameters.patchOperationSchema was null or undefined when calling patchFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.patchOperationSchema.map(PatchOperationSchemaToJSON),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async patchFeature(requestParameters: PatchFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.patchFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async patchStrategyRaw(requestParameters: PatchStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureStrategySchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling patchStrategy.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling patchStrategy.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling patchStrategy.');
        }

        if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) {
            throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling patchStrategy.');
        }

        if (requestParameters.patchOperationSchema === null || requestParameters.patchOperationSchema === undefined) {
            throw new runtime.RequiredError('patchOperationSchema','Required parameter requestParameters.patchOperationSchema was null or undefined when calling patchStrategy.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.patchOperationSchema.map(PatchOperationSchemaToJSON),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue));
    }

    /**
     */
    async patchStrategy(requestParameters: PatchStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureStrategySchema> {
        const response = await this.patchStrategyRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async removeTagRaw(requestParameters: RemoveTagRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<object>> {
        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling removeTag.');
        }

        if (requestParameters.type === null || requestParameters.type === undefined) {
            throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling removeTag.');
        }

        if (requestParameters.value === null || requestParameters.value === undefined) {
            throw new runtime.RequiredError('value','Required parameter requestParameters.value was null or undefined when calling removeTag.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/features/{featureName}/tags/{type}/{value}`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"value"}}`, encodeURIComponent(String(requestParameters.value))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     */
    async removeTag(requestParameters: RemoveTagRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<object> {
        const response = await this.removeTagRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async toggleEnvironmentOffRaw(requestParameters: ToggleEnvironmentOffRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling toggleEnvironmentOff.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling toggleEnvironmentOff.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling toggleEnvironmentOff.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/off`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async toggleEnvironmentOff(requestParameters: ToggleEnvironmentOffRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.toggleEnvironmentOffRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async toggleEnvironmentOnRaw(requestParameters: ToggleEnvironmentOnRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling toggleEnvironmentOn.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling toggleEnvironmentOn.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling toggleEnvironmentOn.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/on`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async toggleEnvironmentOn(requestParameters: ToggleEnvironmentOnRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.toggleEnvironmentOnRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async updateFeatureRaw(requestParameters: UpdateFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureSchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling updateFeature.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling updateFeature.');
        }

        if (requestParameters.updateFeatureSchema === null || requestParameters.updateFeatureSchema === undefined) {
            throw new runtime.RequiredError('updateFeatureSchema','Required parameter requestParameters.updateFeatureSchema was null or undefined when calling updateFeature.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: UpdateFeatureSchemaToJSON(requestParameters.updateFeatureSchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue));
    }

    /**
     */
    async updateFeature(requestParameters: UpdateFeatureRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureSchema> {
        const response = await this.updateFeatureRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async updateStrategyRaw(requestParameters: UpdateStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<FeatureStrategySchema>> {
        if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
            throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling updateStrategy.');
        }

        if (requestParameters.featureName === null || requestParameters.featureName === undefined) {
            throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling updateStrategy.');
        }

        if (requestParameters.environment === null || requestParameters.environment === undefined) {
            throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling updateStrategy.');
        }

        if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) {
            throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling updateStrategy.');
        }

        if (requestParameters.updateStrategySchema === null || requestParameters.updateStrategySchema === undefined) {
            throw new runtime.RequiredError('updateStrategySchema','Required parameter requestParameters.updateStrategySchema was null or undefined when calling updateStrategy.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: UpdateStrategySchemaToJSON(requestParameters.updateStrategySchema),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue));
    }

    /**
     */
    async updateStrategy(requestParameters: UpdateStrategyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<FeatureStrategySchema> {
        const response = await this.updateStrategyRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async validateFeatureRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<object>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication
        }

        const response = await this.request({
            path: `/api/admin/features/validate`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse<any>(response);
    }

    /**
     */
    async validateFeature(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<object> {
        const response = await this.validateFeatureRaw(initOverrides);
        return await response.value();
    }

}
