UNPKG

@autorest/go

Version:
94 lines 3.9 kB
import * as client from './client.js'; import * as result from './result.js'; import * as type from './type.js'; /** a Go-specific abstraction over REST endpoints */ export interface CodeModel { /** the info for this code model */ info: Info; /** the service type for this code model */ type: CodeModelType; /** the Go package name for this code model */ packageName: string; /** contains the options for this code model */ options: Options; /** all of the struct model types to generate (models.go file). can be empty */ models: Array<type.Model | type.PolymorphicModel>; /** all of the const types to generate (constants.go file). can be empty */ constants: Array<type.Constant>; /** * all of the operation clients. can be empty (models-only build) */ clients: Array<client.Client>; /** all of the parameter groups including the options types (options.go file) */ paramGroups: Array<type.Struct>; /** all of the response envelopes (responses.go file). can be empty */ responseEnvelopes: Array<result.ResponseEnvelope>; /** all of the interfaces for discriminated types (interfaces.go file) */ interfaces: Array<type.Interface>; /** package metadata */ metadata?: {}; } /** the service type that the code model represents */ export type CodeModelType = 'azure-arm' | 'data-plane'; /** contains top-level info about the input source */ export interface Info { title: string; } /** contains module information */ export interface Module { /** the module identity excluding any major version suffix */ name: string; /** the semantic version x.y.z[-beta.N]. the default value is 0.1.0 */ version: string; } /** * contains global options set on the CodeModel. * most of the values come from command-line args. */ export interface Options { /** the header text to emit per file. usually contains license and copyright info */ headerText: string; /** indicates if fakes should be emitted. the default is false */ generateFakes: boolean; /** indicates if tracing spans should be emitted. the default is false */ injectSpans: boolean; /** * indicates whether or not to disallow unknown fields in the JSON unmarshaller. * reproduce the behavior of https://pkg.go.dev/encoding/json#Decoder.DisallowUnknownFields */ disallowUnknownFields: boolean; /** * the module into which the package is being generated. * this is mutually exclusive with module */ containingModule?: string; /** * module information when emitting code as a module. * this is mutually exclusive with containingModule. */ module?: Module; /** custom version of azcore to use instead of the emitter's default value */ azcoreVersion?: string; /** emits Go any types as []byte containing raw JSON. the default value is false */ rawJSONAsBytes: boolean; /** emit slice element types by value (e.g. []string not []*string). the default value is false */ sliceElementsByval: boolean; /** generates example _test.go files. the default value is false */ generateExamples: boolean; /** whether or not to gather all client parameters for the client factory. the default value is true */ factoryGatherAllParams: boolean; } export declare class CodeModel implements CodeModel { constructor(info: Info, type: CodeModelType, packageName: string, options: Options); sortContent(): void; } export declare class Info implements Info { constructor(title: string); } export declare class Module implements Module { constructor(name: string, version: string); } export declare class Options implements Options { constructor(headerText: string, generateFakes: boolean, injectSpans: boolean, disallowUnknownFields: boolean, generateExamples: boolean); } //# sourceMappingURL=package.d.ts.map