"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.ClientRuntime = void 0;
const codegen_1 = require("@azure-tools/codegen");
const codegen_csharp_1 = require("@azure-tools/codegen-csharp");
const codegen_csharp_2 = require("@azure-tools/codegen-csharp");
const codegen_csharp_3 = require("@azure-tools/codegen-csharp");
const codegen_csharp_4 = require("@azure-tools/codegen-csharp");
const clientRuntimeNamespace = new codegen_csharp_4.Namespace('Microsoft.Rest.ClientRuntime');
const serializationMode = new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'SerializationMode');
const events = new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'Events');
const method = new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'Method');
const carbon = new codegen_csharp_4.Namespace('Carbon.Json');
const jsonNode = new codegen_csharp_1.ClassType(carbon, 'JsonNode');
const jsonArray = new codegen_csharp_1.ClassType(carbon, 'JsonArray');
const jsonObject = new codegen_csharp_1.ClassType(carbon, 'JsonObject');
const jsonType = new codegen_csharp_1.ClassType(carbon, 'JsonType');
exports.ClientRuntime = (0, codegen_1.intersect)(clientRuntimeNamespace, {
    AttachDebugger: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'AttachDebugger'),
    Method: (0, codegen_1.intersect)(method, {
        Get: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Get`),
        Put: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Put`),
        Post: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Post`),
        Delete: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Delete`),
        Options: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Options`),
        Head: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Head`),
        Trace: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Trace`),
        Patch: new codegen_csharp_2.LiteralExpression(`${method.declaration}.Patch`)
    }),
    InfoAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'Info'),
    CompleterInfoAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'CompleterInfo'),
    DefaultInfoAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'DefaultInfo'),
    GeneraricBreakingChangeAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'GeneraricBreakingChange'),
    CmdletBreakingChangeAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'CmdletBreakingChange'),
    ParameterSetBreakingChangeAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'ParameterSetBreakingChange'),
    OutputBreakingChangeAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'OutputBreakingChange'),
    ParameterBreakingChangeAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'ParameterBreakingChange'),
    PreviewMessageAttribute: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'PreviewMessage'),
    EventDataConverter: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'EventDataConverter'),
    ISendAsync: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'ISendAsync'),
    Extensions: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'Extensions'),
    PowerShell: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'PowerShell'),
    Cmdlets: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'Cmdlets'),
    IJsonSerializable: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IJsonSerializable'),
    JsonSerializable: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'JsonSerializable'),
    IXmlSerializable: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IXmlSerializable'),
    IEventListener: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IEventListener'),
    IContext: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IContext'),
    IValidates: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IValidates'),
    IHeaderSerializable: new codegen_csharp_3.Interface(clientRuntimeNamespace, 'IHeaderSerializable'),
    SerializationMode: (0, codegen_1.intersect)(serializationMode, {
        None: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.None`),
        IncludeAll: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeAll`),
        IncludeHeaders: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeHeaders`),
        IncludeCreate: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeCreate`),
        IncludeUpdate: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeUpdate`),
        IncludeRead: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeRead`),
        IncludeCreateOrUpdate: new codegen_csharp_2.LiteralExpression(`${serializationMode.declaration}.IncludeCreate|${serializationMode.declaration}.IncludeUpdate`),
    }),
    HttpPipeline: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'HttpPipeline'),
    HttpClientFactory: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'HttpClientFactory'),
    SendAsyncStep: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'SendAsyncStep'),
    SendAsyncSteps: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'SendAsyncStep[]'),
    EventData: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'EventData'),
    EventListener: new codegen_csharp_1.ClassType(clientRuntimeNamespace, 'EventListener'),
    Events: (0, codegen_1.intersect)(events, {
        BodyContentSet: new codegen_csharp_2.LiteralExpression(`${events.declaration}.BodyContentSet`),
        BeforeCall: new codegen_csharp_2.LiteralExpression(`${events.declaration}.BeforeCall`),
        BeforeResponseDispatch: new codegen_csharp_2.LiteralExpression(`${events.declaration}.BeforeResponseDispatch`),
        Log: new codegen_csharp_2.LiteralExpression(`${events.declaration}.Log`),
        Validation: new codegen_csharp_2.LiteralExpression(`${events.declaration}.Validation`),
        VaidationWarning: new codegen_csharp_2.LiteralExpression(`${events.declaration}.VaidationWarning`),
        AfterValidation: new codegen_csharp_2.LiteralExpression(`${events.declaration}.AfterValidation`),
        RequestCreated: new codegen_csharp_2.LiteralExpression(`${events.declaration}.RequestCreated`),
        ResponseCreated: new codegen_csharp_2.LiteralExpression(`${events.declaration}.ResponseCreated`),
        HeaderParametersAdded: new codegen_csharp_2.LiteralExpression(`${events.declaration}.HeaderParametersAdded`),
        URLCreated: new codegen_csharp_2.LiteralExpression(`${events.declaration}.URLCreated`),
        Finally: new codegen_csharp_2.LiteralExpression(`${events.declaration}.Finally`),
        Polling: new codegen_csharp_2.LiteralExpression(`${events.declaration}.Polling`),
        DelayBeforePolling: new codegen_csharp_2.LiteralExpression(`${events.declaration}.DelayBeforePolling`),
        Progress: new codegen_csharp_2.LiteralExpression(`${events.declaration}.Progress`),
    }),
    KeyValuePairs: codegen_csharp_1.System.Collections.Generic.IEnumerable(codegen_csharp_1.System.Collections.Generic.KeyValuePair(codegen_csharp_1.dotnet.String, codegen_csharp_1.System.Collections.Generic.IEnumerable(codegen_csharp_1.dotnet.String))),
    JsonNode: (0, codegen_1.intersect)(jsonNode, {
        Parse: (expression) => (0, codegen_csharp_2.toExpression)(`${jsonNode}.Parse(${(0, codegen_csharp_2.toExpression)(expression)})`)
    }),
    JsonObject: (0, codegen_1.intersect)(jsonObject, {
        Parse: (expression) => (0, codegen_csharp_2.toExpression)(`${jsonObject}.Parse(${expression})`)
    }),
    JsonString: new codegen_csharp_1.ClassType(carbon, 'JsonString'),
    JsonBoolean: new codegen_csharp_1.ClassType(carbon, 'JsonBoolean'),
    JsonNumber: new codegen_csharp_1.ClassType(carbon, 'JsonNumber'),
    JsonArray: (0, codegen_1.intersect)(jsonArray, {
        Parse: (expression) => (0, codegen_csharp_2.toExpression)(`${jsonArray}.Parse(${(0, codegen_csharp_2.toExpression)(expression)})`)
    }),
    JsonType: (0, codegen_1.intersect)(jsonType, {
        Null: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Null`),
        Object: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Object`),
        Array: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Array`),
        Binary: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Binary`),
        Boolean: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Boolean`),
        Date: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Date`),
        Number: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.Number`),
        String: new codegen_csharp_2.LiteralExpression(`${jsonType.declaration}.String`)
    }),
    XNodeArray: new codegen_csharp_1.ClassType(carbon, 'XNodeArray')
});
//# sourceMappingURL=clientruntime.js.map