UNPKG

@azure-tools/typespec-java

Version:

TypeSpec library for emitting Java client from the TypeSpec REST protocol binding

48 lines 1.68 kB
/* 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); } addSubClient(subClient) { subClient.parent = this; subClient.buildMethodPublic = false; subClient.parentAccessorPublic = true; this.subClients.push(subClient); // at present, sub client must have 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