diff --git a/docs/configuration.md b/docs/configuration.md index 3998e199bd..93b3837af0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -274,6 +274,28 @@ the standard [`nuget push`][nuget-push] command. [nuget-push]: https://docs.microsoft.com/fr-fr/nuget/nuget-org/publish-a-package [.NET documentation]: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packageiconurl +#### Configuring `GoLang` - **Experimental** + +The `go` target is currently unstable and not suitable for production use. To +enable go package generation, add the `go` key with an empty object to the jsii +targets configuration. + +This will add generated go package code to your specified `outDir` for testing +and experimentation. + +```js +{ + "jsii": { + "targets": { + "go": {}, + // ... + }, + // ... + }, + // ... +} +``` + ### `tsc` In order to the generated `javascript` can be properly loaded by the `jsii` diff --git a/packages/@jsii/kernel/test/kernel.test.ts b/packages/@jsii/kernel/test/kernel.test.ts index e863bd92ae..59d20f3a23 100644 --- a/packages/@jsii/kernel/test/kernel.test.ts +++ b/packages/@jsii/kernel/test/kernel.test.ts @@ -398,6 +398,7 @@ defineTest( namespace: 'Amazon.JSII.Tests.CalculatorNamespace', packageId: 'Amazon.JSII.Tests.CalculatorPackageId', }, + go: {}, java: { package: 'software.amazon.jsii.tests.calculator', maven: { @@ -419,6 +420,7 @@ defineTest( packageId: 'Amazon.JSII.Tests.CalculatorPackageId.LibPackageId', versionSuffix: '-devpreview', }, + go: {}, java: { package: 'software.amazon.jsii.tests.calculator.lib', maven: { diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json index c07a5a918d..b3f4fb7865 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -25,6 +25,7 @@ "types": "lib/index.d.ts", "scripts": { "build": "jsii --project-references && jsii-rosetta", + "pacmak": "jsii-pacmak", "test": "diff-test test/assembly.jsii .jsii", "test:update": "npm run build && UPDATE_DIFF=1 npm run test" }, @@ -38,6 +39,7 @@ "jsii": { "outdir": "dist", "targets": { + "go": {}, "java": { "package": "software.amazon.jsii.tests.calculator.baseofbase", "maven": { diff --git a/packages/@scope/jsii-calc-base-of-base/test/assembly.jsii b/packages/@scope/jsii-calc-base-of-base/test/assembly.jsii index 9754745059..a0d74fa026 100644 --- a/packages/@scope/jsii-calc-base-of-base/test/assembly.jsii +++ b/packages/@scope/jsii-calc-base-of-base/test/assembly.jsii @@ -23,6 +23,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -141,5 +142,5 @@ } }, "version": "0.0.0", - "fingerprint": "DziQGJ8nlNWkjkg4nENQT5/9Gl+eeFGRp1b+csGazr8=" + "fingerprint": "9nL4armG/GJRAhHMWxkKO9B6+nyGD108qvPMtTPljTw=" } diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index 1a5491e08c..8bb94c364e 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -44,6 +44,7 @@ "jsii": { "outdir": "dist", "targets": { + "go": {}, "java": { "package": "software.amazon.jsii.tests.calculator.base", "maven": { diff --git a/packages/@scope/jsii-calc-base/test/assembly.jsii b/packages/@scope/jsii-calc-base/test/assembly.jsii index 37b4544eec..c2e75ccb60 100644 --- a/packages/@scope/jsii-calc-base/test/assembly.jsii +++ b/packages/@scope/jsii-calc-base/test/assembly.jsii @@ -17,6 +17,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -50,6 +51,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -151,5 +153,5 @@ } }, "version": "0.0.0", - "fingerprint": "ttHhQ5EzgjW0lybCNSKOfqilJ04kp4VK3arcpRl3rBM=" + "fingerprint": "JCkFuFqry/njMLNi/IpfTVdkVye/esUFOCoZoFbDD+4=" } diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index 80d8722ddb..ab246b4c85 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -27,6 +27,7 @@ "types": "build/index.d.ts", "scripts": { "build": "jsii --project-references && jsii-rosetta", + "pacmak": "jsii-pacmak", "test": "diff-test test/assembly.jsii .jsii", "test:update": "npm run build && UPDATE_DIFF=1 npm run test" }, @@ -47,6 +48,7 @@ "jsii": { "outdir": "dist", "targets": { + "go": {}, "java": { "package": "software.amazon.jsii.tests.calculator.lib", "maven": { diff --git a/packages/@scope/jsii-calc-lib/test/assembly.jsii b/packages/@scope/jsii-calc-lib/test/assembly.jsii index 249a37197c..f810386a55 100644 --- a/packages/@scope/jsii-calc-lib/test/assembly.jsii +++ b/packages/@scope/jsii-calc-lib/test/assembly.jsii @@ -18,6 +18,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -40,6 +41,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -97,6 +99,7 @@ "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId", "versionSuffix": "-devpreview" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-lib", @@ -757,5 +760,5 @@ } }, "version": "0.0.0", - "fingerprint": "mi8mRAruztXaT0gYqEr9O6UHWWWkiz7XpCdNrWQMPuA=" + "fingerprint": "eQh0XE5tmf4g2rxlhgkrIZJ93RG55/oLM+RNpmaQyGs=" } diff --git a/packages/codemaker/lib/codemaker.ts b/packages/codemaker/lib/codemaker.ts index 2ecb1183d3..c9d029ee27 100644 --- a/packages/codemaker/lib/codemaker.ts +++ b/packages/codemaker/lib/codemaker.ts @@ -85,7 +85,7 @@ export class CodeMaker { */ public line(fmt?: string, ...args: string[]) { if (!this.currentFile) { - throw new Error('Cannot emit source lines without openning a file'); + throw new Error('Cannot emit source lines without opening a file'); } if (fmt) { diff --git a/packages/codemaker/test/source.test.ts b/packages/codemaker/test/source.test.ts index d3e07d6a1f..5123d75810 100644 --- a/packages/codemaker/test/source.test.ts +++ b/packages/codemaker/test/source.test.ts @@ -6,7 +6,7 @@ import { CodeMaker } from '../lib'; test('cannot write before opening a file', () => { const sources = new CodeMaker(); expect(() => sources.line('Nope!')).toThrow( - /Cannot emit source lines without openning a file/, + /Cannot emit source lines without opening a file/, ); }); diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index 3875832b61..f406197929 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -59,6 +59,7 @@ "jsii": { "outdir": "dist", "targets": { + "go": {}, "java": { "package": "software.amazon.jsii.tests.calculator", "maven": { diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 321c8da7f6..8611ff803f 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -45,6 +45,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -67,6 +68,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -109,6 +111,7 @@ "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId", "versionSuffix": "-devpreview" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-lib", @@ -236,6 +239,7 @@ "namespace": "Amazon.JSII.Tests.CalculatorNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator", @@ -13822,5 +13826,5 @@ } }, "version": "0.0.0", - "fingerprint": "TXGVwLZ10oZ08NxDzu6i+fqPtaw5aEqME8+d+KEhL08=" + "fingerprint": "2+VsCif006Pa9j/t5xrvI5psaT2mh2x58UwU31ByN5E=" } diff --git a/packages/jsii-pacmak/lib/generator.ts b/packages/jsii-pacmak/lib/generator.ts index 93dd878724..55cbf1c304 100644 --- a/packages/jsii-pacmak/lib/generator.ts +++ b/packages/jsii-pacmak/lib/generator.ts @@ -31,6 +31,10 @@ export interface GeneratorOptions { } export interface IGenerator { + /** + * + * @param fingerprint + */ generate(fingerprint: boolean): void; /** diff --git a/packages/jsii-pacmak/lib/targets/golang.ts b/packages/jsii-pacmak/lib/targets/golang.ts new file mode 100644 index 0000000000..dbc01e884e --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang.ts @@ -0,0 +1,99 @@ +import { CodeMaker } from 'codemaker'; +import { Assembly } from 'jsii-reflect'; +import { Rosetta } from 'jsii-rosetta'; +import { RootPackage } from './golang/package'; +import { IGenerator } from '../generator'; +import { Target, TargetOptions } from '../target'; + +export class Golang extends Target { + public readonly generator: IGenerator; + + public constructor(options: TargetOptions) { + super(options); + + this.generator = new GolangGenerator(options.rosetta); + } + + /** + * Generates a publishable artifact in `outDir`. + * + * @param sourceDir the directory where the generated source is located. + * @param outDir the directory where the publishable artifact should be placed. + */ + public async build(sourceDir: string, outDir: string): Promise { + return this.copyFiles(sourceDir, outDir); + } +} + +class GolangGenerator implements IGenerator { + private assembly!: Assembly; + private readonly code = new CodeMaker(); + + public constructor(private readonly rosetta: Rosetta) {} + + public async load(_: string, assembly: Assembly): Promise { + this.assembly = assembly; + return Promise.resolve(); + } + + public async upToDate(_outDir: string) { + return Promise.resolve(false); + } + + public generate(): void { + new RootPackage(this.assembly).emit({ + code: this.code, + rosetta: this.rosetta, + }); + } + + public async save(outDir: string, _tarball: string): Promise { + // TODO: Replace with [go-embed](https://github.com/pyros2097/go-embed) + // const bundledRuntimeDotGo = path.join('_jsii', 'bundled-runtime.go'); + // this.code.openFile(bundledRuntimeDotGo); + + // this.code.line( + // `// Embedded data for the tarball containing the runtime of ${this.assembly.name}@${this.assembly.version}`, + // ); + // this.code.openBlock('const tarball = []byte'); + // for await (const line of encodedSlices(tarball)) { + // this.code.line(`${line},`); + // } + // this.code.closeBlock(); + + // this.code.closeFile(bundledRuntimeDotGo); + + await this.code.save(outDir); + } +} + +// TODO: Replace with +// async function* encodedSlices(path: string, sliceSize = 16) { +// const slice = Buffer.alloc(sliceSize); + +// const fd = await fs.open(path, fs.constants.O_RDONLY); + +// while (true) { +// // eslint-disable-next-line no-await-in-loop +// const { bytesRead } = await fs.read(fd, slice, 0, slice.length, null); +// if (bytesRead === 0) { +// return fs.close(fd); +// } +// yield inGroupsOf(slice.toString('hex', 0, bytesRead - 1), 2) +// .map((byte) => `0x${byte}`) +// .join(', '); +// } + +// function inGroupsOf(str: string, count: number) { +// if (str.length % count !== 0) { +// throw new Error( +// `Expected a string with a multiple of ${count} characters, but it has ${str.length}`, +// ); +// } +// const result = new Array(); +// for (let i = 0; i < str.length; i += count) { +// result.push(str.slice(i, i + count)); +// } +// return result; +// } +// } diff --git a/packages/jsii-pacmak/lib/targets/golang/documentation.ts b/packages/jsii-pacmak/lib/targets/golang/documentation.ts new file mode 100644 index 0000000000..833315e451 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/documentation.ts @@ -0,0 +1,15 @@ +import { Docs } from 'jsii-reflect'; +import { EmitContext } from './emit-context'; + +export class Documentation { + public constructor(private readonly docs: Docs) {} + + public emit({ code }: EmitContext): void { + // TODO: Translate code examples to Golang with Rosetta (not implemented there yet) + code.line(`// ${this.docs.summary}`); + code.line('//'); + for (const line of this.docs.remarks.split('\n')) { + code.line(`// ${line}`); + } + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/emit-context.ts b/packages/jsii-pacmak/lib/targets/golang/emit-context.ts new file mode 100644 index 0000000000..d0e3d09206 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/emit-context.ts @@ -0,0 +1,12 @@ +import { CodeMaker } from 'codemaker'; +import { Rosetta } from 'jsii-rosetta'; + +/** + * The context in which Golang code is emitted. + */ +export interface EmitContext { + /** A CodeMaker to write out source code. */ + readonly code: CodeMaker; + /** A Rosetta stone to translate code examples. */ + readonly rosetta: Rosetta; +} diff --git a/packages/jsii-pacmak/lib/targets/golang/package.ts b/packages/jsii-pacmak/lib/targets/golang/package.ts new file mode 100644 index 0000000000..4018fa85db --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/package.ts @@ -0,0 +1,169 @@ +import { CodeMaker } from 'codemaker'; +import { Assembly } from 'jsii-reflect'; +import { join } from 'path'; +import { ReadmeFile } from './readme-file'; +import { Type, Submodule as JsiiSubmodule } from 'jsii-reflect'; +import { EmitContext } from './emit-context'; +import { GoClass, Enum, Interface, Struct } from './types'; +import { findTypeInTree, goPackageName, flatMap } from './util'; + +// JSII golang runtime module name +const JSII_MODULE_NAME = 'github.com/aws-cdk/jsii/jsii'; + +export type ModuleType = Interface | Enum | GoClass | Struct; + +/* + * Package represents a single `.go` source file within a package. This can be the root package file or a submodule + */ +export abstract class Package { + public readonly root: Package; + public readonly file: string; + public readonly submodules: InternalPackage[]; + public readonly types: ModuleType[]; + + public constructor( + private readonly typeSpec: readonly Type[], + private readonly submoduleSpec: readonly JsiiSubmodule[], + public readonly moduleName: string, + public readonly filePath: string, + // If no root is provided, this module is the root + root?: Package, + ) { + this.file = `${filePath}.go`; + this.root = root || this; + this.submodules = this.submoduleSpec.map( + (sm) => new InternalPackage(this.root, this, sm), + ); + + this.types = this.typeSpec.map( + (type: Type): ModuleType => { + if (type.isInterfaceType() && type.datatype) { + return new Struct(this, type); + } else if (type.isInterfaceType()) { + return new Interface(this, type); + } else if (type.isClassType()) { + return new GoClass(this, type); + } else if (type.isEnumType()) { + return new Enum(this, type); + } + throw new Error( + `Type: ${type.name} with kind ${type.kind} is not a supported type`, + ); + }, + ); + } + + /* + * Packages within this module + */ + public get dependencies(): Package[] { + return flatMap( + this.types, + (t: ModuleType): Package[] => t.dependencies, + ).filter((mod) => mod.moduleName !== this.moduleName); + } + + /* + * The module names of this modules dependencies. Used for import statements + */ + public get dependencyImports(): Set { + return new Set(this.dependencies.map((mod) => mod.moduleName)); + } + + /* + * Search for a type with a `fqn` within this. Searches all Children modules as well. + */ + public findType(fqn: string): ModuleType | undefined { + return findTypeInTree(this, fqn); + } + + public emit(context: EmitContext): void { + const { code } = context; + code.openFile(this.file); + this.emitHeader(code); + this.emitImports(code); + this.emitTypes(code); + code.closeFile(this.file); + + this.emitInternalPackages(context); + } + + private emitHeader(code: CodeMaker) { + code.line(`package ${this.moduleName}`); + code.line(); + } + + private emitImports(code: CodeMaker) { + code.open('import ('); + code.line(`"${JSII_MODULE_NAME}"`); + + for (const modName of this.dependencyImports) { + // If the module is the same as the current one being written, don't emit an import statement + if (modName !== this.moduleName) { + code.line(`"${modName}"`); + } + } + + code.close(')'); + code.line(); + } + + public emitInternalPackages(context: EmitContext) { + for (const submodule of this.submodules) { + submodule.emit(context); + } + } + + private emitTypes(code: CodeMaker) { + for (const type of this.types) { + type.emit(code); + } + } +} + +/* + * RootPackage corresponds to JSII module. + * + * Extends `Package` for root source package emit logic + */ +export class RootPackage extends Package { + public readonly assembly: Assembly; + + public constructor(assembly: Assembly) { + const moduleName = goPackageName(assembly.name); + const filePath = join(...moduleName.split('.')); + + super( + Object.values(assembly.types), + assembly.submodules, + moduleName, + filePath, + ); + + this.assembly = assembly; + } + + public emit(context: EmitContext): void { + super.emit(context); + + if (this.assembly.readme?.markdown) { + new ReadmeFile(this.moduleName, this.assembly.readme.markdown); + } + } +} + +/* + * InternalPackage refers to any go package within a given JSII module. + */ +export class InternalPackage extends Package { + public readonly parent: Package; + + public constructor(root: Package, parent: Package, assembly: JsiiSubmodule) { + const moduleName = goPackageName(assembly.name); + const filePath = `${parent.filePath}/${moduleName}`; + + super(assembly.types, assembly.submodules, moduleName, filePath, root); + + this.parent = parent; + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/readme-file.ts b/packages/jsii-pacmak/lib/targets/golang/readme-file.ts new file mode 100644 index 0000000000..8a06a139e7 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/readme-file.ts @@ -0,0 +1,43 @@ +import { join } from 'path'; +import { EmitContext } from './emit-context'; +// import { Translation } from 'jsii-rosetta'; +// import { INCOMPLETE_DISCLAIMER_COMPILING, INCOMPLETE_DISCLAIMER_NONCOMPILING } from '..'; + +export class ReadmeFile { + public constructor( + private readonly packageName: string, + private readonly document: string, + ) {} + + public emit({ code /*, rosetta */ }: EmitContext) { + const nameParts = this.packageName.split('.'); + const file = join( + ...nameParts.slice(0, nameParts.length - 11), + 'README.md', + ); + + code.openFile(file); + const translated = this.document; // rosetta.translateSnippetsInMarkdown(this.document, 'go', prependDisclaimer); + for (const line of translated.split('\n')) { + code.line(line); + } + code.closeFile(file); + } + + /* + function prependDisclaimer(translation: Translation) { + const source = addDisclaimerIfNeeded(); + return { language: translation.language, source }; + + function addDisclaimerIfNeeded(): string { + if (translation.didCompile && INCOMPLETE_DISCLAIMER_COMPILING) { + return `// ${INCOMPLETE_DISCLAIMER_COMPILING}\n\n${translation.source}`; + } + if (!translation.didCompile && INCOMPLETE_DISCLAIMER_NONCOMPILING) { + return `// ${INCOMPLETE_DISCLAIMER_NONCOMPILING}\n\n${translation.source}`; + } + return translation.source; + } + } + */ +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/class.ts b/packages/jsii-pacmak/lib/targets/golang/types/class.ts new file mode 100644 index 0000000000..59f43c360b --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/class.ts @@ -0,0 +1,189 @@ +import { Method, Property, ClassType } from 'jsii-reflect'; +import { CodeMaker } from 'codemaker'; +import { GoTypeRef } from './go-type-reference'; +import { GoType, GoEmitter } from './go-type'; +import { TypeField } from './type-field'; +import { Package } from '../package'; +import { getFieldDependencies } from '../util'; + +// String appended to all go Class Interfaces +const CLASS_INTERFACE_SUFFIX = 'Iface'; + +export class ClassProperty implements TypeField { + public readonly name: string; + public readonly references?: GoTypeRef; + + public constructor( + public parent: GoClass, + public readonly property: Property, + ) { + this.name = this.property.name; + + if (property.type) { + this.references = new GoTypeRef(parent.parent.root, property.type); + } + } + + public emit(code: CodeMaker) { + const name = code.toPascalCase(this.property.name); + const type = + this.references?.scopedName(this.parent.parent) ?? + this.property.toString(); + + // If struct property is type of parent struct, use a pointer as type to avoid recursive struct type error + if (this.references?.type?.name === this.parent.name) { + code.line(`${name} *${type}`); + } else { + code.line(`${name} ${type}`); + } + } + + public emitForInterface(code: CodeMaker) { + const name = code.toPascalCase(this.property.name); + const type = + this.references?.scopedName(this.parent.parent) ?? + this.property.toString(); + + code.line(`Get${name}() ${type}`); + if (!this.property.protected) { + code.line(`Set${name}()`); + } + } +} + +export class ClassMethod implements TypeField { + public readonly name: string; + public readonly references?: GoTypeRef; + + private readonly NOOP_RETURN_MAP: { [type: string]: string } = { + float64: '0.0', + string: '"NOOP_RETURN_STRING"', + bool: 'true', + }; + + public constructor( + public readonly parent: GoClass, + public readonly method: Method, + ) { + this.name = this.method.name; + + if (method.returns.type) { + this.references = new GoTypeRef(parent.parent.root, method.returns.type); + } + } + + public emit(code: CodeMaker) { + const name = code.toPascalCase(this.method.name); + const type = + this.references?.scopedName(this.parent.parent) ?? this.method.toString(); + + const instanceArg = this.parent.name.substring(0, 1).toLowerCase(); + + // TODO: Method Arguments + code.openBlock( + `func (${instanceArg} *${this.parent.name}) ${name}() ${ + type ? `${type} ` : '' + }`, + ); + + code.line(`jsii.NoOpRequest(jsii.NoOpApiRequest {`); + code.indent(); + code.line(`Class: "${this.parent.name}",`); + code.line(`Method: "${name}",`); + code.line( + `Args: []string{${this.method.parameters.reduce((accum: string, p, i) => { + const prefix = i === 0 ? '' : ' '; + return `${accum}${prefix}"${p.type.toString()}",`; + }, '')}},`, + ); + code.unindent(); + code.line(`})`); + + const ret = this.references; + if (ret?.type?.type.isClassType()) { + code.line(`return ${type}{}`); + } else if (ret?.type?.type.isEnumType()) { + code.line(`return "ENUM_DUMMY"`); + } else { + code.line(`return ${this.getDummyReturn(type)}`); + } + + code.closeBlock(); + code.line(); + } + + public emitForInterface(code: CodeMaker) { + const name = code.toPascalCase(this.method.name); + const type = + this.references?.scopedName(this.parent.parent) ?? this.method.toString(); + + code.line(`${name}() ${type}`); + } + + private getDummyReturn(type: string): string { + return this.NOOP_RETURN_MAP[type] || 'nil'; + } +} + +/* + * Class wraps a Typescript class as a Go custom struct type TODO rename? + */ +export class GoClass extends GoType implements GoEmitter { + public readonly properties: ClassProperty[]; + public readonly methods: ClassMethod[]; + public readonly interfaceName: string; + + public constructor(parent: Package, public type: ClassType) { + super(parent, type); + + this.properties = Object.values(this.type.getProperties()).map( + (prop) => new ClassProperty(this, prop), + ); + + this.methods = Object.values(this.type.getMethods()).map( + (method) => new ClassMethod(this, method), + ); + + this.interfaceName = `${this.type.name}${CLASS_INTERFACE_SUFFIX}`; + } + + public emit(code: CodeMaker): void { + this.emitClassInterface(code); + + code.openBlock(`type ${this.name} struct`); + + for (const property of this.properties) { + property.emit(code); + } + + code.closeBlock(); + code.line(); + + for (const method of this.methods) { + method.emit(code); + } + } + + // Generate interface that defines getters for public properties and any method signatures + private emitClassInterface(code: CodeMaker) { + code.openBlock(`type ${this.interfaceName} interface`); + + for (const property of this.properties) { + property.emitForInterface(code); + } + + for (const method of this.methods) { + method.emitForInterface(code); + } + + code.closeBlock(); + code.line(); + } + + public get dependencies(): Package[] { + return [ + ...getFieldDependencies(this.properties), + ...getFieldDependencies(this.methods), + ]; + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/enum.ts b/packages/jsii-pacmak/lib/targets/golang/types/enum.ts new file mode 100644 index 0000000000..7aaef92b25 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/enum.ts @@ -0,0 +1,32 @@ +import { CodeMaker } from 'codemaker'; +import { EnumType } from 'jsii-reflect'; +import { GoType } from './go-type'; +import { Package } from '../package'; + +export class Enum extends GoType { + public constructor(parent: Package, public type: EnumType) { + super(parent, type); + } + + public emit(code: CodeMaker) { + // TODO figure out the value type -- probably a string in most cases + const valueType = 'string'; + code.line(`type ${this.name} ${valueType}`); + code.line(); + code.open(`const (`); + + // Const values are prefixed by the wrapped value type + for (const member of this.type.members) { + const enumKey = this.name + code.toPascalCase(member.name); + const enumType = this.name; + code.line(`${enumKey} ${enumType} = "${member.name}"`); + } + + code.close(`)`); + code.line(); + } + + public get dependencies(): Package[] { + return []; + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/go-type-reference.ts b/packages/jsii-pacmak/lib/targets/golang/types/go-type-reference.ts new file mode 100644 index 0000000000..f2f5e7e5bd --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/go-type-reference.ts @@ -0,0 +1,99 @@ +import { TypeReference } from 'jsii-reflect'; +import { Package } from '../package'; +import { GoType } from './go-type'; +import { toPascalCase } from 'codemaker'; + +const GO_ANY = 'jsii.Any'; + +/* + * Maps names of JS primitives to corresponding Go types as strings + */ +class PrimitiveMapper { + private readonly MAP: { [key: string]: string } = { + number: 'float64', + boolean: 'bool', + any: GO_ANY, + // TODO: Resolve "time" package dependency where needed and change to "time.Time" + date: 'string', + json: `map[string]${GO_ANY}`, + }; + + public constructor(private readonly name: string) {} + + public get goPrimitive(): string { + return this.MAP[this.name] ?? this.name; + } +} + +/* + * Accepts a JSII type reference and can resolve the GoType within the module tree. + */ +export class GoTypeRef { + public constructor( + public readonly root: Package, + public readonly reference: TypeReference, + ) {} + + public isPrimitive() { + return Boolean(this.reference.primitive); + } + + public get type(): GoType | undefined { + if (this.reference.fqn) { + return this.root.findType(this.reference.fqn); + } + + return undefined; + } + + public get name() { + return this.type?.name; + } + + public get namespace() { + return this.type?.parent.moduleName; + } + + /* + * Return the name of a type for reference from the `BasePackage` passed in + */ + public scopedName(scope: Package): string { + // type references a primitie + if (this.reference.primitive) { + return new PrimitiveMapper(this.reference.primitive).goPrimitive; + } + + // type is an array + if (this.reference.arrayOfType) { + const innerName = + new GoTypeRef(this.root, this.reference.arrayOfType).scopedName( + scope, + ) ?? GO_ANY; + + return `[]${innerName}`; + } + + // type is a map + if (this.reference.mapOfType) { + const innerName = + new GoTypeRef(this.root, this.reference.mapOfType).scopedName(scope) ?? + GO_ANY; + return `map[string]${innerName}`; + } + + // type is defined in the same scope as the current one, no namespace required + if (scope.moduleName === this.namespace && this.name) { + // if the current scope is the same as the types scope, return without a namespace + return toPascalCase(this.name); + } + + // type is defined in another module and requires a namespace and import + if (this.name) { + return `${this.namespace}.${toPascalCase(this.name)}`; + } + + // type isn't handled + // TODO: Are there other cases to handle? if not throw an error. + return GO_ANY; + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/go-type.ts b/packages/jsii-pacmak/lib/targets/golang/types/go-type.ts new file mode 100644 index 0000000000..17032285f0 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/go-type.ts @@ -0,0 +1,19 @@ +import { CodeMaker } from 'codemaker'; +import { Type } from 'jsii-reflect'; +import { Package } from '../package'; + +export interface GoEmitter { + emit(code: CodeMaker): void; +} + +export class GoType { + public constructor(public parent: Package, public type: Type) {} + + public get name() { + return this.type.name; + } + + public get namespace() { + return this.parent.moduleName; + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/index.ts b/packages/jsii-pacmak/lib/targets/golang/types/index.ts new file mode 100644 index 0000000000..1aef16176c --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/index.ts @@ -0,0 +1,7 @@ +export * from './class'; +export * from './enum'; +export * from './go-type'; +export * from './go-type-reference'; +export * from './interface'; +export * from './struct'; +export * from './type-field'; diff --git a/packages/jsii-pacmak/lib/targets/golang/types/interface.ts b/packages/jsii-pacmak/lib/targets/golang/types/interface.ts new file mode 100644 index 0000000000..dd41592eaf --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/interface.ts @@ -0,0 +1,50 @@ +import { CodeMaker } from 'codemaker'; +import { InterfaceType, Method, Property } from 'jsii-reflect'; +import { GoType } from './go-type'; +import { GoTypeRef } from './go-type-reference'; +import { Package } from '../package'; + +export class Interface extends GoType { + public readonly dependencies: Package[] = []; + + public constructor(parent: Package, public type: InterfaceType) { + super(parent, type); + } + + public emit(code: CodeMaker): void { + code.openBlock(`type ${this.name} interface`); + Object.values(this.type.getMethods()).forEach((method) => + this.emitInterfaceMethod(code, method), + ); + + Object.values(this.type.getProperties()).forEach((property) => + this.emitInterfaceProperty(code, property), + ); + code.closeBlock(); + code.line(); + } + + private emitInterfaceProperty(code: CodeMaker, property: Property) { + const propName = code.toPascalCase(property.name); + const type = new GoTypeRef(this.parent.root, property.type).scopedName( + this.parent, + ); + + code.line(`Get${propName}() ${type}`); + // if (!property.protected) { + // code.line(`set${name}()`); + // } + } + + private emitInterfaceMethod(code: CodeMaker, method: Method) { + const returns = method.returns.type.void + ? '' + : ` ${new GoTypeRef(this.parent.root, method.returns.type).scopedName( + this.parent, + )}`; + + const methodName = code.toPascalCase(method.name); + + code.line(`${methodName}()${returns}`); + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/struct.ts b/packages/jsii-pacmak/lib/targets/golang/types/struct.ts new file mode 100644 index 0000000000..6b529a55a0 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/struct.ts @@ -0,0 +1,102 @@ +import { GoType } from './go-type'; +import { GoTypeRef } from './go-type-reference'; +import { Package } from '../package'; +import { InterfaceType, Property } from 'jsii-reflect'; +import { CodeMaker, toPascalCase } from 'codemaker'; + +const STRUCT_INTERFACE_SUFFIX = 'Iface'; + +// JSII datatype interfaces, aka structs +export class Struct extends GoType { + public readonly properties: StructProperty[]; + public readonly dependencies: Package[] = []; + + public constructor(parent: Package, public type: InterfaceType) { + super(parent, type); + + // TODO check if datatype? (isDataType() on jsii-reflect seems wrong) + this.properties = Object.values(this.type.getProperties()).map( + (prop) => new StructProperty(this, prop), + ); + } + + // needs to generate both a Go interface and a struct, as well as the methods on the struct + public emit(code: CodeMaker): void { + this.generateInterface(code); + this.generateStruct(code); + this.generateImpl(code); + } + + private generateInterface(code: CodeMaker): void { + const interfaceName = `${this.name}${STRUCT_INTERFACE_SUFFIX}`; + code.openBlock(`type ${interfaceName} interface`); + + this.properties.forEach((property) => property.emitGetter(code)); + + code.closeBlock(); + code.line(); + } + + private generateStruct(code: CodeMaker): void { + code.openBlock(`type ${this.name} struct`); + + this.properties.forEach((property) => property.emitProperty(code)); + + code.closeBlock(); + code.line(); + } + + private generateImpl(code: CodeMaker): void { + code.line(); + this.properties.forEach((property) => property.emitMethod(code)); + code.line(); + } +} + +// StructProperty encapsulates logic for public properties on the concrete struct +export class StructProperty { + public readonly name: string; + public readonly getter: string; + public readonly references?: GoTypeRef; + + public constructor( + public readonly parent: Struct, + public readonly property: Property, + ) { + if (property.type) { + this.references = new GoTypeRef(parent.parent.root, property.type); + } + + this.name = toPascalCase(this.property.name); + this.getter = `Get${this.name}`; + } + + public emitProperty(code: CodeMaker) { + code.line(`${this.name} ${this.returnType}`); // TODO figure out gofmt for indentation? + } + + public emitGetter(code: CodeMaker) { + code.line(`${this.getter}() ${this.returnType}`); + } + + public emitMethod(code: CodeMaker) { + const receiver = this.parent.name; + const instanceArg = receiver.substring(0, 1).toLowerCase(); + + code.openBlock( + `func (${instanceArg} ${receiver}) ${ + this.getter + }()${` ${this.returnType}`}`, + ); + code.line(`return ${instanceArg}.${this.name}`); + code.closeBlock(); + code.line(); + } + + public get returnType(): string { + return ( + this.references?.scopedName(this.parent.parent) ?? + this.property.type.toString() + ); + } +} diff --git a/packages/jsii-pacmak/lib/targets/golang/types/type-field.ts b/packages/jsii-pacmak/lib/targets/golang/types/type-field.ts new file mode 100644 index 0000000000..c1b5befd62 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/types/type-field.ts @@ -0,0 +1,10 @@ +import { GoClass, Interface, GoTypeRef } from './index'; + +/* + * Structure for Class and Interface methods. Useful for sharing logic for dependency resolution + */ +export interface TypeField { + name: string; + parent: GoClass | Interface; + references?: GoTypeRef; +} diff --git a/packages/jsii-pacmak/lib/targets/golang/util.ts b/packages/jsii-pacmak/lib/targets/golang/util.ts new file mode 100644 index 0000000000..9f9b433f38 --- /dev/null +++ b/packages/jsii-pacmak/lib/targets/golang/util.ts @@ -0,0 +1,47 @@ +import { Package, ModuleType } from './package'; +import { TypeField } from './types'; + +/* + * Recursively search module for type with fqn + */ +export function findTypeInTree( + module: Package, + fqn: string, +): ModuleType | undefined { + const result = module.types.find((t) => t.type.fqn === fqn); + + if (result) { + return result; + } + + return module.submodules.reduce((accum: ModuleType | undefined, sm) => { + return accum || findTypeInTree(sm, fqn); + }, undefined); +} + +/* + * Format NPM package names as idiomatic Go module name + */ +export function goPackageName(name: string): string { + return name.replace(/[^a-z0-9.]/gi, '').toLowerCase(); +} + +export function flatMap( + collection: readonly T[], + mapper: (value: T) => readonly R[], +): readonly R[] { + return collection + .map(mapper) + .reduce((acc, elt) => acc.concat(elt), new Array()); +} + +/* + * Return module dependencies of a class or interface fields + */ +export function getFieldDependencies(fields: TypeField[]): Package[] { + return fields.reduce((accum: Package[], field) => { + return field.references?.type?.parent + ? [...accum, field.references?.type.parent] + : accum; + }, []); +} diff --git a/packages/jsii-pacmak/lib/targets/index.ts b/packages/jsii-pacmak/lib/targets/index.ts index a53aaad725..6599246aaf 100644 --- a/packages/jsii-pacmak/lib/targets/index.ts +++ b/packages/jsii-pacmak/lib/targets/index.ts @@ -1,12 +1,13 @@ import { OneByOneBuilder, TargetBuilder, BuildOptions } from '../builder'; import { DotnetBuilder } from './dotnet'; +import { Golang } from './golang'; import { JavaBuilder } from './java'; import JavaScript from './js'; import Python from './python'; import { JsiiModule } from '../packaging'; -export type TargetName = 'dotnet' | 'java' | 'js' | 'python'; +export type TargetName = 'dotnet' | 'go' | 'java' | 'js' | 'python'; export type BuilderFactory = ( modules: JsiiModule[], options: BuildOptions, @@ -14,6 +15,7 @@ export type BuilderFactory = ( export const ALL_BUILDERS: { [key in TargetName]: BuilderFactory } = { dotnet: (ms, o) => new DotnetBuilder(ms, o), + go: (ms, o) => new OneByOneBuilder('golang', Golang, ms, o), java: (ms, o) => new JavaBuilder(ms, o), js: (ms, o) => new OneByOneBuilder('js', JavaScript, ms, o), python: (ms, o) => new OneByOneBuilder('python', Python, ms, o), diff --git a/packages/jsii-pacmak/test/__snapshots__/jsii-pacmak.test.ts.snap b/packages/jsii-pacmak/test/__snapshots__/jsii-pacmak.test.ts.snap index 23712ac5da..d58a57299b 100644 --- a/packages/jsii-pacmak/test/__snapshots__/jsii-pacmak.test.ts.snap +++ b/packages/jsii-pacmak/test/__snapshots__/jsii-pacmak.test.ts.snap @@ -23,6 +23,8 @@ exports[`Generated code for "@scope/jsii-calc-base": / 1`] = ` ┃ ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj ┃ ┣━ 📄 AssemblyInfo.cs ┃ ┗━ 📄 scope-jsii-calc-base-0.0.0.tgz + ┣━ 📁 golang + ┃ ┗━ 📄 scopejsiicalcbase.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -84,6 +86,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -117,6 +120,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -218,7 +222,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII } }, "version": "0.0.0", - "fingerprint": "ttHhQ5EzgjW0lybCNSKOfqilJ04kp4VK3arcpRl3rBM=" + "fingerprint": "JCkFuFqry/njMLNi/IpfTVdkVye/esUFOCoZoFbDD+4=" } `; @@ -473,6 +477,52 @@ using Amazon.JSII.Runtime.Deputy; exports[`Generated code for "@scope/jsii-calc-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base": /golang/scopejsiicalcbase.go 1`] = ` +package scopejsiicalcbase + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type BaseIface interface { + TypeName() jsii.Any +} + +type Base struct { +} + +func (b *Base) TypeName() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Base", + Method: "TypeName", + Args: []string{}, + + }) + return nil +} + +type BasePropsIface interface { + GetBar() string +} + +type BaseProps struct { + Bar string +} + + +func (b BaseProps) GetBar() string { + return b.Bar +} + + +type IBaseInterface interface { + Bar() +} + + +`; + exports[`Generated code for "@scope/jsii-calc-base": /java/pom.xml 1`] = ` @@ -1164,6 +1214,8 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": / 1`] = ` ┃ ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId.csproj ┃ ┣━ 📄 AssemblyInfo.cs ┃ ┗━ 📄 scope-jsii-calc-base-of-base-0.0.0.tgz + ┣━ 📁 golang + ┃ ┗━ 📄 scopejsiicalcbaseofbase.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -1232,6 +1284,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Ama "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -1350,7 +1403,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Ama } }, "version": "0.0.0", - "fingerprint": "DziQGJ8nlNWkjkg4nENQT5/9Gl+eeFGRp1b+csGazr8=" + "fingerprint": "9nL4armG/GJRAhHMWxkKO9B6+nyGD108qvPMtTPljTw=" } `; @@ -1597,6 +1650,70 @@ using Amazon.JSII.Runtime.Deputy; exports[`Generated code for "@scope/jsii-calc-base-of-base": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-base-of-base": /golang/scopejsiicalcbaseofbase.go 1`] = ` +package scopejsiicalcbaseofbase + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type IVeryBaseInterface interface { + Foo() +} + +type StaticConsumerIface interface { + Consume() jsii.Any +} + +type StaticConsumer struct { +} + +func (s *StaticConsumer) Consume() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StaticConsumer", + Method: "Consume", + Args: []string{"any",}, + + }) + return nil +} + +type VeryIface interface { + Hey() float64 +} + +type Very struct { +} + +func (v *Very) Hey() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Very", + Method: "Hey", + Args: []string{}, + + }) + return 0.0 +} + +type VeryBasePropsIface interface { + GetFoo() Very +} + +type VeryBaseProps struct { + Foo Very +} + + +func (v VeryBaseProps) GetFoo() Very { + return v.Foo +} + + + +`; + exports[`Generated code for "@scope/jsii-calc-base-of-base": /java/pom.xml 1`] = ` @@ -2262,6 +2379,10 @@ exports[`Generated code for "@scope/jsii-calc-lib": / 1`] = ` ┃ ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj ┃ ┣━ 📄 AssemblyInfo.cs ┃ ┗━ 📄 scope-jsii-calc-lib-0.0.0.tgz + ┣━ 📁 golang + ┃ ┣━ 📁 scopejsiicalclib + ┃ ┃ ┗━ 📄 submodule.go + ┃ ┗━ 📄 scopejsiicalclib.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -2338,6 +2459,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII. "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -2360,6 +2482,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII. "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -2417,6 +2540,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII. "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId", "versionSuffix": "-devpreview" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-lib", @@ -3077,7 +3201,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII. } }, "version": "0.0.0", - "fingerprint": "mi8mRAruztXaT0gYqEr9O6UHWWWkiz7XpCdNrWQMPuA=" + "fingerprint": "eQh0XE5tmf4g2rxlhgkrIZJ93RG55/oLM+RNpmaQyGs=" } `; @@ -4354,6 +4478,219 @@ using Amazon.JSII.Runtime.Deputy; exports[`Generated code for "@scope/jsii-calc-lib": /dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.0.0.tgz is a tarball`; +exports[`Generated code for "@scope/jsii-calc-lib": /golang/scopejsiicalclib.go 1`] = ` +package scopejsiicalclib + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type EnumFromScopedModule string + +const ( + EnumFromScopedModuleValue1 EnumFromScopedModule = "VALUE1" + EnumFromScopedModuleValue2 EnumFromScopedModule = "VALUE2" +) + +type IDoublable interface { + GetDoubleValue() float64 +} + +type IFriendly interface { + Hello() string +} + +type IThreeLevelsInterface interface { + Baz() +} + +type MyFirstStructIface interface { + GetAnumber() float64 + GetAstring() string + GetFirstOptional() []string +} + +type MyFirstStruct struct { + Anumber float64 + Astring string + FirstOptional []string +} + + +func (m MyFirstStruct) GetAnumber() float64 { + return m.Anumber +} + +func (m MyFirstStruct) GetAstring() string { + return m.Astring +} + +func (m MyFirstStruct) GetFirstOptional() []string { + return m.FirstOptional +} + + +type NumberIface interface { + GetDoubleValue() float64 + SetDoubleValue() + GetValue() float64 + SetValue() +} + +type Number struct { + DoubleValue float64 + Value float64 +} + +type OperationIface interface { + ToString() string +} + +type Operation struct { +} + +func (o *Operation) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Operation", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type StructWithOnlyOptionalsIface interface { + GetOptional1() string + GetOptional2() float64 + GetOptional3() bool +} + +type StructWithOnlyOptionals struct { + Optional1 string + Optional2 float64 + Optional3 bool +} + + +func (s StructWithOnlyOptionals) GetOptional1() string { + return s.Optional1 +} + +func (s StructWithOnlyOptionals) GetOptional2() float64 { + return s.Optional2 +} + +func (s StructWithOnlyOptionals) GetOptional3() bool { + return s.Optional3 +} + + +type ValueIface interface { + GetValue() float64 + SetValue() + ToString() string +} + +type Value struct { + Value float64 +} + +func (v *Value) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Value", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + + +`; + +exports[`Generated code for "@scope/jsii-calc-lib": /golang/scopejsiicalclib/submodule.go 1`] = ` +package submodule + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type IReflectable interface { + GetEntries() []ReflectableEntry +} + +type NestingClassIface interface { +} + +type NestingClass struct { +} + +type NestedClassIface interface { + GetProperty() string + SetProperty() +} + +type NestedClass struct { + Property string +} + +type NestedStructIface interface { + GetName() string +} + +type NestedStruct struct { + Name string +} + + +func (n NestedStruct) GetName() string { + return n.Name +} + + +type ReflectableEntryIface interface { + GetKey() string + GetValue() jsii.Any +} + +type ReflectableEntry struct { + Key string + Value jsii.Any +} + + +func (r ReflectableEntry) GetKey() string { + return r.Key +} + +func (r ReflectableEntry) GetValue() jsii.Any { + return r.Value +} + + +type ReflectorIface interface { + AsMap() map[string]jsii.Any +} + +type Reflector struct { +} + +func (r *Reflector) AsMap() map[string]jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Reflector", + Method: "AsMap", + Args: []string{"@scope/jsii-calc-lib.submodule.IReflectable",}, + + }) + return nil +} + + +`; + exports[`Generated code for "@scope/jsii-calc-lib": /java/pom.xml 1`] = ` @@ -6931,6 +7268,22 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 Amazon.JSII.Tests.CalculatorPackageId.csproj ┃ ┣━ 📄 AssemblyInfo.cs ┃ ┗━ 📄 jsii-calc-0.0.0.tgz + ┣━ 📁 golang + ┃ ┣━ 📁 jsiicalc + ┃ ┃ ┣━ 📄 composition.go + ┃ ┃ ┣━ 📄 derivedclasshasnoproperties.go + ┃ ┃ ┣━ 📄 interfaceinnamespaceincludesclasses.go + ┃ ┃ ┣━ 📄 interfaceinnamespaceonlyinterface.go + ┃ ┃ ┣━ 📄 pythonself.go + ┃ ┃ ┣━ 📁 submodule + ┃ ┃ ┃ ┣━ 📄 backreferences.go + ┃ ┃ ┃ ┣━ 📄 child.go + ┃ ┃ ┃ ┣━ 📄 isolated.go + ┃ ┃ ┃ ┣━ 📁 nestedsubmodule + ┃ ┃ ┃ ┃ ┗━ 📄 deeplynested.go + ┃ ┃ ┃ ┗━ 📄 nestedsubmodule.go + ┃ ┃ ┗━ 📄 submodule.go + ┃ ┗━ 📄 jsiicalc.go ┣━ 📁 java ┃ ┣━ 📄 pom.xml ┃ ┗━ 📁 src @@ -7262,6 +7615,7 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base", @@ -7284,6 +7638,7 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-base-of-base", @@ -7326,6 +7681,7 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId", "versionSuffix": "-devpreview" }, + "go": {}, "java": { "maven": { "artifactId": "calculator-lib", @@ -7453,6 +7809,7 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu "namespace": "Amazon.JSII.Tests.CalculatorNamespace", "packageId": "Amazon.JSII.Tests.CalculatorPackageId" }, + "go": {}, "java": { "maven": { "artifactId": "calculator", @@ -21039,7 +21396,7 @@ exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.Calcu } }, "version": "0.0.0", - "fingerprint": "TXGVwLZ10oZ08NxDzu6i+fqPtaw5aEqME8+d+KEhL08=" + "fingerprint": "2+VsCif006Pa9j/t5xrvI5psaT2mh2x58UwU31ByN5E=" } `; @@ -37793,6 +38150,5572 @@ using Amazon.JSII.Runtime.Deputy; exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.0.0.tgz 1`] = `dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.0.0.tgz is a tarball`; +exports[`Generated code for "jsii-calc": /golang/jsiicalc.go 1`] = ` +package jsiicalc + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type AbstractClassIface interface { + GetPropFromInterface() string + SetPropFromInterface() + AbstractMethod() string + NonAbstractMethod() float64 +} + +type AbstractClass struct { + PropFromInterface string +} + +func (a *AbstractClass) AbstractMethod() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractClass", + Method: "AbstractMethod", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (a *AbstractClass) NonAbstractMethod() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractClass", + Method: "NonAbstractMethod", + Args: []string{}, + + }) + return 0.0 +} + +type AbstractClassBaseIface interface { + GetAbstractProperty() string + SetAbstractProperty() +} + +type AbstractClassBase struct { + AbstractProperty string +} + +type AbstractClassReturnerIface interface { + GetReturnAbstractFromProperty() AbstractClassBase + SetReturnAbstractFromProperty() + GiveMeAbstract() AbstractClass + GiveMeInterface() IInterfaceImplementedByAbstractClass +} + +type AbstractClassReturner struct { + ReturnAbstractFromProperty AbstractClassBase +} + +func (a *AbstractClassReturner) GiveMeAbstract() AbstractClass { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractClassReturner", + Method: "GiveMeAbstract", + Args: []string{}, + + }) + return AbstractClass{} +} + +func (a *AbstractClassReturner) GiveMeInterface() IInterfaceImplementedByAbstractClass { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractClassReturner", + Method: "GiveMeInterface", + Args: []string{}, + + }) + return nil +} + +type AbstractSuiteIface interface { + GetProperty() string + SomeMethod() string + WorkItAll() string +} + +type AbstractSuite struct { + Property string +} + +func (a *AbstractSuite) SomeMethod() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractSuite", + Method: "SomeMethod", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (a *AbstractSuite) WorkItAll() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AbstractSuite", + Method: "WorkItAll", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +type AddIface interface { + GetValue() float64 + SetValue() + ToString() string +} + +type Add struct { + Value float64 +} + +func (a *Add) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Add", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type AllTypesIface interface { + GetEnumPropertyValue() float64 + SetEnumPropertyValue() + GetAnyArrayProperty() []jsii.Any + SetAnyArrayProperty() + GetAnyMapProperty() map[string]jsii.Any + SetAnyMapProperty() + GetAnyProperty() jsii.Any + SetAnyProperty() + GetArrayProperty() []string + SetArrayProperty() + GetBooleanProperty() bool + SetBooleanProperty() + GetDateProperty() string + SetDateProperty() + GetEnumProperty() AllTypesEnum + SetEnumProperty() + GetJsonProperty() map[string]jsii.Any + SetJsonProperty() + GetMapProperty() map[string]jsii.Any + SetMapProperty() + GetNumberProperty() float64 + SetNumberProperty() + GetStringProperty() string + SetStringProperty() + GetUnionArrayProperty() []jsii.Any + SetUnionArrayProperty() + GetUnionMapProperty() map[string]jsii.Any + SetUnionMapProperty() + GetUnionProperty() jsii.Any + SetUnionProperty() + GetUnknownArrayProperty() []jsii.Any + SetUnknownArrayProperty() + GetUnknownMapProperty() map[string]jsii.Any + SetUnknownMapProperty() + GetUnknownProperty() jsii.Any + SetUnknownProperty() + GetOptionalEnumValue() StringEnum + SetOptionalEnumValue() + AnyIn() jsii.Any + AnyOut() jsii.Any + EnumMethod() StringEnum +} + +type AllTypes struct { + EnumPropertyValue float64 + AnyArrayProperty []jsii.Any + AnyMapProperty map[string]jsii.Any + AnyProperty jsii.Any + ArrayProperty []string + BooleanProperty bool + DateProperty string + EnumProperty AllTypesEnum + JsonProperty map[string]jsii.Any + MapProperty map[string]jsii.Any + NumberProperty float64 + StringProperty string + UnionArrayProperty []jsii.Any + UnionMapProperty map[string]jsii.Any + UnionProperty jsii.Any + UnknownArrayProperty []jsii.Any + UnknownMapProperty map[string]jsii.Any + UnknownProperty jsii.Any + OptionalEnumValue StringEnum +} + +func (a *AllTypes) AnyIn() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllTypes", + Method: "AnyIn", + Args: []string{"any",}, + + }) + return nil +} + +func (a *AllTypes) AnyOut() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllTypes", + Method: "AnyOut", + Args: []string{}, + + }) + return nil +} + +func (a *AllTypes) EnumMethod() StringEnum { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllTypes", + Method: "EnumMethod", + Args: []string{"jsii-calc.StringEnum",}, + + }) + return "ENUM_DUMMY" +} + +type AllTypesEnum string + +const ( + AllTypesEnumMyEnumValue AllTypesEnum = "MY_ENUM_VALUE" + AllTypesEnumYourEnumValue AllTypesEnum = "YOUR_ENUM_VALUE" + AllTypesEnumThisIsGreat AllTypesEnum = "THIS_IS_GREAT" +) + +type AllowedMethodNamesIface interface { + GetBar() jsii.Any + GetFoo() string + SetBar() jsii.Any + SetFoo() jsii.Any +} + +type AllowedMethodNames struct { +} + +func (a *AllowedMethodNames) GetBar() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllowedMethodNames", + Method: "GetBar", + Args: []string{"string", "number",}, + + }) + return nil +} + +func (a *AllowedMethodNames) GetFoo() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllowedMethodNames", + Method: "GetFoo", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (a *AllowedMethodNames) SetBar() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllowedMethodNames", + Method: "SetBar", + Args: []string{"string", "number", "boolean",}, + + }) + return nil +} + +func (a *AllowedMethodNames) SetFoo() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AllowedMethodNames", + Method: "SetFoo", + Args: []string{"string", "number",}, + + }) + return nil +} + +type AmbiguousParametersIface interface { + GetProps() StructParameterType + SetProps() + GetScope() Bell + SetScope() +} + +type AmbiguousParameters struct { + Props StructParameterType + Scope Bell +} + +type AnonymousImplementationProviderIface interface { + ProvideAsClass() Implementation + ProvideAsInterface() IAnonymouslyImplementMe +} + +type AnonymousImplementationProvider struct { +} + +func (a *AnonymousImplementationProvider) ProvideAsClass() Implementation { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AnonymousImplementationProvider", + Method: "ProvideAsClass", + Args: []string{}, + + }) + return Implementation{} +} + +func (a *AnonymousImplementationProvider) ProvideAsInterface() IAnonymouslyImplementMe { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AnonymousImplementationProvider", + Method: "ProvideAsInterface", + Args: []string{}, + + }) + return nil +} + +type AsyncVirtualMethodsIface interface { + CallMe() float64 + CallMe2() float64 + CallMeDoublePromise() float64 + DontOverrideMe() float64 + OverrideMe() float64 + OverrideMeToo() float64 +} + +type AsyncVirtualMethods struct { +} + +func (a *AsyncVirtualMethods) CallMe() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "CallMe", + Args: []string{}, + + }) + return 0.0 +} + +func (a *AsyncVirtualMethods) CallMe2() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "CallMe2", + Args: []string{}, + + }) + return 0.0 +} + +func (a *AsyncVirtualMethods) CallMeDoublePromise() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "CallMeDoublePromise", + Args: []string{}, + + }) + return 0.0 +} + +func (a *AsyncVirtualMethods) DontOverrideMe() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "DontOverrideMe", + Args: []string{}, + + }) + return 0.0 +} + +func (a *AsyncVirtualMethods) OverrideMe() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "OverrideMe", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (a *AsyncVirtualMethods) OverrideMeToo() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AsyncVirtualMethods", + Method: "OverrideMeToo", + Args: []string{}, + + }) + return 0.0 +} + +type AugmentableClassIface interface { + MethodOne() jsii.Any + MethodTwo() jsii.Any +} + +type AugmentableClass struct { +} + +func (a *AugmentableClass) MethodOne() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AugmentableClass", + Method: "MethodOne", + Args: []string{}, + + }) + return nil +} + +func (a *AugmentableClass) MethodTwo() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "AugmentableClass", + Method: "MethodTwo", + Args: []string{}, + + }) + return nil +} + +type BaseJsii976Iface interface { +} + +type BaseJsii976 struct { +} + +type BellIface interface { + GetRung() bool + SetRung() + Ring() jsii.Any +} + +type Bell struct { + Rung bool +} + +func (b *Bell) Ring() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Bell", + Method: "Ring", + Args: []string{}, + + }) + return nil +} + +type BinaryOperationIface interface { + GetLhs() jsii.Any + SetLhs() + GetRhs() jsii.Any + SetRhs() + Hello() string +} + +type BinaryOperation struct { + Lhs jsii.Any + Rhs jsii.Any +} + +func (b *BinaryOperation) Hello() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "BinaryOperation", + Method: "Hello", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type BurriedAnonymousObjectIface interface { + Check() bool + GiveItBack() jsii.Any +} + +type BurriedAnonymousObject struct { +} + +func (b *BurriedAnonymousObject) Check() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "BurriedAnonymousObject", + Method: "Check", + Args: []string{}, + + }) + return true +} + +func (b *BurriedAnonymousObject) GiveItBack() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "BurriedAnonymousObject", + Method: "GiveItBack", + Args: []string{"any",}, + + }) + return nil +} + +type CalculatorIface interface { + GetExpression() jsii.Any + SetExpression() + GetOperationsLog() []jsii.Any + SetOperationsLog() + GetOperationsMap() map[string][]jsii.Any + SetOperationsMap() + GetCurr() jsii.Any + SetCurr() + GetMaxValue() float64 + SetMaxValue() + GetUnionProperty() jsii.Any + SetUnionProperty() + Add() jsii.Any + Mul() jsii.Any + Neg() jsii.Any + Pow() jsii.Any + ReadUnionValue() float64 +} + +type Calculator struct { + Expression jsii.Any + OperationsLog []jsii.Any + OperationsMap map[string][]jsii.Any + Curr jsii.Any + MaxValue float64 + UnionProperty jsii.Any +} + +func (c *Calculator) Add() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Calculator", + Method: "Add", + Args: []string{"number",}, + + }) + return nil +} + +func (c *Calculator) Mul() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Calculator", + Method: "Mul", + Args: []string{"number",}, + + }) + return nil +} + +func (c *Calculator) Neg() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Calculator", + Method: "Neg", + Args: []string{}, + + }) + return nil +} + +func (c *Calculator) Pow() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Calculator", + Method: "Pow", + Args: []string{"number",}, + + }) + return nil +} + +func (c *Calculator) ReadUnionValue() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Calculator", + Method: "ReadUnionValue", + Args: []string{}, + + }) + return 0.0 +} + +type CalculatorPropsIface interface { + GetInitialValue() float64 + GetMaximumValue() float64 +} + +type CalculatorProps struct { + InitialValue float64 + MaximumValue float64 +} + + +func (c CalculatorProps) GetInitialValue() float64 { + return c.InitialValue +} + +func (c CalculatorProps) GetMaximumValue() float64 { + return c.MaximumValue +} + + +type ChildStruct982Iface interface { + GetBar() float64 +} + +type ChildStruct982 struct { + Bar float64 +} + + +func (c ChildStruct982) GetBar() float64 { + return c.Bar +} + + +type ClassThatImplementsTheInternalInterfaceIface interface { + GetA() string + SetA() + GetB() string + SetB() + GetC() string + SetC() + GetD() string + SetD() +} + +type ClassThatImplementsTheInternalInterface struct { + A string + B string + C string + D string +} + +type ClassThatImplementsThePrivateInterfaceIface interface { + GetA() string + SetA() + GetB() string + SetB() + GetC() string + SetC() + GetE() string + SetE() +} + +type ClassThatImplementsThePrivateInterface struct { + A string + B string + C string + E string +} + +type ClassWithCollectionsIface interface { + GetStaticArray() []string + SetStaticArray() + GetStaticMap() map[string]string + SetStaticMap() + GetArray() []string + SetArray() + GetMap() map[string]string + SetMap() + CreateAList() []string + CreateAMap() map[string]string +} + +type ClassWithCollections struct { + StaticArray []string + StaticMap map[string]string + Array []string + Map map[string]string +} + +func (c *ClassWithCollections) CreateAList() []string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ClassWithCollections", + Method: "CreateAList", + Args: []string{}, + + }) + return nil +} + +func (c *ClassWithCollections) CreateAMap() map[string]string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ClassWithCollections", + Method: "CreateAMap", + Args: []string{}, + + }) + return nil +} + +type ClassWithDocsIface interface { +} + +type ClassWithDocs struct { +} + +type ClassWithJavaReservedWordsIface interface { + GetInt() string + SetInt() + Import() string +} + +type ClassWithJavaReservedWords struct { + Int string +} + +func (c *ClassWithJavaReservedWords) Import() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ClassWithJavaReservedWords", + Method: "Import", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +type ClassWithMutableObjectLiteralPropertyIface interface { + GetMutableObject() IMutableObjectLiteral + SetMutableObject() +} + +type ClassWithMutableObjectLiteralProperty struct { + MutableObject IMutableObjectLiteral +} + +type ClassWithPrivateConstructorAndAutomaticPropertiesIface interface { + GetReadOnlyString() string + SetReadOnlyString() + GetReadWriteString() string + SetReadWriteString() + Create() ClassWithPrivateConstructorAndAutomaticProperties +} + +type ClassWithPrivateConstructorAndAutomaticProperties struct { + ReadOnlyString string + ReadWriteString string +} + +func (c *ClassWithPrivateConstructorAndAutomaticProperties) Create() ClassWithPrivateConstructorAndAutomaticProperties { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ClassWithPrivateConstructorAndAutomaticProperties", + Method: "Create", + Args: []string{"string", "string",}, + + }) + return ClassWithPrivateConstructorAndAutomaticProperties{} +} + +type ConfusingToJacksonIface interface { + GetUnionProperty() jsii.Any + SetUnionProperty() + MakeInstance() ConfusingToJackson + MakeStructInstance() ConfusingToJacksonStruct +} + +type ConfusingToJackson struct { + UnionProperty jsii.Any +} + +func (c *ConfusingToJackson) MakeInstance() ConfusingToJackson { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConfusingToJackson", + Method: "MakeInstance", + Args: []string{}, + + }) + return ConfusingToJackson{} +} + +func (c *ConfusingToJackson) MakeStructInstance() ConfusingToJacksonStruct { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConfusingToJackson", + Method: "MakeStructInstance", + Args: []string{}, + + }) + return nil +} + +type ConfusingToJacksonStructIface interface { + GetUnionProperty() jsii.Any +} + +type ConfusingToJacksonStruct struct { + UnionProperty jsii.Any +} + + +func (c ConfusingToJacksonStruct) GetUnionProperty() jsii.Any { + return c.UnionProperty +} + + +type ConstructorPassesThisOutIface interface { +} + +type ConstructorPassesThisOut struct { +} + +type ConstructorsIface interface { + HiddenInterface() IPublicInterface + HiddenInterfaces() []IPublicInterface + HiddenSubInterfaces() []IPublicInterface + MakeClass() PublicClass + MakeInterface() IPublicInterface + MakeInterface2() IPublicInterface2 + MakeInterfaces() []IPublicInterface +} + +type Constructors struct { +} + +func (c *Constructors) HiddenInterface() IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "HiddenInterface", + Args: []string{}, + + }) + return nil +} + +func (c *Constructors) HiddenInterfaces() []IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "HiddenInterfaces", + Args: []string{}, + + }) + return nil +} + +func (c *Constructors) HiddenSubInterfaces() []IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "HiddenSubInterfaces", + Args: []string{}, + + }) + return nil +} + +func (c *Constructors) MakeClass() PublicClass { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "MakeClass", + Args: []string{}, + + }) + return PublicClass{} +} + +func (c *Constructors) MakeInterface() IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "MakeInterface", + Args: []string{}, + + }) + return nil +} + +func (c *Constructors) MakeInterface2() IPublicInterface2 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "MakeInterface2", + Args: []string{}, + + }) + return nil +} + +func (c *Constructors) MakeInterfaces() []IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Constructors", + Method: "MakeInterfaces", + Args: []string{}, + + }) + return nil +} + +type ConsumePureInterfaceIface interface { + WorkItBaby() StructB +} + +type ConsumePureInterface struct { +} + +func (c *ConsumePureInterface) WorkItBaby() StructB { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumePureInterface", + Method: "WorkItBaby", + Args: []string{}, + + }) + return nil +} + +type ConsumerCanRingBellIface interface { + StaticImplementedByObjectLiteral() bool + StaticImplementedByPrivateClass() bool + StaticImplementedByPublicClass() bool + StaticWhenTypedAsClass() bool + ImplementedByObjectLiteral() bool + ImplementedByPrivateClass() bool + ImplementedByPublicClass() bool + WhenTypedAsClass() bool +} + +type ConsumerCanRingBell struct { +} + +func (c *ConsumerCanRingBell) StaticImplementedByObjectLiteral() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "StaticImplementedByObjectLiteral", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) StaticImplementedByPrivateClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "StaticImplementedByPrivateClass", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) StaticImplementedByPublicClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "StaticImplementedByPublicClass", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) StaticWhenTypedAsClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "StaticWhenTypedAsClass", + Args: []string{"jsii-calc.IConcreteBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) ImplementedByObjectLiteral() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "ImplementedByObjectLiteral", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) ImplementedByPrivateClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "ImplementedByPrivateClass", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) ImplementedByPublicClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "ImplementedByPublicClass", + Args: []string{"jsii-calc.IBellRinger",}, + + }) + return true +} + +func (c *ConsumerCanRingBell) WhenTypedAsClass() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumerCanRingBell", + Method: "WhenTypedAsClass", + Args: []string{"jsii-calc.IConcreteBellRinger",}, + + }) + return true +} + +type ConsumersOfThisCrazyTypeSystemIface interface { + ConsumeAnotherPublicInterface() string + ConsumeNonInternalInterface() jsii.Any +} + +type ConsumersOfThisCrazyTypeSystem struct { +} + +func (c *ConsumersOfThisCrazyTypeSystem) ConsumeAnotherPublicInterface() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumersOfThisCrazyTypeSystem", + Method: "ConsumeAnotherPublicInterface", + Args: []string{"jsii-calc.IAnotherPublicInterface",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (c *ConsumersOfThisCrazyTypeSystem) ConsumeNonInternalInterface() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ConsumersOfThisCrazyTypeSystem", + Method: "ConsumeNonInternalInterface", + Args: []string{"jsii-calc.INonInternalInterface",}, + + }) + return nil +} + +type DataRendererIface interface { + Render() string + RenderArbitrary() string + RenderMap() string +} + +type DataRenderer struct { +} + +func (d *DataRenderer) Render() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DataRenderer", + Method: "Render", + Args: []string{"@scope/jsii-calc-lib.MyFirstStruct",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (d *DataRenderer) RenderArbitrary() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DataRenderer", + Method: "RenderArbitrary", + Args: []string{"Map any>",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (d *DataRenderer) RenderMap() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DataRenderer", + Method: "RenderMap", + Args: []string{"Map any>",}, + + }) + return "NOOP_RETURN_STRING" +} + +type DefaultedConstructorArgumentIface interface { + GetArg1() float64 + SetArg1() + GetArg3() string + SetArg3() + GetArg2() string + SetArg2() +} + +type DefaultedConstructorArgument struct { + Arg1 float64 + Arg3 string + Arg2 string +} + +type Demonstrate982Iface interface { + TakeThis() ChildStruct982 + TakeThisToo() ParentStruct982 +} + +type Demonstrate982 struct { +} + +func (d *Demonstrate982) TakeThis() ChildStruct982 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Demonstrate982", + Method: "TakeThis", + Args: []string{}, + + }) + return nil +} + +func (d *Demonstrate982) TakeThisToo() ParentStruct982 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Demonstrate982", + Method: "TakeThisToo", + Args: []string{}, + + }) + return nil +} + +type DeprecatedClassIface interface { + GetReadonlyProperty() string + SetReadonlyProperty() + GetMutableProperty() float64 + SetMutableProperty() + Method() jsii.Any +} + +type DeprecatedClass struct { + ReadonlyProperty string + MutableProperty float64 +} + +func (d *DeprecatedClass) Method() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DeprecatedClass", + Method: "Method", + Args: []string{}, + + }) + return nil +} + +type DeprecatedEnum string + +const ( + DeprecatedEnumOptionA DeprecatedEnum = "OPTION_A" + DeprecatedEnumOptionB DeprecatedEnum = "OPTION_B" +) + +type DeprecatedStructIface interface { + GetReadonlyProperty() string +} + +type DeprecatedStruct struct { + ReadonlyProperty string +} + + +func (d DeprecatedStruct) GetReadonlyProperty() string { + return d.ReadonlyProperty +} + + +type DerivedStructIface interface { + GetAnotherRequired() string + GetBool() bool + GetNonPrimitive() DoubleTrouble + GetAnotherOptional() map[string]jsii.Any + GetOptionalAny() jsii.Any + GetOptionalArray() []string +} + +type DerivedStruct struct { + AnotherRequired string + Bool bool + NonPrimitive DoubleTrouble + AnotherOptional map[string]jsii.Any + OptionalAny jsii.Any + OptionalArray []string +} + + +func (d DerivedStruct) GetAnotherRequired() string { + return d.AnotherRequired +} + +func (d DerivedStruct) GetBool() bool { + return d.Bool +} + +func (d DerivedStruct) GetNonPrimitive() DoubleTrouble { + return d.NonPrimitive +} + +func (d DerivedStruct) GetAnotherOptional() map[string]jsii.Any { + return d.AnotherOptional +} + +func (d DerivedStruct) GetOptionalAny() jsii.Any { + return d.OptionalAny +} + +func (d DerivedStruct) GetOptionalArray() []string { + return d.OptionalArray +} + + +type DiamondInheritanceBaseLevelStructIface interface { + GetBaseLevelProperty() string +} + +type DiamondInheritanceBaseLevelStruct struct { + BaseLevelProperty string +} + + +func (d DiamondInheritanceBaseLevelStruct) GetBaseLevelProperty() string { + return d.BaseLevelProperty +} + + +type DiamondInheritanceFirstMidLevelStructIface interface { + GetFirstMidLevelProperty() string +} + +type DiamondInheritanceFirstMidLevelStruct struct { + FirstMidLevelProperty string +} + + +func (d DiamondInheritanceFirstMidLevelStruct) GetFirstMidLevelProperty() string { + return d.FirstMidLevelProperty +} + + +type DiamondInheritanceSecondMidLevelStructIface interface { + GetSecondMidLevelProperty() string +} + +type DiamondInheritanceSecondMidLevelStruct struct { + SecondMidLevelProperty string +} + + +func (d DiamondInheritanceSecondMidLevelStruct) GetSecondMidLevelProperty() string { + return d.SecondMidLevelProperty +} + + +type DiamondInheritanceTopLevelStructIface interface { + GetTopLevelProperty() string +} + +type DiamondInheritanceTopLevelStruct struct { + TopLevelProperty string +} + + +func (d DiamondInheritanceTopLevelStruct) GetTopLevelProperty() string { + return d.TopLevelProperty +} + + +type DisappointingCollectionSourceIface interface { + GetMaybeList() []string + SetMaybeList() + GetMaybeMap() map[string]float64 + SetMaybeMap() +} + +type DisappointingCollectionSource struct { + MaybeList []string + MaybeMap map[string]float64 +} + +type DoNotOverridePrivatesIface interface { + ChangePrivatePropertyValue() jsii.Any + PrivateMethodValue() string + PrivatePropertyValue() string +} + +type DoNotOverridePrivates struct { +} + +func (d *DoNotOverridePrivates) ChangePrivatePropertyValue() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoNotOverridePrivates", + Method: "ChangePrivatePropertyValue", + Args: []string{"string",}, + + }) + return nil +} + +func (d *DoNotOverridePrivates) PrivateMethodValue() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoNotOverridePrivates", + Method: "PrivateMethodValue", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (d *DoNotOverridePrivates) PrivatePropertyValue() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoNotOverridePrivates", + Method: "PrivatePropertyValue", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type DoNotRecognizeAnyAsOptionalIface interface { + Method() jsii.Any +} + +type DoNotRecognizeAnyAsOptional struct { +} + +func (d *DoNotRecognizeAnyAsOptional) Method() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoNotRecognizeAnyAsOptional", + Method: "Method", + Args: []string{"any", "any", "string",}, + + }) + return nil +} + +type DocumentedClassIface interface { + Greet() float64 + Hola() jsii.Any +} + +type DocumentedClass struct { +} + +func (d *DocumentedClass) Greet() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DocumentedClass", + Method: "Greet", + Args: []string{"jsii-calc.Greetee",}, + + }) + return 0.0 +} + +func (d *DocumentedClass) Hola() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DocumentedClass", + Method: "Hola", + Args: []string{}, + + }) + return nil +} + +type DontComplainAboutVariadicAfterOptionalIface interface { + OptionalAndVariadic() string +} + +type DontComplainAboutVariadicAfterOptional struct { +} + +func (d *DontComplainAboutVariadicAfterOptional) OptionalAndVariadic() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DontComplainAboutVariadicAfterOptional", + Method: "OptionalAndVariadic", + Args: []string{"string", "string",}, + + }) + return "NOOP_RETURN_STRING" +} + +type DoubleTroubleIface interface { + Hello() string + Next() float64 +} + +type DoubleTrouble struct { +} + +func (d *DoubleTrouble) Hello() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoubleTrouble", + Method: "Hello", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (d *DoubleTrouble) Next() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "DoubleTrouble", + Method: "Next", + Args: []string{}, + + }) + return 0.0 +} + +type EnumDispenserIface interface { + RandomIntegerLikeEnum() AllTypesEnum + RandomStringLikeEnum() StringEnum +} + +type EnumDispenser struct { +} + +func (e *EnumDispenser) RandomIntegerLikeEnum() AllTypesEnum { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "EnumDispenser", + Method: "RandomIntegerLikeEnum", + Args: []string{}, + + }) + return "ENUM_DUMMY" +} + +func (e *EnumDispenser) RandomStringLikeEnum() StringEnum { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "EnumDispenser", + Method: "RandomStringLikeEnum", + Args: []string{}, + + }) + return "ENUM_DUMMY" +} + +type EraseUndefinedHashValuesIface interface { + DoesKeyExist() bool + Prop1IsNull() map[string]jsii.Any + Prop2IsUndefined() map[string]jsii.Any +} + +type EraseUndefinedHashValues struct { +} + +func (e *EraseUndefinedHashValues) DoesKeyExist() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "EraseUndefinedHashValues", + Method: "DoesKeyExist", + Args: []string{"jsii-calc.EraseUndefinedHashValuesOptions", "string",}, + + }) + return true +} + +func (e *EraseUndefinedHashValues) Prop1IsNull() map[string]jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "EraseUndefinedHashValues", + Method: "Prop1IsNull", + Args: []string{}, + + }) + return nil +} + +func (e *EraseUndefinedHashValues) Prop2IsUndefined() map[string]jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "EraseUndefinedHashValues", + Method: "Prop2IsUndefined", + Args: []string{}, + + }) + return nil +} + +type EraseUndefinedHashValuesOptionsIface interface { + GetOption1() string + GetOption2() string +} + +type EraseUndefinedHashValuesOptions struct { + Option1 string + Option2 string +} + + +func (e EraseUndefinedHashValuesOptions) GetOption1() string { + return e.Option1 +} + +func (e EraseUndefinedHashValuesOptions) GetOption2() string { + return e.Option2 +} + + +type ExperimentalClassIface interface { + GetReadonlyProperty() string + SetReadonlyProperty() + GetMutableProperty() float64 + SetMutableProperty() + Method() jsii.Any +} + +type ExperimentalClass struct { + ReadonlyProperty string + MutableProperty float64 +} + +func (e *ExperimentalClass) Method() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ExperimentalClass", + Method: "Method", + Args: []string{}, + + }) + return nil +} + +type ExperimentalEnum string + +const ( + ExperimentalEnumOptionA ExperimentalEnum = "OPTION_A" + ExperimentalEnumOptionB ExperimentalEnum = "OPTION_B" +) + +type ExperimentalStructIface interface { + GetReadonlyProperty() string +} + +type ExperimentalStruct struct { + ReadonlyProperty string +} + + +func (e ExperimentalStruct) GetReadonlyProperty() string { + return e.ReadonlyProperty +} + + +type ExportedBaseClassIface interface { + GetSuccess() bool + SetSuccess() +} + +type ExportedBaseClass struct { + Success bool +} + +type ExtendsInternalInterfaceIface interface { + GetBoom() bool + GetProp() string +} + +type ExtendsInternalInterface struct { + Boom bool + Prop string +} + + +func (e ExtendsInternalInterface) GetBoom() bool { + return e.Boom +} + +func (e ExtendsInternalInterface) GetProp() string { + return e.Prop +} + + +type ExternalClassIface interface { + GetReadonlyProperty() string + SetReadonlyProperty() + GetMutableProperty() float64 + SetMutableProperty() + Method() jsii.Any +} + +type ExternalClass struct { + ReadonlyProperty string + MutableProperty float64 +} + +func (e *ExternalClass) Method() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ExternalClass", + Method: "Method", + Args: []string{}, + + }) + return nil +} + +type ExternalEnum string + +const ( + ExternalEnumOptionA ExternalEnum = "OPTION_A" + ExternalEnumOptionB ExternalEnum = "OPTION_B" +) + +type ExternalStructIface interface { + GetReadonlyProperty() string +} + +type ExternalStruct struct { + ReadonlyProperty string +} + + +func (e ExternalStruct) GetReadonlyProperty() string { + return e.ReadonlyProperty +} + + +type GiveMeStructsIface interface { + GetStructLiteral() jsii.Any + SetStructLiteral() + DerivedToFirst() jsii.Any + ReadDerivedNonPrimitive() DoubleTrouble + ReadFirstNumber() float64 +} + +type GiveMeStructs struct { + StructLiteral jsii.Any +} + +func (g *GiveMeStructs) DerivedToFirst() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "GiveMeStructs", + Method: "DerivedToFirst", + Args: []string{"jsii-calc.DerivedStruct",}, + + }) + return nil +} + +func (g *GiveMeStructs) ReadDerivedNonPrimitive() DoubleTrouble { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "GiveMeStructs", + Method: "ReadDerivedNonPrimitive", + Args: []string{"jsii-calc.DerivedStruct",}, + + }) + return DoubleTrouble{} +} + +func (g *GiveMeStructs) ReadFirstNumber() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "GiveMeStructs", + Method: "ReadFirstNumber", + Args: []string{"@scope/jsii-calc-lib.MyFirstStruct",}, + + }) + return 0.0 +} + +type GreeteeIface interface { + GetName() string +} + +type Greetee struct { + Name string +} + + +func (g Greetee) GetName() string { + return g.Name +} + + +type GreetingAugmenterIface interface { + BetterGreeting() string +} + +type GreetingAugmenter struct { +} + +func (g *GreetingAugmenter) BetterGreeting() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "GreetingAugmenter", + Method: "BetterGreeting", + Args: []string{"@scope/jsii-calc-lib.IFriendly",}, + + }) + return "NOOP_RETURN_STRING" +} + +type IAnonymousImplementationProvider interface { + ProvideAsClass() Implementation + ProvideAsInterface() IAnonymouslyImplementMe +} + +type IAnonymouslyImplementMe interface { + Verb() string + GetValue() float64 +} + +type IAnotherPublicInterface interface { + GetA() string +} + +type IBell interface { + Ring() +} + +type IBellRinger interface { + YourTurn() +} + +type IConcreteBellRinger interface { + YourTurn() +} + +type IDeprecatedInterface interface { + Method() + GetMutableProperty() float64 +} + +type IExperimentalInterface interface { + Method() + GetMutableProperty() float64 +} + +type IExtendsPrivateInterface interface { + GetMoreThings() []string + GetPrivate() string +} + +type IExternalInterface interface { + Method() + GetMutableProperty() float64 +} + +type IFriendlier interface { + Farewell() string + Goodbye() string +} + +type IFriendlyRandomGenerator interface { +} + +type IInterfaceImplementedByAbstractClass interface { + GetPropFromInterface() string +} + +type IInterfaceThatShouldNotBeADataType interface { + GetOtherValue() string +} + +type IInterfaceWithInternal interface { + Visible() +} + +type IInterfaceWithMethods interface { + DoThings() + GetValue() string +} + +type IInterfaceWithOptionalMethodArguments interface { + Hello() +} + +type IInterfaceWithProperties interface { + GetReadOnlyString() string + GetReadWriteString() string +} + +type IInterfaceWithPropertiesExtension interface { + GetFoo() float64 +} + +type IJSII417Derived interface { + Bar() + Baz() + GetProperty() string +} + +type IJSII417PublicBaseOfBase interface { + Foo() + GetHasRoot() bool +} + +type IJsii487External interface { +} + +type IJsii487External2 interface { +} + +type IJsii496 interface { +} + +type IMutableObjectLiteral interface { + GetValue() string +} + +type INonInternalInterface interface { + GetB() string + GetC() string +} + +type IObjectWithProperty interface { + WasSet() bool + GetProperty() string +} + +type IOptionalMethod interface { + Optional() string +} + +type IPrivatelyImplemented interface { + GetSuccess() bool +} + +type IPublicInterface interface { + Bye() string +} + +type IPublicInterface2 interface { + Ciao() string +} + +type IRandomNumberGenerator interface { + Next() float64 +} + +type IReturnJsii976 interface { + GetFoo() float64 +} + +type IReturnsNumber interface { + ObtainNumber() jsii.Any + GetNumberProp() jsii.Any +} + +type IStableInterface interface { + Method() + GetMutableProperty() float64 +} + +type IStructReturningDelegate interface { + ReturnStruct() StructB +} + +type ImplementInternalInterfaceIface interface { + GetProp() string + SetProp() +} + +type ImplementInternalInterface struct { + Prop string +} + +type ImplementationIface interface { + GetValue() float64 + SetValue() +} + +type Implementation struct { + Value float64 +} + +type ImplementsInterfaceWithInternalIface interface { + Visible() jsii.Any +} + +type ImplementsInterfaceWithInternal struct { +} + +func (i *ImplementsInterfaceWithInternal) Visible() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ImplementsInterfaceWithInternal", + Method: "Visible", + Args: []string{}, + + }) + return nil +} + +type ImplementsInterfaceWithInternalSubclassIface interface { +} + +type ImplementsInterfaceWithInternalSubclass struct { +} + +type ImplementsPrivateInterfaceIface interface { + GetPrivate() string + SetPrivate() +} + +type ImplementsPrivateInterface struct { + Private string +} + +type ImplictBaseOfBaseIface interface { + GetGoo() string +} + +type ImplictBaseOfBase struct { + Goo string +} + + +func (i ImplictBaseOfBase) GetGoo() string { + return i.Goo +} + + +type InbetweenClassIface interface { + Ciao() string +} + +type InbetweenClass struct { +} + +func (i *InbetweenClass) Ciao() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InbetweenClass", + Method: "Ciao", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type InterfaceCollectionsIface interface { + ListOfInterfaces() []IBell + ListOfStructs() []StructA + MapOfInterfaces() map[string]IBell + MapOfStructs() map[string]StructA +} + +type InterfaceCollections struct { +} + +func (i *InterfaceCollections) ListOfInterfaces() []IBell { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InterfaceCollections", + Method: "ListOfInterfaces", + Args: []string{}, + + }) + return nil +} + +func (i *InterfaceCollections) ListOfStructs() []StructA { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InterfaceCollections", + Method: "ListOfStructs", + Args: []string{}, + + }) + return nil +} + +func (i *InterfaceCollections) MapOfInterfaces() map[string]IBell { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InterfaceCollections", + Method: "MapOfInterfaces", + Args: []string{}, + + }) + return nil +} + +func (i *InterfaceCollections) MapOfStructs() map[string]StructA { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InterfaceCollections", + Method: "MapOfStructs", + Args: []string{}, + + }) + return nil +} + +type InterfacesMakerIface interface { + MakeInterfaces() []jsii.Any +} + +type InterfacesMaker struct { +} + +func (i *InterfacesMaker) MakeInterfaces() []jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "InterfacesMaker", + Method: "MakeInterfaces", + Args: []string{"number",}, + + }) + return nil +} + +type IsomorphismIface interface { + Myself() Isomorphism +} + +type Isomorphism struct { +} + +func (i *Isomorphism) Myself() Isomorphism { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Isomorphism", + Method: "Myself", + Args: []string{}, + + }) + return Isomorphism{} +} + +type JSII417DerivedIface interface { + GetProperty() string + Bar() jsii.Any + Baz() jsii.Any +} + +type JSII417Derived struct { + Property string +} + +func (j *JSII417Derived) Bar() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSII417Derived", + Method: "Bar", + Args: []string{}, + + }) + return nil +} + +func (j *JSII417Derived) Baz() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSII417Derived", + Method: "Baz", + Args: []string{}, + + }) + return nil +} + +type JSII417PublicBaseOfBaseIface interface { + GetHasRoot() bool + SetHasRoot() + MakeInstance() Jsii417PublicBaseOfBase + Foo() jsii.Any +} + +type JSII417PublicBaseOfBase struct { + HasRoot bool +} + +func (j *JSII417PublicBaseOfBase) MakeInstance() Jsii417PublicBaseOfBase { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSII417PublicBaseOfBase", + Method: "MakeInstance", + Args: []string{}, + + }) + return Jsii417PublicBaseOfBase{} +} + +func (j *JSII417PublicBaseOfBase) Foo() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSII417PublicBaseOfBase", + Method: "Foo", + Args: []string{}, + + }) + return nil +} + +type JSObjectLiteralForInterfaceIface interface { + GiveMeFriendly() jsii.Any + GiveMeFriendlyGenerator() IFriendlyRandomGenerator +} + +type JSObjectLiteralForInterface struct { +} + +func (j *JSObjectLiteralForInterface) GiveMeFriendly() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSObjectLiteralForInterface", + Method: "GiveMeFriendly", + Args: []string{}, + + }) + return nil +} + +func (j *JSObjectLiteralForInterface) GiveMeFriendlyGenerator() IFriendlyRandomGenerator { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSObjectLiteralForInterface", + Method: "GiveMeFriendlyGenerator", + Args: []string{}, + + }) + return nil +} + +type JSObjectLiteralToNativeIface interface { + ReturnLiteral() JsObjectLiteralToNativeClass +} + +type JSObjectLiteralToNative struct { +} + +func (j *JSObjectLiteralToNative) ReturnLiteral() JsObjectLiteralToNativeClass { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JSObjectLiteralToNative", + Method: "ReturnLiteral", + Args: []string{}, + + }) + return JsObjectLiteralToNativeClass{} +} + +type JSObjectLiteralToNativeClassIface interface { + GetPropA() string + SetPropA() + GetPropB() float64 + SetPropB() +} + +type JSObjectLiteralToNativeClass struct { + PropA string + PropB float64 +} + +type JavaReservedWordsIface interface { + GetWhile() string + SetWhile() + Abstract() jsii.Any + Assert() jsii.Any + Boolean() jsii.Any + Break() jsii.Any + Byte() jsii.Any + Case() jsii.Any + Catch() jsii.Any + Char() jsii.Any + Class() jsii.Any + Const() jsii.Any + Continue() jsii.Any + Default() jsii.Any + Do() jsii.Any + Double() jsii.Any + Else() jsii.Any + Enum() jsii.Any + Extends() jsii.Any + False() jsii.Any + Final() jsii.Any + Finally() jsii.Any + Float() jsii.Any + For() jsii.Any + Goto() jsii.Any + If() jsii.Any + Implements() jsii.Any + Import() jsii.Any + Instanceof() jsii.Any + Int() jsii.Any + Interface() jsii.Any + Long() jsii.Any + Native() jsii.Any + New() jsii.Any + Null() jsii.Any + Package() jsii.Any + Private() jsii.Any + Protected() jsii.Any + Public() jsii.Any + Return() jsii.Any + Short() jsii.Any + Static() jsii.Any + Strictfp() jsii.Any + Super() jsii.Any + Switch() jsii.Any + Synchronized() jsii.Any + This() jsii.Any + Throw() jsii.Any + Throws() jsii.Any + Transient() jsii.Any + True() jsii.Any + Try() jsii.Any + Void() jsii.Any + Volatile() jsii.Any +} + +type JavaReservedWords struct { + While string +} + +func (j *JavaReservedWords) Abstract() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Abstract", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Assert() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Assert", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Boolean() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Boolean", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Break() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Break", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Byte() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Byte", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Case() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Case", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Catch() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Catch", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Char() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Char", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Class() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Class", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Const() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Const", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Continue() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Continue", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Default() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Default", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Do() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Do", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Double() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Double", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Else() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Else", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Enum() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Enum", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Extends() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Extends", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) False() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "False", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Final() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Final", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Finally() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Finally", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Float() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Float", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) For() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "For", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Goto() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Goto", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) If() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "If", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Implements() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Implements", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Import() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Import", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Instanceof() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Instanceof", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Int() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Int", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Interface() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Interface", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Long() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Long", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Native() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Native", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) New() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "New", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Null() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Null", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Package() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Package", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Private() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Private", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Protected() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Protected", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Public() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Public", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Return() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Return", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Short() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Short", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Static() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Static", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Strictfp() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Strictfp", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Super() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Super", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Switch() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Switch", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Synchronized() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Synchronized", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) This() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "This", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Throw() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Throw", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Throws() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Throws", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Transient() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Transient", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) True() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "True", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Try() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Try", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Void() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Void", + Args: []string{}, + + }) + return nil +} + +func (j *JavaReservedWords) Volatile() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JavaReservedWords", + Method: "Volatile", + Args: []string{}, + + }) + return nil +} + +type Jsii487DerivedIface interface { +} + +type Jsii487Derived struct { +} + +type Jsii496DerivedIface interface { +} + +type Jsii496Derived struct { +} + +type JsiiAgentIface interface { + GetJsiiAgent() string + SetJsiiAgent() +} + +type JsiiAgent struct { + JsiiAgent string +} + +type JsonFormatterIface interface { + AnyArray() jsii.Any + AnyBooleanFalse() jsii.Any + AnyBooleanTrue() jsii.Any + AnyDate() jsii.Any + AnyEmptyString() jsii.Any + AnyFunction() jsii.Any + AnyHash() jsii.Any + AnyNull() jsii.Any + AnyNumber() jsii.Any + AnyRef() jsii.Any + AnyString() jsii.Any + AnyUndefined() jsii.Any + AnyZero() jsii.Any + Stringify() string +} + +type JsonFormatter struct { +} + +func (j *JsonFormatter) AnyArray() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyArray", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyBooleanFalse() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyBooleanFalse", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyBooleanTrue() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyBooleanTrue", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyDate() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyDate", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyEmptyString() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyEmptyString", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyFunction() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyFunction", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyHash() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyHash", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyNull() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyNull", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyNumber() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyNumber", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyRef() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyRef", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyString() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyString", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyUndefined() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyUndefined", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) AnyZero() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "AnyZero", + Args: []string{}, + + }) + return nil +} + +func (j *JsonFormatter) Stringify() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "JsonFormatter", + Method: "Stringify", + Args: []string{"any",}, + + }) + return "NOOP_RETURN_STRING" +} + +type LoadBalancedFargateServicePropsIface interface { + GetContainerPort() float64 + GetCpu() string + GetMemoryMiB() string + GetPublicLoadBalancer() bool + GetPublicTasks() bool +} + +type LoadBalancedFargateServiceProps struct { + ContainerPort float64 + Cpu string + MemoryMiB string + PublicLoadBalancer bool + PublicTasks bool +} + + +func (l LoadBalancedFargateServiceProps) GetContainerPort() float64 { + return l.ContainerPort +} + +func (l LoadBalancedFargateServiceProps) GetCpu() string { + return l.Cpu +} + +func (l LoadBalancedFargateServiceProps) GetMemoryMiB() string { + return l.MemoryMiB +} + +func (l LoadBalancedFargateServiceProps) GetPublicLoadBalancer() bool { + return l.PublicLoadBalancer +} + +func (l LoadBalancedFargateServiceProps) GetPublicTasks() bool { + return l.PublicTasks +} + + +type MethodNamedPropertyIface interface { + GetElite() float64 + SetElite() + Property() string +} + +type MethodNamedProperty struct { + Elite float64 +} + +func (m *MethodNamedProperty) Property() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "MethodNamedProperty", + Method: "Property", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type MultiplyIface interface { + GetValue() float64 + SetValue() + Farewell() string + Goodbye() string + Next() float64 + ToString() string +} + +type Multiply struct { + Value float64 +} + +func (m *Multiply) Farewell() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Multiply", + Method: "Farewell", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (m *Multiply) Goodbye() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Multiply", + Method: "Goodbye", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (m *Multiply) Next() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Multiply", + Method: "Next", + Args: []string{}, + + }) + return 0.0 +} + +func (m *Multiply) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Multiply", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type NegateIface interface { + GetValue() float64 + SetValue() + Farewell() string + Goodbye() string + Hello() string + ToString() string +} + +type Negate struct { + Value float64 +} + +func (n *Negate) Farewell() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Negate", + Method: "Farewell", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (n *Negate) Goodbye() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Negate", + Method: "Goodbye", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (n *Negate) Hello() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Negate", + Method: "Hello", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (n *Negate) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Negate", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type NestedClassInstanceIface interface { + MakeInstance() jsii.Any +} + +type NestedClassInstance struct { +} + +func (n *NestedClassInstance) MakeInstance() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NestedClassInstance", + Method: "MakeInstance", + Args: []string{}, + + }) + return nil +} + +type NestedStructIface interface { + GetNumberProp() float64 +} + +type NestedStruct struct { + NumberProp float64 +} + + +func (n NestedStruct) GetNumberProp() float64 { + return n.NumberProp +} + + +type NodeStandardLibraryIface interface { + GetOsPlatform() string + SetOsPlatform() + CryptoSha256() string + FsReadFile() string + FsReadFileSync() string +} + +type NodeStandardLibrary struct { + OsPlatform string +} + +func (n *NodeStandardLibrary) CryptoSha256() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NodeStandardLibrary", + Method: "CryptoSha256", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (n *NodeStandardLibrary) FsReadFile() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NodeStandardLibrary", + Method: "FsReadFile", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (n *NodeStandardLibrary) FsReadFileSync() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NodeStandardLibrary", + Method: "FsReadFileSync", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type NullShouldBeTreatedAsUndefinedIface interface { + GetChangeMeToUndefined() string + SetChangeMeToUndefined() + GiveMeUndefined() jsii.Any + GiveMeUndefinedInsideAnObject() jsii.Any + VerifyPropertyIsUndefined() jsii.Any +} + +type NullShouldBeTreatedAsUndefined struct { + ChangeMeToUndefined string +} + +func (n *NullShouldBeTreatedAsUndefined) GiveMeUndefined() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NullShouldBeTreatedAsUndefined", + Method: "GiveMeUndefined", + Args: []string{"any",}, + + }) + return nil +} + +func (n *NullShouldBeTreatedAsUndefined) GiveMeUndefinedInsideAnObject() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NullShouldBeTreatedAsUndefined", + Method: "GiveMeUndefinedInsideAnObject", + Args: []string{"jsii-calc.NullShouldBeTreatedAsUndefinedData",}, + + }) + return nil +} + +func (n *NullShouldBeTreatedAsUndefined) VerifyPropertyIsUndefined() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NullShouldBeTreatedAsUndefined", + Method: "VerifyPropertyIsUndefined", + Args: []string{}, + + }) + return nil +} + +type NullShouldBeTreatedAsUndefinedDataIface interface { + GetArrayWithThreeElementsAndUndefinedAsSecondArgument() []jsii.Any + GetThisShouldBeUndefined() jsii.Any +} + +type NullShouldBeTreatedAsUndefinedData struct { + ArrayWithThreeElementsAndUndefinedAsSecondArgument []jsii.Any + ThisShouldBeUndefined jsii.Any +} + + +func (n NullShouldBeTreatedAsUndefinedData) GetArrayWithThreeElementsAndUndefinedAsSecondArgument() []jsii.Any { + return n.ArrayWithThreeElementsAndUndefinedAsSecondArgument +} + +func (n NullShouldBeTreatedAsUndefinedData) GetThisShouldBeUndefined() jsii.Any { + return n.ThisShouldBeUndefined +} + + +type NumberGeneratorIface interface { + GetGenerator() IRandomNumberGenerator + SetGenerator() + IsSameGenerator() bool + NextTimes100() float64 +} + +type NumberGenerator struct { + Generator IRandomNumberGenerator +} + +func (n *NumberGenerator) IsSameGenerator() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NumberGenerator", + Method: "IsSameGenerator", + Args: []string{"jsii-calc.IRandomNumberGenerator",}, + + }) + return true +} + +func (n *NumberGenerator) NextTimes100() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "NumberGenerator", + Method: "NextTimes100", + Args: []string{}, + + }) + return 0.0 +} + +type ObjectRefsInCollectionsIface interface { + SumFromArray() float64 + SumFromMap() float64 +} + +type ObjectRefsInCollections struct { +} + +func (o *ObjectRefsInCollections) SumFromArray() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ObjectRefsInCollections", + Method: "SumFromArray", + Args: []string{"Array<@scope/jsii-calc-lib.Value>",}, + + }) + return 0.0 +} + +func (o *ObjectRefsInCollections) SumFromMap() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ObjectRefsInCollections", + Method: "SumFromMap", + Args: []string{"Map @scope/jsii-calc-lib.Value>",}, + + }) + return 0.0 +} + +type ObjectWithPropertyProviderIface interface { + Provide() IObjectWithProperty +} + +type ObjectWithPropertyProvider struct { +} + +func (o *ObjectWithPropertyProvider) Provide() IObjectWithProperty { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ObjectWithPropertyProvider", + Method: "Provide", + Args: []string{}, + + }) + return nil +} + +type OldIface interface { + DoAThing() jsii.Any +} + +type Old struct { +} + +func (o *Old) DoAThing() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Old", + Method: "DoAThing", + Args: []string{}, + + }) + return nil +} + +type OptionalArgumentInvokerIface interface { + InvokeWithOptional() jsii.Any + InvokeWithoutOptional() jsii.Any +} + +type OptionalArgumentInvoker struct { +} + +func (o *OptionalArgumentInvoker) InvokeWithOptional() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OptionalArgumentInvoker", + Method: "InvokeWithOptional", + Args: []string{}, + + }) + return nil +} + +func (o *OptionalArgumentInvoker) InvokeWithoutOptional() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OptionalArgumentInvoker", + Method: "InvokeWithoutOptional", + Args: []string{}, + + }) + return nil +} + +type OptionalConstructorArgumentIface interface { + GetArg1() float64 + SetArg1() + GetArg2() string + SetArg2() + GetArg3() string + SetArg3() +} + +type OptionalConstructorArgument struct { + Arg1 float64 + Arg2 string + Arg3 string +} + +type OptionalStructIface interface { + GetField() string +} + +type OptionalStruct struct { + Field string +} + + +func (o OptionalStruct) GetField() string { + return o.Field +} + + +type OptionalStructConsumerIface interface { + GetParameterWasUndefined() bool + SetParameterWasUndefined() + GetFieldValue() string + SetFieldValue() +} + +type OptionalStructConsumer struct { + ParameterWasUndefined bool + FieldValue string +} + +type OverridableProtectedMemberIface interface { + GetOverrideReadOnly() string + GetOverrideReadWrite() string + OverrideMe() string + SwitchModes() jsii.Any + ValueFromProtected() string +} + +type OverridableProtectedMember struct { + OverrideReadOnly string + OverrideReadWrite string +} + +func (o *OverridableProtectedMember) OverrideMe() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OverridableProtectedMember", + Method: "OverrideMe", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (o *OverridableProtectedMember) SwitchModes() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OverridableProtectedMember", + Method: "SwitchModes", + Args: []string{}, + + }) + return nil +} + +func (o *OverridableProtectedMember) ValueFromProtected() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OverridableProtectedMember", + Method: "ValueFromProtected", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type OverrideReturnsObjectIface interface { + Test() float64 +} + +type OverrideReturnsObject struct { +} + +func (o *OverrideReturnsObject) Test() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "OverrideReturnsObject", + Method: "Test", + Args: []string{"jsii-calc.IReturnsNumber",}, + + }) + return 0.0 +} + +type ParentStruct982Iface interface { + GetFoo() string +} + +type ParentStruct982 struct { + Foo string +} + + +func (p ParentStruct982) GetFoo() string { + return p.Foo +} + + +type PartiallyInitializedThisConsumerIface interface { + ConsumePartiallyInitializedThis() string +} + +type PartiallyInitializedThisConsumer struct { +} + +func (p *PartiallyInitializedThisConsumer) ConsumePartiallyInitializedThis() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PartiallyInitializedThisConsumer", + Method: "ConsumePartiallyInitializedThis", + Args: []string{"jsii-calc.ConstructorPassesThisOut", "date", "jsii-calc.AllTypesEnum",}, + + }) + return "NOOP_RETURN_STRING" +} + +type PolymorphismIface interface { + SayHello() string +} + +type Polymorphism struct { +} + +func (p *Polymorphism) SayHello() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Polymorphism", + Method: "SayHello", + Args: []string{"@scope/jsii-calc-lib.IFriendly",}, + + }) + return "NOOP_RETURN_STRING" +} + +type PowerIface interface { + GetBase() jsii.Any + SetBase() + GetExpression() jsii.Any + SetExpression() + GetPow() jsii.Any + SetPow() +} + +type Power struct { + Base jsii.Any + Expression jsii.Any + Pow jsii.Any +} + +type PropertyNamedPropertyIface interface { + GetProperty() string + SetProperty() + GetYetAnoterOne() bool + SetYetAnoterOne() +} + +type PropertyNamedProperty struct { + Property string + YetAnoterOne bool +} + +type PublicClassIface interface { + Hello() jsii.Any +} + +type PublicClass struct { +} + +func (p *PublicClass) Hello() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PublicClass", + Method: "Hello", + Args: []string{}, + + }) + return nil +} + +type PythonReservedWordsIface interface { + And() jsii.Any + As() jsii.Any + Assert() jsii.Any + Async() jsii.Any + Await() jsii.Any + Break() jsii.Any + Class() jsii.Any + Continue() jsii.Any + Def() jsii.Any + Del() jsii.Any + Elif() jsii.Any + Else() jsii.Any + Except() jsii.Any + Finally() jsii.Any + For() jsii.Any + From() jsii.Any + Global() jsii.Any + If() jsii.Any + Import() jsii.Any + In() jsii.Any + Is() jsii.Any + Lambda() jsii.Any + Nonlocal() jsii.Any + Not() jsii.Any + Or() jsii.Any + Pass() jsii.Any + Raise() jsii.Any + Return() jsii.Any + Try() jsii.Any + While() jsii.Any + With() jsii.Any + Yield() jsii.Any +} + +type PythonReservedWords struct { +} + +func (p *PythonReservedWords) And() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "And", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) As() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "As", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Assert() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Assert", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Async() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Async", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Await() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Await", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Break() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Break", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Class() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Class", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Continue() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Continue", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Def() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Def", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Del() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Del", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Elif() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Elif", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Else() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Else", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Except() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Except", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Finally() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Finally", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) For() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "For", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) From() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "From", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Global() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Global", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) If() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "If", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Import() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Import", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) In() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "In", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Is() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Is", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Lambda() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Lambda", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Nonlocal() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Nonlocal", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Not() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Not", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Or() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Or", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Pass() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Pass", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Raise() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Raise", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Return() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Return", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Try() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Try", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) While() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "While", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) With() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "With", + Args: []string{}, + + }) + return nil +} + +func (p *PythonReservedWords) Yield() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "PythonReservedWords", + Method: "Yield", + Args: []string{}, + + }) + return nil +} + +type ReferenceEnumFromScopedPackageIface interface { + GetFoo() jsii.Any + SetFoo() + LoadFoo() jsii.Any + SaveFoo() jsii.Any +} + +type ReferenceEnumFromScopedPackage struct { + Foo jsii.Any +} + +func (r *ReferenceEnumFromScopedPackage) LoadFoo() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ReferenceEnumFromScopedPackage", + Method: "LoadFoo", + Args: []string{}, + + }) + return nil +} + +func (r *ReferenceEnumFromScopedPackage) SaveFoo() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ReferenceEnumFromScopedPackage", + Method: "SaveFoo", + Args: []string{"@scope/jsii-calc-lib.EnumFromScopedModule",}, + + }) + return nil +} + +type ReturnsPrivateImplementationOfInterfaceIface interface { + GetPrivateImplementation() IPrivatelyImplemented + SetPrivateImplementation() +} + +type ReturnsPrivateImplementationOfInterface struct { + PrivateImplementation IPrivatelyImplemented +} + +type RootStructIface interface { + GetStringProp() string + GetNestedStruct() NestedStruct +} + +type RootStruct struct { + StringProp string + NestedStruct NestedStruct +} + + +func (r RootStruct) GetStringProp() string { + return r.StringProp +} + +func (r RootStruct) GetNestedStruct() NestedStruct { + return r.NestedStruct +} + + +type RootStructValidatorIface interface { + Validate() jsii.Any +} + +type RootStructValidator struct { +} + +func (r *RootStructValidator) Validate() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "RootStructValidator", + Method: "Validate", + Args: []string{"jsii-calc.RootStruct",}, + + }) + return nil +} + +type RuntimeTypeCheckingIface interface { + MethodWithDefaultedArguments() jsii.Any + MethodWithOptionalAnyArgument() jsii.Any + MethodWithOptionalArguments() jsii.Any +} + +type RuntimeTypeChecking struct { +} + +func (r *RuntimeTypeChecking) MethodWithDefaultedArguments() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "RuntimeTypeChecking", + Method: "MethodWithDefaultedArguments", + Args: []string{"number", "string", "date",}, + + }) + return nil +} + +func (r *RuntimeTypeChecking) MethodWithOptionalAnyArgument() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "RuntimeTypeChecking", + Method: "MethodWithOptionalAnyArgument", + Args: []string{"any",}, + + }) + return nil +} + +func (r *RuntimeTypeChecking) MethodWithOptionalArguments() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "RuntimeTypeChecking", + Method: "MethodWithOptionalArguments", + Args: []string{"number", "string", "date",}, + + }) + return nil +} + +type SecondLevelStructIface interface { + GetDeeperRequiredProp() string + GetDeeperOptionalProp() string +} + +type SecondLevelStruct struct { + DeeperRequiredProp string + DeeperOptionalProp string +} + + +func (s SecondLevelStruct) GetDeeperRequiredProp() string { + return s.DeeperRequiredProp +} + +func (s SecondLevelStruct) GetDeeperOptionalProp() string { + return s.DeeperOptionalProp +} + + +type SingleInstanceTwoTypesIface interface { + Interface1() InbetweenClass + Interface2() IPublicInterface +} + +type SingleInstanceTwoTypes struct { +} + +func (s *SingleInstanceTwoTypes) Interface1() InbetweenClass { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SingleInstanceTwoTypes", + Method: "Interface1", + Args: []string{}, + + }) + return InbetweenClass{} +} + +func (s *SingleInstanceTwoTypes) Interface2() IPublicInterface { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SingleInstanceTwoTypes", + Method: "Interface2", + Args: []string{}, + + }) + return nil +} + +type SingletonIntIface interface { + IsSingletonInt() bool +} + +type SingletonInt struct { +} + +func (s *SingletonInt) IsSingletonInt() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SingletonInt", + Method: "IsSingletonInt", + Args: []string{"number",}, + + }) + return true +} + +type SingletonIntEnum string + +const ( + SingletonIntEnumSingletonInt SingletonIntEnum = "SINGLETON_INT" +) + +type SingletonStringIface interface { + IsSingletonString() bool +} + +type SingletonString struct { +} + +func (s *SingletonString) IsSingletonString() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SingletonString", + Method: "IsSingletonString", + Args: []string{"string",}, + + }) + return true +} + +type SingletonStringEnum string + +const ( + SingletonStringEnumSingletonString SingletonStringEnum = "SINGLETON_STRING" +) + +type SmellyStructIface interface { + GetProperty() string + GetYetAnoterOne() bool +} + +type SmellyStruct struct { + Property string + YetAnoterOne bool +} + + +func (s SmellyStruct) GetProperty() string { + return s.Property +} + +func (s SmellyStruct) GetYetAnoterOne() bool { + return s.YetAnoterOne +} + + +type SomeTypeJsii976Iface interface { + ReturnAnonymous() jsii.Any + ReturnReturn() IReturnJsii976 +} + +type SomeTypeJsii976 struct { +} + +func (s *SomeTypeJsii976) ReturnAnonymous() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SomeTypeJsii976", + Method: "ReturnAnonymous", + Args: []string{}, + + }) + return nil +} + +func (s *SomeTypeJsii976) ReturnReturn() IReturnJsii976 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SomeTypeJsii976", + Method: "ReturnReturn", + Args: []string{}, + + }) + return nil +} + +type StableClassIface interface { + GetReadonlyProperty() string + SetReadonlyProperty() + GetMutableProperty() float64 + SetMutableProperty() + Method() jsii.Any +} + +type StableClass struct { + ReadonlyProperty string + MutableProperty float64 +} + +func (s *StableClass) Method() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StableClass", + Method: "Method", + Args: []string{}, + + }) + return nil +} + +type StableEnum string + +const ( + StableEnumOptionA StableEnum = "OPTION_A" + StableEnumOptionB StableEnum = "OPTION_B" +) + +type StableStructIface interface { + GetReadonlyProperty() string +} + +type StableStruct struct { + ReadonlyProperty string +} + + +func (s StableStruct) GetReadonlyProperty() string { + return s.ReadonlyProperty +} + + +type StaticContextIface interface { + GetStaticVariable() bool + SetStaticVariable() + CanAccessStaticContext() bool +} + +type StaticContext struct { + StaticVariable bool +} + +func (s *StaticContext) CanAccessStaticContext() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StaticContext", + Method: "CanAccessStaticContext", + Args: []string{}, + + }) + return true +} + +type StaticsIface interface { + GetBar() float64 + SetBar() + GetConstObj() DoubleTrouble + SetConstObj() + GetFoo() string + SetFoo() + GetZooBar() map[string]string + SetZooBar() + GetInstance() Statics + SetInstance() + GetNonConstStatic() float64 + SetNonConstStatic() + GetValue() string + SetValue() + StaticMethod() string + JustMethod() string +} + +type Statics struct { + Bar float64 + ConstObj DoubleTrouble + Foo string + ZooBar map[string]string + Instance *Statics + NonConstStatic float64 + Value string +} + +func (s *Statics) StaticMethod() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Statics", + Method: "StaticMethod", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (s *Statics) JustMethod() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Statics", + Method: "JustMethod", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type StringEnum string + +const ( + StringEnumA StringEnum = "A" + StringEnumB StringEnum = "B" + StringEnumC StringEnum = "C" +) + +type StripInternalIface interface { + GetYouSeeMe() string + SetYouSeeMe() +} + +type StripInternal struct { + YouSeeMe string +} + +type StructAIface interface { + GetRequiredString() string + GetOptionalNumber() float64 + GetOptionalString() string +} + +type StructA struct { + RequiredString string + OptionalNumber float64 + OptionalString string +} + + +func (s StructA) GetRequiredString() string { + return s.RequiredString +} + +func (s StructA) GetOptionalNumber() float64 { + return s.OptionalNumber +} + +func (s StructA) GetOptionalString() string { + return s.OptionalString +} + + +type StructBIface interface { + GetRequiredString() string + GetOptionalBoolean() bool + GetOptionalStructA() StructA +} + +type StructB struct { + RequiredString string + OptionalBoolean bool + OptionalStructA StructA +} + + +func (s StructB) GetRequiredString() string { + return s.RequiredString +} + +func (s StructB) GetOptionalBoolean() bool { + return s.OptionalBoolean +} + +func (s StructB) GetOptionalStructA() StructA { + return s.OptionalStructA +} + + +type StructParameterTypeIface interface { + GetScope() string + GetProps() bool +} + +type StructParameterType struct { + Scope string + Props bool +} + + +func (s StructParameterType) GetScope() string { + return s.Scope +} + +func (s StructParameterType) GetProps() bool { + return s.Props +} + + +type StructPassingIface interface { + HowManyVarArgsDidIPass() float64 + RoundTrip() TopLevelStruct +} + +type StructPassing struct { +} + +func (s *StructPassing) HowManyVarArgsDidIPass() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StructPassing", + Method: "HowManyVarArgsDidIPass", + Args: []string{"number", "jsii-calc.TopLevelStruct",}, + + }) + return 0.0 +} + +func (s *StructPassing) RoundTrip() TopLevelStruct { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StructPassing", + Method: "RoundTrip", + Args: []string{"number", "jsii-calc.TopLevelStruct",}, + + }) + return nil +} + +type StructUnionConsumerIface interface { + IsStructA() bool + IsStructB() bool +} + +type StructUnionConsumer struct { +} + +func (s *StructUnionConsumer) IsStructA() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StructUnionConsumer", + Method: "IsStructA", + Args: []string{"jsii-calc.StructA | jsii-calc.StructB",}, + + }) + return true +} + +func (s *StructUnionConsumer) IsStructB() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "StructUnionConsumer", + Method: "IsStructB", + Args: []string{"jsii-calc.StructA | jsii-calc.StructB",}, + + }) + return true +} + +type StructWithJavaReservedWordsIface interface { + GetDefault() string + GetAssert() string + GetResult() string + GetThat() string +} + +type StructWithJavaReservedWords struct { + Default string + Assert string + Result string + That string +} + + +func (s StructWithJavaReservedWords) GetDefault() string { + return s.Default +} + +func (s StructWithJavaReservedWords) GetAssert() string { + return s.Assert +} + +func (s StructWithJavaReservedWords) GetResult() string { + return s.Result +} + +func (s StructWithJavaReservedWords) GetThat() string { + return s.That +} + + +type SumIface interface { + GetExpression() jsii.Any + SetExpression() + GetParts() []jsii.Any + SetParts() +} + +type Sum struct { + Expression jsii.Any + Parts []jsii.Any +} + +type SupportsNiceJavaBuilderIface interface { + GetId() float64 + SetId() + GetRest() []string + SetRest() +} + +type SupportsNiceJavaBuilder struct { + Id float64 + Rest []string +} + +type SupportsNiceJavaBuilderPropsIface interface { + GetBar() float64 + GetId() string +} + +type SupportsNiceJavaBuilderProps struct { + Bar float64 + Id string +} + + +func (s SupportsNiceJavaBuilderProps) GetBar() float64 { + return s.Bar +} + +func (s SupportsNiceJavaBuilderProps) GetId() string { + return s.Id +} + + +type SupportsNiceJavaBuilderWithRequiredPropsIface interface { + GetBar() float64 + SetBar() + GetId() float64 + SetId() + GetPropId() string + SetPropId() +} + +type SupportsNiceJavaBuilderWithRequiredProps struct { + Bar float64 + Id float64 + PropId string +} + +type SyncVirtualMethodsIface interface { + GetReadonlyProperty() string + SetReadonlyProperty() + GetA() float64 + SetA() + GetCallerIsProperty() float64 + SetCallerIsProperty() + GetOtherProperty() string + SetOtherProperty() + GetTheProperty() string + SetTheProperty() + GetValueOfOtherProperty() string + SetValueOfOtherProperty() + CallerIsAsync() float64 + CallerIsMethod() float64 + ModifyOtherProperty() jsii.Any + ModifyValueOfTheProperty() jsii.Any + ReadA() float64 + RetrieveOtherProperty() string + RetrieveReadOnlyProperty() string + RetrieveValueOfTheProperty() string + VirtualMethod() float64 + WriteA() jsii.Any +} + +type SyncVirtualMethods struct { + ReadonlyProperty string + A float64 + CallerIsProperty float64 + OtherProperty string + TheProperty string + ValueOfOtherProperty string +} + +func (s *SyncVirtualMethods) CallerIsAsync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "CallerIsAsync", + Args: []string{}, + + }) + return 0.0 +} + +func (s *SyncVirtualMethods) CallerIsMethod() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "CallerIsMethod", + Args: []string{}, + + }) + return 0.0 +} + +func (s *SyncVirtualMethods) ModifyOtherProperty() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "ModifyOtherProperty", + Args: []string{"string",}, + + }) + return nil +} + +func (s *SyncVirtualMethods) ModifyValueOfTheProperty() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "ModifyValueOfTheProperty", + Args: []string{"string",}, + + }) + return nil +} + +func (s *SyncVirtualMethods) ReadA() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "ReadA", + Args: []string{}, + + }) + return 0.0 +} + +func (s *SyncVirtualMethods) RetrieveOtherProperty() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "RetrieveOtherProperty", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (s *SyncVirtualMethods) RetrieveReadOnlyProperty() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "RetrieveReadOnlyProperty", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (s *SyncVirtualMethods) RetrieveValueOfTheProperty() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "RetrieveValueOfTheProperty", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (s *SyncVirtualMethods) VirtualMethod() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "VirtualMethod", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (s *SyncVirtualMethods) WriteA() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "SyncVirtualMethods", + Method: "WriteA", + Args: []string{"number",}, + + }) + return nil +} + +type ThrowerIface interface { + ThrowError() jsii.Any +} + +type Thrower struct { +} + +func (t *Thrower) ThrowError() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Thrower", + Method: "ThrowError", + Args: []string{}, + + }) + return nil +} + +type TopLevelStructIface interface { + GetRequired() string + GetSecondLevel() jsii.Any + GetOptional() string +} + +type TopLevelStruct struct { + Required string + SecondLevel jsii.Any + Optional string +} + + +func (t TopLevelStruct) GetRequired() string { + return t.Required +} + +func (t TopLevelStruct) GetSecondLevel() jsii.Any { + return t.SecondLevel +} + +func (t TopLevelStruct) GetOptional() string { + return t.Optional +} + + +type UmaskCheckIface interface { + Mode() float64 +} + +type UmaskCheck struct { +} + +func (u *UmaskCheck) Mode() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UmaskCheck", + Method: "Mode", + Args: []string{}, + + }) + return 0.0 +} + +type UnaryOperationIface interface { + GetOperand() jsii.Any + SetOperand() +} + +type UnaryOperation struct { + Operand jsii.Any +} + +type UnionPropertiesIface interface { + GetBar() jsii.Any + GetFoo() jsii.Any +} + +type UnionProperties struct { + Bar jsii.Any + Foo jsii.Any +} + + +func (u UnionProperties) GetBar() jsii.Any { + return u.Bar +} + +func (u UnionProperties) GetFoo() jsii.Any { + return u.Foo +} + + +type UpcasingReflectableIface interface { + GetReflector() jsii.Any + SetReflector() + GetEntries() []jsii.Any + SetEntries() +} + +type UpcasingReflectable struct { + Reflector jsii.Any + Entries []jsii.Any +} + +type UseBundledDependencyIface interface { + Value() jsii.Any +} + +type UseBundledDependency struct { +} + +func (u *UseBundledDependency) Value() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UseBundledDependency", + Method: "Value", + Args: []string{}, + + }) + return nil +} + +type UseCalcBaseIface interface { + Hello() jsii.Any +} + +type UseCalcBase struct { +} + +func (u *UseCalcBase) Hello() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UseCalcBase", + Method: "Hello", + Args: []string{}, + + }) + return nil +} + +type UsesInterfaceWithPropertiesIface interface { + GetObj() IInterfaceWithProperties + SetObj() + JustRead() string + ReadStringAndNumber() string + WriteAndRead() string +} + +type UsesInterfaceWithProperties struct { + Obj IInterfaceWithProperties +} + +func (u *UsesInterfaceWithProperties) JustRead() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UsesInterfaceWithProperties", + Method: "JustRead", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +func (u *UsesInterfaceWithProperties) ReadStringAndNumber() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UsesInterfaceWithProperties", + Method: "ReadStringAndNumber", + Args: []string{"jsii-calc.IInterfaceWithPropertiesExtension",}, + + }) + return "NOOP_RETURN_STRING" +} + +func (u *UsesInterfaceWithProperties) WriteAndRead() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "UsesInterfaceWithProperties", + Method: "WriteAndRead", + Args: []string{"string",}, + + }) + return "NOOP_RETURN_STRING" +} + +type VariadicInvokerIface interface { + AsArray() []float64 +} + +type VariadicInvoker struct { +} + +func (v *VariadicInvoker) AsArray() []float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VariadicInvoker", + Method: "AsArray", + Args: []string{"number",}, + + }) + return nil +} + +type VariadicMethodIface interface { + AsArray() []float64 +} + +type VariadicMethod struct { +} + +func (v *VariadicMethod) AsArray() []float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VariadicMethod", + Method: "AsArray", + Args: []string{"number", "number",}, + + }) + return nil +} + +type VirtualMethodPlaygroundIface interface { + OverrideMeAsync() float64 + OverrideMeSync() float64 + ParallelSumAsync() float64 + SerialSumAsync() float64 + SumSync() float64 +} + +type VirtualMethodPlayground struct { +} + +func (v *VirtualMethodPlayground) OverrideMeAsync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VirtualMethodPlayground", + Method: "OverrideMeAsync", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (v *VirtualMethodPlayground) OverrideMeSync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VirtualMethodPlayground", + Method: "OverrideMeSync", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (v *VirtualMethodPlayground) ParallelSumAsync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VirtualMethodPlayground", + Method: "ParallelSumAsync", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (v *VirtualMethodPlayground) SerialSumAsync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VirtualMethodPlayground", + Method: "SerialSumAsync", + Args: []string{"number",}, + + }) + return 0.0 +} + +func (v *VirtualMethodPlayground) SumSync() float64 { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VirtualMethodPlayground", + Method: "SumSync", + Args: []string{"number",}, + + }) + return 0.0 +} + +type VoidCallbackIface interface { + GetMethodWasCalled() bool + SetMethodWasCalled() + CallMe() jsii.Any + OverrideMe() jsii.Any +} + +type VoidCallback struct { + MethodWasCalled bool +} + +func (v *VoidCallback) CallMe() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VoidCallback", + Method: "CallMe", + Args: []string{}, + + }) + return nil +} + +func (v *VoidCallback) OverrideMe() jsii.Any { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "VoidCallback", + Method: "OverrideMe", + Args: []string{}, + + }) + return nil +} + +type WithPrivatePropertyInConstructorIface interface { + GetSuccess() bool + SetSuccess() +} + +type WithPrivatePropertyInConstructor struct { + Success bool +} + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/composition.go 1`] = ` +package composition + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type CompositeOperationIface interface { + GetExpression() jsii.Any + SetExpression() + GetValue() float64 + SetValue() + GetDecorationPostfixes() []string + SetDecorationPostfixes() + GetDecorationPrefixes() []string + SetDecorationPrefixes() + GetStringStyle() CompositionStringStyle + SetStringStyle() + ToString() string +} + +type CompositeOperation struct { + Expression jsii.Any + Value float64 + DecorationPostfixes []string + DecorationPrefixes []string + StringStyle CompositionStringStyle +} + +func (c *CompositeOperation) ToString() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "CompositeOperation", + Method: "ToString", + Args: []string{}, + + }) + return "NOOP_RETURN_STRING" +} + +type CompositionStringStyle string + +const ( + CompositionStringStyleNormal CompositionStringStyle = "NORMAL" + CompositionStringStyleDecorated CompositionStringStyle = "DECORATED" +) + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/derivedclasshasnoproperties.go 1`] = ` +package derivedclasshasnoproperties + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type BaseIface interface { + GetProp() string + SetProp() +} + +type Base struct { + Prop string +} + +type DerivedIface interface { +} + +type Derived struct { +} + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/interfaceinnamespaceincludesclasses.go 1`] = ` +package interfaceinnamespaceincludesclasses + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type FooIface interface { + GetBar() string + SetBar() +} + +type Foo struct { + Bar string +} + +type HelloIface interface { + GetFoo() float64 +} + +type Hello struct { + Foo float64 +} + + +func (h Hello) GetFoo() float64 { + return h.Foo +} + + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/interfaceinnamespaceonlyinterface.go 1`] = ` +package interfaceinnamespaceonlyinterface + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type HelloIface interface { + GetFoo() float64 +} + +type Hello struct { + Foo float64 +} + + +func (h Hello) GetFoo() float64 { + return h.Foo +} + + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/pythonself.go 1`] = ` +package pythonself + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type ClassWithSelfIface interface { + GetSelf() string + SetSelf() + Method() string +} + +type ClassWithSelf struct { + Self string +} + +func (c *ClassWithSelf) Method() string { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "ClassWithSelf", + Method: "Method", + Args: []string{"number",}, + + }) + return "NOOP_RETURN_STRING" +} + +type ClassWithSelfKwargIface interface { + GetProps() StructWithSelf + SetProps() +} + +type ClassWithSelfKwarg struct { + Props StructWithSelf +} + +type IInterfaceWithSelf interface { + Method() string +} + +type StructWithSelfIface interface { + GetSelf() string +} + +type StructWithSelf struct { + Self string +} + + +func (s StructWithSelf) GetSelf() string { + return s.Self +} + + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule.go 1`] = ` +package submodule + +import ( + "github.com/aws-cdk/jsii/jsii" + "child" + "jsiicalc" +) + +type MyClassIface interface { + GetAwesomeness() child.Awesomeness + SetAwesomeness() + GetDefinedAt() string + SetDefinedAt() + GetGoodness() child.Goodness + SetGoodness() + GetProps() child.SomeStruct + SetProps() + GetAllTypes() jsiicalc.AllTypes + SetAllTypes() +} + +type MyClass struct { + Awesomeness child.Awesomeness + DefinedAt string + Goodness child.Goodness + Props child.SomeStruct + AllTypes jsiicalc.AllTypes +} + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule/backreferences.go 1`] = ` +package backreferences + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type MyClassReferenceIface interface { + GetReference() submodule.MyClass +} + +type MyClassReference struct { + Reference submodule.MyClass +} + + +func (m MyClassReference) GetReference() submodule.MyClass { + return m.Reference +} + + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule/child.go 1`] = ` +package child + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type Awesomeness string + +const ( + AwesomenessAwesome Awesomeness = "AWESOME" +) + +type Goodness string + +const ( + GoodnessPrettyGood Goodness = "PRETTY_GOOD" + GoodnessReallyGood Goodness = "REALLY_GOOD" + GoodnessAmazinglyGood Goodness = "AMAZINGLY_GOOD" +) + +type InnerClassIface interface { + GetStaticProp() SomeStruct + SetStaticProp() +} + +type InnerClass struct { + StaticProp SomeStruct +} + +type KwargsPropsIface interface { + GetExtra() string +} + +type KwargsProps struct { + Extra string +} + + +func (k KwargsProps) GetExtra() string { + return k.Extra +} + + +type OuterClassIface interface { + GetInnerClass() InnerClass + SetInnerClass() +} + +type OuterClass struct { + InnerClass InnerClass +} + +type SomeEnum string + +const ( + SomeEnumSome SomeEnum = "SOME" +) + +type SomeStructIface interface { + GetProp() SomeEnum +} + +type SomeStruct struct { + Prop SomeEnum +} + + +func (s SomeStruct) GetProp() SomeEnum { + return s.Prop +} + + +type StructureIface interface { + GetBool() bool +} + +type Structure struct { + Bool bool +} + + +func (s Structure) GetBool() bool { + return s.Bool +} + + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule/isolated.go 1`] = ` +package isolated + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type KwargsIface interface { + Method() bool +} + +type Kwargs struct { +} + +func (k *Kwargs) Method() bool { + jsii.NoOpRequest(jsii.NoOpApiRequest { + + Class: "Kwargs", + Method: "Method", + Args: []string{"jsii-calc.submodule.child.KwargsProps",}, + + }) + return true +} + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule/nestedsubmodule.go 1`] = ` +package nestedsubmodule + +import ( + "github.com/aws-cdk/jsii/jsii" + "child" +) + +type NamespacedIface interface { + GetDefinedAt() string + SetDefinedAt() + GetGoodness() child.Goodness + SetGoodness() +} + +type Namespaced struct { + DefinedAt string + Goodness child.Goodness +} + + +`; + +exports[`Generated code for "jsii-calc": /golang/jsiicalc/submodule/nestedsubmodule/deeplynested.go 1`] = ` +package deeplynested + +import ( + "github.com/aws-cdk/jsii/jsii" +) + +type INamespaced interface { + GetDefinedAt() string +} + + +`; + exports[`Generated code for "jsii-calc": /java/pom.xml 1`] = ` diff --git a/packages/jsii-reflect/lib/type.ts b/packages/jsii-reflect/lib/type.ts index cc28463ac1..cb94c6dcd8 100644 --- a/packages/jsii-reflect/lib/type.ts +++ b/packages/jsii-reflect/lib/type.ts @@ -77,7 +77,7 @@ export abstract class Type implements Documentable, SourceLocatable { * Determines whether this is a Data Type (that is, an interface with no methods) or not. */ public isDataType(): this is InterfaceType { - return false; + return false; // TODO how is this different from isInterfaceType? } /**