"use strict";
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientCredentialsFlow = exports.AuthorizationCodeOAuthFlow = exports.PasswordOAuthFlow = exports.OpenIdConnectSecurityScheme = exports.OAuthFlows = exports.OAuth2SecurityScheme = exports.NonBearerHTTPSecurityScheme = exports.ImplicitOAuthFlow = exports.BearerHTTPSecurityScheme = exports.APIKeySecurityScheme = exports.SecurityType = exports.Scheme = void 0;
const extensions_1 = require("./extensions");
const linq_1 = require("@azure-tools/linq");
var Scheme;
(function (Scheme) {
    Scheme["Bearer"] = "bearer";
})(Scheme || (exports.Scheme = Scheme = {}));
var SecurityType;
(function (SecurityType) {
    SecurityType["ApiKey"] = "apiKey";
    SecurityType["Http"] = "http";
    SecurityType["OAuth2"] = "oauth2";
    SecurityType["OpenIDConnect"] = "openIdConnect";
})(SecurityType || (exports.SecurityType = SecurityType = {}));
class APIKeySecurityScheme extends extensions_1.Extensions {
    constructor(name, inWhere, initializer) {
        super();
        this.name = name;
        this.extensions = new linq_1.Dictionary();
        this.in = inWhere;
        this.type = SecurityType.ApiKey;
        this.apply(initializer);
    }
}
exports.APIKeySecurityScheme = APIKeySecurityScheme;
class BearerHTTPSecurityScheme extends extensions_1.Extensions {
    constructor(initializer) {
        super();
        this.extensions = new linq_1.Dictionary();
        this.scheme = Scheme.Bearer;
        this.type = SecurityType.Http;
        this.apply(initializer);
    }
}
exports.BearerHTTPSecurityScheme = BearerHTTPSecurityScheme;
class ImplicitOAuthFlow extends extensions_1.Extensions {
    constructor(authorizationUrl, initializer) {
        super();
        this.authorizationUrl = authorizationUrl;
        this.extensions = new linq_1.Dictionary();
        this.scopes = new linq_1.Dictionary();
        this.apply(initializer);
    }
}
exports.ImplicitOAuthFlow = ImplicitOAuthFlow;
class NonBearerHTTPSecurityScheme extends extensions_1.Extensions {
    constructor(scheme, initializer) {
        super();
        this.scheme = scheme;
        this.extensions = new linq_1.Dictionary();
        this.apply(initializer);
        this.type = SecurityType.Http;
    }
}
exports.NonBearerHTTPSecurityScheme = NonBearerHTTPSecurityScheme;
class OAuth2SecurityScheme extends extensions_1.Extensions {
    constructor(flows, initializer) {
        super();
        this.flows = flows;
        this.extensions = new linq_1.Dictionary();
        this.type = SecurityType.OAuth2;
        this.apply(initializer);
    }
}
exports.OAuth2SecurityScheme = OAuth2SecurityScheme;
class OAuthFlows extends extensions_1.Extensions {
    constructor(initializer) {
        super();
        this.extensions = new linq_1.Dictionary();
        this.apply(initializer);
    }
}
exports.OAuthFlows = OAuthFlows;
class OpenIdConnectSecurityScheme extends extensions_1.Extensions {
    constructor(openIdConnectUrl, initializer) {
        super();
        this.openIdConnectUrl = openIdConnectUrl;
        this.extensions = new linq_1.Dictionary();
        this.type = SecurityType.OpenIDConnect;
        this.apply(initializer);
    }
}
exports.OpenIdConnectSecurityScheme = OpenIdConnectSecurityScheme;
class PasswordOAuthFlow extends extensions_1.Extensions {
    constructor(tokenUrl, initializer) {
        super();
        this.tokenUrl = tokenUrl;
        this.extensions = new linq_1.Dictionary();
        this.scopes = new linq_1.Dictionary();
        this.apply(initializer);
    }
}
exports.PasswordOAuthFlow = PasswordOAuthFlow;
class AuthorizationCodeOAuthFlow extends extensions_1.Extensions {
    constructor(authorizationUrl, tokenUrl, initializer) {
        super();
        this.authorizationUrl = authorizationUrl;
        this.extensions = new linq_1.Dictionary();
        this.scopes = new linq_1.Dictionary();
        this.apply(initializer);
    }
}
exports.AuthorizationCodeOAuthFlow = AuthorizationCodeOAuthFlow;
class ClientCredentialsFlow extends extensions_1.Extensions {
    constructor(tokenUrl, initializer) {
        super();
        this.tokenUrl = tokenUrl;
        this.extensions = new linq_1.Dictionary();
        this.scopes = new linq_1.Dictionary();
        this.apply(initializer);
    }
}
exports.ClientCredentialsFlow = ClientCredentialsFlow;
//# sourceMappingURL=security-scheme.js.map