/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * The version of the OpenAPI document: 0.3.0
 * 
 *
 * 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 type {
  DisableRequest,
  EnableRequest,
  EnableResponse,
} from '../models/index';
import {
    DisableRequestFromJSON,
    DisableRequestToJSON,
    EnableRequestFromJSON,
    EnableRequestToJSON,
    EnableResponseFromJSON,
    EnableResponseToJSON,
} from '../models/index';

export interface DisableOperationRequest {
    body?: DisableRequest;
}

export interface EnableOperationRequest {
    body?: EnableRequest;
}

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

    /**
     */
    async disableRaw(requestParameters: DisableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/zrok.v1+json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
        }

        const response = await this.request({
            path: `/disable`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DisableRequestToJSON(requestParameters.body),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     */
    async disable(requestParameters: DisableOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.disableRaw(requestParameters, initOverrides);
    }

    /**
     */
    async enableRaw(requestParameters: EnableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EnableResponse>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/zrok.v1+json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
        }

        const response = await this.request({
            path: `/enable`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: EnableRequestToJSON(requestParameters.body),
        }, initOverrides);

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

    /**
     */
    async enable(requestParameters: EnableOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EnableResponse> {
        const response = await this.enableRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
