/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { Aspect, Metadata, Security, } from "@autorest/codemodel";
export class Client extends Aspect {
    constructor(name, description, objectInitializer) {
        super(name, description, objectInitializer);
        this.operationGroups = [];
        this.security = new Security(false);
        this.subClients = [];
        this.buildMethodPublic = true;
        this.parentAccessorPublic = false;
        this.applyTo(this, objectInitializer);
    }
    get globals() {
        return this.globalParameters || (this.globalParameters = []);
    }
    addGlobalParameters(parameters) {
        this.globals.push(...parameters);
    }
    /**
     * Add a sub Client to Client.
     *
     * @param subClient the sub Client
     * @param buildMethodPublic the sub Client can be initialized by its ClientBuilder
     * @param parentAccessorPublic the sub Client can be accessed by its parent Client
     */
    addSubClient(subClient, buildMethodPublic, parentAccessorPublic) {
        subClient.parent = this;
        subClient.buildMethodPublic = buildMethodPublic;
        subClient.parentAccessorPublic = parentAccessorPublic;
        this.subClients.push(subClient);
        // at present, sub client must be in same namespace of its parent client
        subClient.language.java.namespace = this.language.java.namespace;
    }
}
export class ServiceVersion extends Metadata {
    constructor(name, description, initializer) {
        super();
        this.apply({
            language: {
                default: {
                    name: name,
                    description: description,
                },
            },
        }, initializer);
    }
}
export class PageableContinuationToken {
    constructor(parameter, responseProperty, responseHeader) {
        this.parameter = parameter;
        this.responseProperty = responseProperty;
        this.responseHeader = responseHeader;
    }
}
//# sourceMappingURL=client.js.map