diff --git a/fern.schema.json b/fern.schema.json index 9e8cf0da18a..7f28614709e 100644 --- a/fern.schema.json +++ b/fern.schema.json @@ -1727,7 +1727,14 @@ ], "additionalProperties": false }, - "service.TypeReferenceDeclarationWithContentTypeSchema": { + "service.FormDataBodyEncodingStyle": { + "type": "string", + "enum": [ + "json", + "exploded" + ] + }, + "service.HttpInlineFileRequestBodyPropertySchema": { "type": "object", "properties": { "type": { @@ -1813,6 +1820,16 @@ } ] }, + "style": { + "oneOf": [ + { + "$ref": "#/definitions/service.FormDataBodyEncodingStyle" + }, + { + "type": "null" + } + ] + }, "content-type": { "oneOf": [ { @@ -1835,7 +1852,7 @@ "type": "string" }, { - "$ref": "#/definitions/service.TypeReferenceDeclarationWithContentTypeSchema" + "$ref": "#/definitions/service.HttpInlineFileRequestBodyPropertySchema" } ] }, diff --git a/fern/apis/fern-definition/definition/service.yml b/fern/apis/fern-definition/definition/service.yml index 5cb4b114b89..a799b8d74d6 100644 --- a/fern/apis/fern-definition/definition/service.yml +++ b/fern/apis/fern-definition/definition/service.yml @@ -115,12 +115,20 @@ types: discriminated: false union: - string - - TypeReferenceDeclarationWithContentTypeSchema + - HttpInlineFileRequestBodyPropertySchema - TypeReferenceDeclarationWithContentTypeSchema: + HttpInlineFileRequestBodyPropertySchema: extends: types.TypeReferenceDeclarationWithName properties: + style: + type: optional + docs: Defaults to json encoding content-type: optional + + FormDataBodyEncodingStyle: + enum: + - json + - exploded HttpQueryParameterSchema: discriminated: false diff --git a/fern/pages/changelogs/php-sdk/2025-02-07.mdx b/fern/pages/changelogs/php-sdk/2025-02-07.mdx new file mode 100644 index 00000000000..3e06a3da027 --- /dev/null +++ b/fern/pages/changelogs/php-sdk/2025-02-07.mdx @@ -0,0 +1,3 @@ +## 0.5.0 +**`(feat):`** Add the `__toString()` magic method to all generated class types. + diff --git a/fern/pages/changelogs/ts-express/2025-02-06.mdx b/fern/pages/changelogs/ts-express/2025-02-07.mdx similarity index 100% rename from fern/pages/changelogs/ts-express/2025-02-06.mdx rename to fern/pages/changelogs/ts-express/2025-02-07.mdx diff --git a/generators/browser-compatible-base/src/ast/Argument.ts b/generators/browser-compatible-base/src/ast/Argument.ts index a1a88cb4fe0..26ec76aed21 100644 --- a/generators/browser-compatible-base/src/ast/Argument.ts +++ b/generators/browser-compatible-base/src/ast/Argument.ts @@ -6,7 +6,7 @@ export type Arguments = NamedArgument[] | UnnamedArgument[]; export interface NamedArgument { name: string; - assignment: AbstractAstNode; + assignment: AbstractAstNode | string; } export type UnnamedArgument = AbstractAstNode; diff --git a/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGenerator.ts b/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGenerator.ts index 17698fcf0fd..69a4496a7f7 100644 --- a/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGenerator.ts +++ b/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGenerator.ts @@ -1,21 +1,70 @@ +import { FernIr } from "@fern-api/dynamic-ir-sdk"; + import { AbstractDynamicSnippetsGeneratorContext } from "./AbstractDynamicSnippetsGeneratorContext"; +import { AbstractEndpointSnippetGenerator } from "./AbstractEndpointSnippetGenerator"; +import { Result } from "./Result"; export abstract class AbstractDynamicSnippetsGenerator< Context extends AbstractDynamicSnippetsGeneratorContext, - EndpointSnippetRequest, - EndpointSnippetResponse + EndpointSnippetGenerator extends AbstractEndpointSnippetGenerator > { public constructor(public readonly context: Context) {} - /** - * Generates code for the specified request. - * @param request - */ - public abstract generate(request: EndpointSnippetRequest): Promise; + protected abstract createSnippetGenerator(context: Context): EndpointSnippetGenerator; + + public async generate( + request: FernIr.dynamic.EndpointSnippetRequest + ): Promise { + const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); + if (endpoints.length === 0) { + throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); + } + const result = new Result(); + for (const endpoint of endpoints) { + const context = this.context.clone() as Context; + const snippetGenerator = this.createSnippetGenerator(context); + try { + const snippet = await snippetGenerator.generateSnippet({ endpoint, request }); + if (context.errors.empty()) { + return { + snippet, + errors: undefined + }; + } + result.update({ context, snippet }); + } catch (error) { + if (result.err == null) { + result.err = error as Error; + } + } + } + return result.getResponseOrThrow({ endpoint: request.endpoint }); + } - /** - * Generates code for the specified request. - * @param request - */ - public abstract generateSync(request: EndpointSnippetRequest): EndpointSnippetResponse; + public generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse { + const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); + if (endpoints.length === 0) { + throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); + } + const result = new Result(); + for (const endpoint of endpoints) { + const context = this.context.clone() as Context; + const snippetGenerator = this.createSnippetGenerator(context); + try { + const snippet = snippetGenerator.generateSnippetSync({ endpoint, request }); + if (context.errors.empty()) { + return { + snippet, + errors: undefined + }; + } + result.update({ context, snippet }); + } catch (error) { + if (result.err == null) { + result.err = error as Error; + } + } + } + return result.getResponseOrThrow({ endpoint: request.endpoint }); + } } diff --git a/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGeneratorContext.ts b/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGeneratorContext.ts index 4c7523021fb..e70d6dbac1a 100644 --- a/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGeneratorContext.ts +++ b/generators/browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGeneratorContext.ts @@ -27,6 +27,8 @@ export abstract class AbstractDynamicSnippetsGeneratorContext { this.httpEndpointReferenceParser = new HttpEndpointReferenceParser(); } + public abstract clone(): AbstractDynamicSnippetsGeneratorContext; + public associateQueryParametersByWireValue({ parameters, values diff --git a/generators/browser-compatible-base/src/dynamic-snippets/AbstractEndpointSnippetGenerator.ts b/generators/browser-compatible-base/src/dynamic-snippets/AbstractEndpointSnippetGenerator.ts new file mode 100644 index 00000000000..c9576c8e558 --- /dev/null +++ b/generators/browser-compatible-base/src/dynamic-snippets/AbstractEndpointSnippetGenerator.ts @@ -0,0 +1,26 @@ +import { FernIr } from "@fern-api/dynamic-ir-sdk"; + +import { AbstractDynamicSnippetsGeneratorContext } from "./AbstractDynamicSnippetsGeneratorContext"; + +export abstract class AbstractEndpointSnippetGenerator { + // eslint-disable-next-line @typescript-eslint/no-empty-function + public constructor({ context }: { context: Context }) { + // eslint-disable-line @typescript-eslint/no-useless-constructor + } + + public abstract generateSnippet({ + endpoint, + request + }: { + endpoint: FernIr.dynamic.Endpoint; + request: FernIr.dynamic.EndpointSnippetRequest; + }): Promise; + + public abstract generateSnippetSync({ + endpoint, + request + }: { + endpoint: FernIr.dynamic.Endpoint; + request: FernIr.dynamic.EndpointSnippetRequest; + }): string; +} diff --git a/generators/csharp/codegen/src/ast/ClassInstantiation.ts b/generators/csharp/codegen/src/ast/ClassInstantiation.ts index 3fcf4dd30ac..595e0535600 100644 --- a/generators/csharp/codegen/src/ast/ClassInstantiation.ts +++ b/generators/csharp/codegen/src/ast/ClassInstantiation.ts @@ -46,7 +46,7 @@ export class ClassInstantiation extends AstNode { this.arguments_.forEach((argument, idx) => { if (isNamedArgument(argument)) { writer.write(`${argument.name} = `); - argument.assignment.write(writer); + writer.writeNodeOrString(argument.assignment); } else { argument.write(writer); } diff --git a/generators/go-v2/ast/src/ast/utils/writeArguments.ts b/generators/go-v2/ast/src/ast/utils/writeArguments.ts index ab1061779f4..a7e1211a64c 100644 --- a/generators/go-v2/ast/src/ast/utils/writeArguments.ts +++ b/generators/go-v2/ast/src/ast/utils/writeArguments.ts @@ -22,7 +22,7 @@ export function writeArguments({ writer, arguments_ }: { writer: Writer; argumen function writeArgument({ writer, argument }: { writer: Writer; argument: Argument }): void { if (isNamedArgument(argument)) { - argument.assignment.write(writer); + writer.writeNodeOrString(argument.assignment); } else { argument.write(writer); } diff --git a/generators/go-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts b/generators/go-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts index 98fb578391d..8a1c2eb30ca 100644 --- a/generators/go-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts +++ b/generators/go-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts @@ -1,8 +1,7 @@ import { AbstractDynamicSnippetsGenerator, AbstractFormatter, - FernGeneratorExec, - Result + FernGeneratorExec } from "@fern-api/browser-compatible-base-generator"; import { FernIr } from "@fern-api/dynamic-ir-sdk"; @@ -11,8 +10,7 @@ import { DynamicSnippetsGeneratorContext } from "./context/DynamicSnippetsGenera export class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator< DynamicSnippetsGeneratorContext, - FernIr.dynamic.EndpointSnippetRequest, - FernIr.dynamic.EndpointSnippetResponse + EndpointSnippetGenerator > { private formatter: AbstractFormatter | undefined; @@ -29,65 +27,7 @@ export class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator< this.formatter = formatter; } - public async generate( - request: FernIr.dynamic.EndpointSnippetRequest - ): Promise { - const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); - if (endpoints.length === 0) { - throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); - } - const result = new Result(); - for (const endpoint of endpoints) { - const context = this.context.clone(); - const snippetGenerator = new EndpointSnippetGenerator({ - context, - formatter: this.formatter - }); - try { - const snippet = await snippetGenerator.generateSnippet({ endpoint, request }); - if (context.errors.empty()) { - return { - snippet, - errors: undefined - }; - } - result.update({ context, snippet }); - } catch (error) { - if (result.err == null) { - result.err = error as Error; - } - } - } - return result.getResponseOrThrow({ endpoint: request.endpoint }); - } - - public generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse { - const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); - if (endpoints.length === 0) { - throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); - } - const result = new Result(); - for (const endpoint of endpoints) { - const context = this.context.clone(); - const snippetGenerator = new EndpointSnippetGenerator({ - context, - formatter: this.formatter - }); - try { - const snippet = snippetGenerator.generateSnippetSync({ endpoint, request }); - if (context.errors.empty()) { - return { - snippet, - errors: undefined - }; - } - result.update({ context, snippet }); - } catch (error) { - if (result.err == null) { - result.err = error as Error; - } - } - } - return result.getResponseOrThrow({ endpoint: request.endpoint }); + protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator { + return new EndpointSnippetGenerator({ context, formatter: this.formatter }); } } diff --git a/generators/php/codegen/src/ast/TypeLiteral.ts b/generators/php/codegen/src/ast/TypeLiteral.ts new file mode 100644 index 00000000000..ef734293922 --- /dev/null +++ b/generators/php/codegen/src/ast/TypeLiteral.ts @@ -0,0 +1,370 @@ +import { assertNever } from "@fern-api/core-utils"; + +import { ClassInstantiation } from "./ClassInstantiation"; +import { ClassReference } from "./ClassReference"; +import { CodeBlock } from "./CodeBlock"; +import { MethodInvocation } from "./MethodInvocation"; +import { AstNode, Writer } from "./core"; + +type InternalTypeLiteral = + | Boolean_ + | Class_ + | DateTime + | File + | Float + | List + | Map + | Number_ + | Reference + | String_ + | Unknown_ + | Null_ + | Nop; + +interface Boolean_ { + type: "boolean"; + value: boolean; +} + +interface Class_ { + type: "class"; + reference: ClassReference; + fields: ConstructorField[]; +} + +export interface ConstructorField { + name: string; + value: TypeLiteral; +} + +interface DateTime { + type: "datetime"; + value: string; +} + +interface File { + type: "file"; + value: string; +} + +interface Float { + type: "float"; + value: number; +} + +interface List { + type: "list"; + values: TypeLiteral[]; +} + +interface Map { + type: "map"; + entries: MapEntry[]; +} + +interface MapEntry { + key: TypeLiteral; + value: TypeLiteral; +} + +interface Number_ { + type: "number"; + value: number; +} + +interface Reference { + type: "reference"; + value: AstNode; +} + +interface String_ { + type: "string"; + value: string; +} + +interface Unknown_ { + type: "unknown"; + value: unknown; +} + +interface Null_ { + type: "null"; +} + +interface Nop { + type: "nop"; +} + +export class TypeLiteral extends AstNode { + private constructor(public readonly internalType: InternalTypeLiteral) { + super(); + } + + public write(writer: Writer): void { + switch (this.internalType.type) { + case "list": { + this.writeList({ writer, list: this.internalType }); + break; + } + case "boolean": { + writer.write(this.internalType.value.toString()); + break; + } + case "class": { + this.writeClass({ writer, class_: this.internalType }); + break; + } + case "file": { + writer.writeNode(buildFileFromString({ writer, value: this.internalType.value })); + break; + } + case "float": { + writer.write(this.internalType.value.toString()); + break; + } + case "number": { + writer.write(this.internalType.value.toString()); + break; + } + case "map": { + this.writeMap({ writer, map: this.internalType }); + break; + } + case "reference": { + writer.writeNode(this.internalType.value); + break; + } + case "datetime": { + writer.write(`'${this.internalType.value}'`); + break; + } + case "string": { + if (this.internalType.value.includes("\n")) { + this.writeStringWithHeredoc({ writer, value: this.internalType.value }); + break; + } + writer.write(`'${this.internalType.value.replaceAll("'", "\\'")}'`); + break; + } + case "unknown": { + this.writeUnknown({ writer, value: this.internalType.value }); + break; + } + case "null": { + writer.write("null"); + break; + } + case "nop": + break; + default: + assertNever(this.internalType); + } + } + + private writeStringWithHeredoc({ writer, value }: { writer: Writer; value: string }): void { + writer.writeLine("<< ({ + key: TypeLiteral.string(field.name), + value: field.value + })) + }) + ] + }) + ); + } + + private writeList({ writer, list }: { writer: Writer; list: List }): void { + const values = filterNopValues({ values: list.values }); + if (values.length === 0) { + writer.write("[]"); + return; + } + + writer.writeLine("["); + writer.indent(); + for (const value of values) { + value.write(writer); + writer.writeLine(","); + } + writer.dedent(); + writer.write("]"); + } + + private writeMap({ writer, map }: { writer: Writer; map: Map }): void { + const entries = filterNopMapEntries({ entries: map.entries }); + if (entries.length === 0) { + writer.write("[]"); + return; + } + + writer.writeLine("["); + writer.indent(); + for (const entry of entries) { + entry.key.write(writer); + writer.write(" => "); + entry.value.write(writer); + writer.writeLine(","); + } + writer.dedent(); + writer.write("]"); + } + + /* Static factory methods for creating a TypeLiteral */ + public static list({ values }: { values: TypeLiteral[] }): TypeLiteral { + return new this({ + type: "list", + values + }); + } + + public static boolean(value: boolean): TypeLiteral { + return new this({ type: "boolean", value }); + } + + public static file(value: string): TypeLiteral { + return new this({ type: "file", value }); + } + + public static float(value: number): TypeLiteral { + return new this({ type: "float", value }); + } + + public static datetime(value: string): TypeLiteral { + return new this({ type: "datetime", value }); + } + + public static number(value: number): TypeLiteral { + return new this({ type: "number", value }); + } + + public static map({ entries }: { entries: MapEntry[] }): TypeLiteral { + return new this({ + type: "map", + entries + }); + } + + public static reference(value: AstNode): TypeLiteral { + return new this({ + type: "reference", + value + }); + } + + public static string(value: string): TypeLiteral { + return new this({ + type: "string", + value + }); + } + + public static unknown(value: unknown): TypeLiteral { + return new this({ type: "unknown", value }); + } + + public static null(): TypeLiteral { + return new this({ type: "null" }); + } + + public static nop(): TypeLiteral { + return new this({ type: "nop" }); + } + + public static isNop(typeLiteral: TypeLiteral): boolean { + return typeLiteral.internalType.type === "nop"; + } + + private writeUnknown({ writer, value }: { writer: Writer; value: unknown }): void { + switch (typeof value) { + case "boolean": + writer.write(value.toString()); + return; + case "string": + writer.write(value.includes('"') ? `\`${value}\`` : `"${value}"`); + return; + case "number": + writer.write(value.toString()); + return; + case "object": + if (value == null) { + writer.write("null"); + return; + } + if (Array.isArray(value)) { + this.writeUnknownArray({ writer, value }); + return; + } + this.writeUnknownMap({ writer, value }); + return; + default: + throw new Error(`Internal error; unsupported unknown type: ${typeof value}`); + } + } + + private writeUnknownArray({ + writer, + value + }: { + writer: Writer; + value: any[]; // eslint-disable-line @typescript-eslint/no-explicit-any + }): void { + if (value.length === 0) { + writer.write("[]"); + return; + } + writer.writeLine("["); + writer.indent(); + for (const element of value) { + writer.writeNode(TypeLiteral.unknown(element)); + writer.writeLine(","); + } + writer.dedent(); + writer.write("]"); + } + + private writeUnknownMap({ writer, value }: { writer: Writer; value: object }): void { + const entries = Object.entries(value); + if (entries.length === 0) { + writer.write("[]"); + return; + } + writer.writeLine("["); + writer.indent(); + for (const [key, val] of entries) { + writer.write(`${key} => `); + writer.writeNode(TypeLiteral.unknown(val)); + writer.writeLine(","); + } + writer.dedent(); + writer.write("]"); + } +} + +function buildFileFromString({ writer, value }: { writer: Writer; value: string }): MethodInvocation { + return new MethodInvocation({ + on: new ClassReference({ + name: "File", + namespace: writer.rootNamespace + }), + method: "createFromString", + arguments_: [new CodeBlock(`"${value}"`)] + }); +} + +function filterNopMapEntries({ entries }: { entries: MapEntry[] }): MapEntry[] { + return entries.filter((entry) => !TypeLiteral.isNop(entry.key) && !TypeLiteral.isNop(entry.value)); +} + +function filterNopValues({ values }: { values: TypeLiteral[] }): TypeLiteral[] { + return values.filter((value) => !TypeLiteral.isNop(value)); +} diff --git a/generators/php/codegen/src/ast/core/AstNode.ts b/generators/php/codegen/src/ast/core/AstNode.ts index 43a162a3085..9d2b91755bd 100644 --- a/generators/php/codegen/src/ast/core/AstNode.ts +++ b/generators/php/codegen/src/ast/core/AstNode.ts @@ -31,4 +31,25 @@ export abstract class AstNode extends AbstractAstNode { this.write(writer); return writer.toString(); } + + /** + * Writes the node to a string. + */ + public async toStringAsync({ + namespace, + rootNamespace, + customConfig + }: { + namespace: string; + rootNamespace: string; + customConfig: BasePhpCustomConfigSchema; + }): Promise { + const writer = new Writer({ + namespace, + rootNamespace, + customConfig + }); + this.write(writer); + return writer.toString(); + } } diff --git a/generators/php/codegen/src/ast/core/index.ts b/generators/php/codegen/src/ast/core/index.ts new file mode 100644 index 00000000000..9734e344dcf --- /dev/null +++ b/generators/php/codegen/src/ast/core/index.ts @@ -0,0 +1,3 @@ +export { AstNode } from "./AstNode"; +export { GLOBAL_NAMESPACE } from "./Constant"; +export { Writer } from "./Writer"; diff --git a/generators/php/codegen/src/ast/index.ts b/generators/php/codegen/src/ast/index.ts index eeec5368649..3f129b0bc6f 100644 --- a/generators/php/codegen/src/ast/index.ts +++ b/generators/php/codegen/src/ast/index.ts @@ -12,4 +12,5 @@ export { Method } from "./Method"; export { MethodInvocation } from "./MethodInvocation"; export { Parameter } from "./Parameter"; export { Type } from "./Type"; +export { type ConstructorField, TypeLiteral } from "./TypeLiteral"; export { Writer } from "./core/Writer"; diff --git a/generators/php/codegen/src/ast/utils/writeArguments.ts b/generators/php/codegen/src/ast/utils/writeArguments.ts index 09a41b9ee2f..3ac564159ac 100644 --- a/generators/php/codegen/src/ast/utils/writeArguments.ts +++ b/generators/php/codegen/src/ast/utils/writeArguments.ts @@ -47,7 +47,7 @@ function writeCompact({ writer, arguments_ }: { writer: Writer; arguments_: Argu function writeArgument({ writer, argument }: { writer: Writer; argument: Argument }): void { if (isNamedArgument(argument)) { writer.write(`${argument.name}: `); - argument.assignment.write(writer); + writer.writeNodeOrString(argument.assignment); } else { argument.write(writer); } diff --git a/generators/php/codegen/src/php.ts b/generators/php/codegen/src/php.ts index 6183a60dca8..ece38d4f58e 100644 --- a/generators/php/codegen/src/php.ts +++ b/generators/php/codegen/src/php.ts @@ -64,6 +64,13 @@ export function invokeMethod(args: MethodInvocation.Args): MethodInvocation { return new MethodInvocation(args); } +export function throwException(args: ClassInstantiation.Args): AstNode { + return codeblock((writer) => { + writer.write("throw "); + writer.writeNode(instantiateClass(args)); + }); +} + export function map(args: Map.Args): Map { return new Map(args); } @@ -92,6 +99,10 @@ export function variable(name: string): AstNode { return codeblock(convertToPhpVariableName(name)); } +export function string(stringValue: string): AstNode { + return codeblock(`"${stringValue}"`); +} + export function mergeArrays(...args: MergeArrays.Args): MergeArrays { return new MergeArrays(args); } @@ -107,6 +118,7 @@ export { Array, Attribute, Class, + type ConstructorField, Trait, ClassInstantiation, ClassReference, @@ -118,5 +130,6 @@ export { MethodInvocation, Parameter, Type, + TypeLiteral, Writer } from "./ast"; diff --git a/generators/php/dynamic-snippets/.depcheckrc.json b/generators/php/dynamic-snippets/.depcheckrc.json new file mode 100644 index 00000000000..3a8e6788660 --- /dev/null +++ b/generators/php/dynamic-snippets/.depcheckrc.json @@ -0,0 +1,12 @@ +{ + "ignores": [ + "@types/jest", + "globals", + "@trivago/prettier-plugin-sort-imports", + "@types/node", + "@fern-fern/ir-sdk" + ], + "ignore-patterns": [ + "lib" + ] +} \ No newline at end of file diff --git a/generators/php/dynamic-snippets/.prettierrc.cjs b/generators/php/dynamic-snippets/.prettierrc.cjs new file mode 100644 index 00000000000..39cf0d0b8c9 --- /dev/null +++ b/generators/php/dynamic-snippets/.prettierrc.cjs @@ -0,0 +1 @@ +module.exports = require("../../../.prettierrc.json"); diff --git a/generators/php/dynamic-snippets/build.cjs b/generators/php/dynamic-snippets/build.cjs new file mode 100644 index 00000000000..1ca773515ab --- /dev/null +++ b/generators/php/dynamic-snippets/build.cjs @@ -0,0 +1,76 @@ +const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill'); +const { NodeGlobalsPolyfillPlugin } = require('@esbuild-plugins/node-globals-polyfill'); +const packageJson = require("./package.json"); +const tsup = require('tsup'); +const { writeFile, mkdir } = require("fs/promises"); +const path = require("path"); + +main(); + +async function main() { + const config = { + entry: ['src/**/*.ts', '!src/__test__'], + target: "es2017", + minify: true, + dts: true, + esbuildPlugins: [ + NodeModulesPolyfillPlugin(), + NodeGlobalsPolyfillPlugin({ + process: true, + buffer: true, + util: true + }) + ], + tsconfig: "./build.tsconfig.json" + }; + + await tsup.build({ + ...config, + format: ['cjs'], + outDir: 'dist/cjs', + clean: true, + }); + + await tsup.build({ + ...config, + format: ['esm'], + outDir: 'dist/esm', + clean: false, + }); + + await mkdir(path.join(__dirname, "dist"), { recursive: true }); + process.chdir(path.join(__dirname, "dist")); + + await writeFile( + "package.json", + JSON.stringify( + { + name: packageJson.name, + version: process.argv[2] || packageJson.version, + repository: packageJson.repository, + type: "module", + exports: { + // Conditional exports for ESM and CJS. + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./cjs/index.d.cts", + "default": "./cjs/index.cjs" + } + }, + // Fallback for older tooling or direct imports. + main: "./cjs/index.cjs", + module: "./esm/index.js", + types: "./cjs/index.d.cts", + files: [ + "cjs", + "esm" + ] + }, + undefined, + 2 + ) + ); +} diff --git a/generators/php/dynamic-snippets/build.tsconfig.json b/generators/php/dynamic-snippets/build.tsconfig.json new file mode 100644 index 00000000000..dd569a9926a --- /dev/null +++ b/generators/php/dynamic-snippets/build.tsconfig.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@fern-api/configs/tsconfig/main.json", + "include": ["src/**/*.ts"], + "exclude": ["src/**/__test__"], + "compilerOptions": { + "composite": false + } +} \ No newline at end of file diff --git a/generators/php/dynamic-snippets/package.json b/generators/php/dynamic-snippets/package.json new file mode 100644 index 00000000000..73747f2c400 --- /dev/null +++ b/generators/php/dynamic-snippets/package.json @@ -0,0 +1,49 @@ +{ + "name": "@fern-api/php-dynamic-snippets", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/fern-api/fern.git", + "directory": "generators/php/dynamic-snippets" + }, + "files": [ + "lib" + ], + "type": "module", + "source": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "sideEffects": false, + "scripts": { + "clean": "rm -rf ./lib && tsc --build --clean", + "compile": "tsc --build", + "test": "vitest --passWithNoTests --run", + "test:update": "vitest --passWithNoTests --run -u", + "lint:eslint": "eslint --max-warnings 0 . --ignore-pattern=../../../.eslintignore", + "lint:eslint:fix": "yarn lint:eslint --fix", + "format": "prettier --write --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"", + "format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"", + "depcheck": "depcheck", + "dist": "pnpm compile && node build.cjs" + }, + "devDependencies": { + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@esbuild-plugins/node-modules-polyfill": "^0.2.2", + "@fern-api/browser-compatible-base-generator": "workspace:*", + "@fern-api/core-utils": "workspace:*", + "@fern-api/dynamic-ir-sdk": "^55.0.0", + "@fern-api/path-utils": "workspace:*", + "@fern-api/php-codegen": "workspace:*", + "@types/jest": "^29.5.12", + "string.prototype.replaceall": "^1.0.10", + "tsup": "^8.3.5", + "@fern-api/configs": "workspace:*", + "@types/node": "18.15.3", + "depcheck": "^1.4.7", + "eslint": "^8.56.0", + "prettier": "^3.4.2", + "@trivago/prettier-plugin-sort-imports": "^5.2.1", + "typescript": "5.7.2", + "vitest": "^2.1.8" + } +} diff --git a/generators/php/dynamic-snippets/src/DynamicSnippetsGenerator.ts b/generators/php/dynamic-snippets/src/DynamicSnippetsGenerator.ts new file mode 100644 index 00000000000..0602a12e0bd --- /dev/null +++ b/generators/php/dynamic-snippets/src/DynamicSnippetsGenerator.ts @@ -0,0 +1,24 @@ +import { AbstractDynamicSnippetsGenerator, FernGeneratorExec } from "@fern-api/browser-compatible-base-generator"; +import { FernIr } from "@fern-api/dynamic-ir-sdk"; + +import { EndpointSnippetGenerator } from "./EndpointSnippetGenerator"; +import { DynamicSnippetsGeneratorContext } from "./context/DynamicSnippetsGeneratorContext"; + +export class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator< + DynamicSnippetsGeneratorContext, + EndpointSnippetGenerator +> { + constructor({ + ir, + config + }: { + ir: FernIr.dynamic.DynamicIntermediateRepresentation; + config: FernGeneratorExec.GeneratorConfig; + }) { + super(new DynamicSnippetsGeneratorContext({ ir, config })); + } + + protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator { + return new EndpointSnippetGenerator({ context }); + } +} diff --git a/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts b/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts new file mode 100644 index 00000000000..c9f6e091f38 --- /dev/null +++ b/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts @@ -0,0 +1,54 @@ +import { FernIr } from "@fern-api/dynamic-ir-sdk"; +import { php } from "@fern-api/php-codegen"; + +import { DynamicSnippetsGeneratorContext } from "./context/DynamicSnippetsGeneratorContext"; + +const SNIPPET_NAMESPACE = "Example"; + +export class EndpointSnippetGenerator { + private context: DynamicSnippetsGeneratorContext; + + constructor({ context }: { context: DynamicSnippetsGeneratorContext }) { + this.context = context; + } + + public async generateSnippet({ + endpoint, + request + }: { + endpoint: FernIr.dynamic.Endpoint; + request: FernIr.dynamic.EndpointSnippetRequest; + }): Promise { + const code = this.buildCodeBlock({ endpoint, snippet: request }); + return await code.toStringAsync({ + namespace: SNIPPET_NAMESPACE, + rootNamespace: SNIPPET_NAMESPACE, + customConfig: this.context.customConfig ?? {} + }); + } + + public generateSnippetSync({ + endpoint, + request + }: { + endpoint: FernIr.dynamic.Endpoint; + request: FernIr.dynamic.EndpointSnippetRequest; + }): string { + const code = this.buildCodeBlock({ endpoint, snippet: request }); + return code.toString({ + namespace: SNIPPET_NAMESPACE, + rootNamespace: SNIPPET_NAMESPACE, + customConfig: this.context.customConfig ?? {} + }); + } + + private buildCodeBlock({ + endpoint, + snippet + }: { + endpoint: FernIr.dynamic.Endpoint; + snippet: FernIr.dynamic.EndpointSnippetRequest; + }): php.AstNode { + return php.TypeLiteral.nop(); + } +} diff --git a/generators/php/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts b/generators/php/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts new file mode 100644 index 00000000000..f53621bfbf7 --- /dev/null +++ b/generators/php/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts @@ -0,0 +1,12 @@ +import { DynamicSnippetsTestRunner } from "@fern-api/browser-compatible-base-generator"; + +import { buildDynamicSnippetsGenerator } from "./utils/buildDynamicSnippetsGenerator"; +import { buildGeneratorConfig } from "./utils/buildGeneratorConfig"; + +describe("snippets (default)", () => { + const runner = new DynamicSnippetsTestRunner(); + runner.runTests({ + buildGenerator: ({ irFilepath }) => + buildDynamicSnippetsGenerator({ irFilepath, config: buildGeneratorConfig() }) + }); +}); diff --git a/generators/php/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap b/generators/php/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap new file mode 100644 index 00000000000..479253d9a90 --- /dev/null +++ b/generators/php/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap @@ -0,0 +1,163 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`snippets (default) > examples > 'GET /metadata (allow-multiple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > examples > 'GET /metadata (simple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > examples > 'POST /big-entity (simple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > examples > 'POST /movie (invalid request body)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > examples > 'POST /movie (simple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > exhaustive > 'GET /object/get-and-return-with-optio…' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > exhaustive > 'POST /container/list-of-objects (inva…' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > exhaustive > 'POST /container/list-of-objects (simp…' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > exhaustive > 'POST /container/list-of-primitives (s…' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > file-upload > 'POST /' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > file-upload > 'POST /just-file' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > file-upload > 'POST /just-file-with-query-params' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > imdb > 'GET /movies/{movieId} (simple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > imdb > 'POST /movies/create-movie (simple)' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > multi-url-environment > 'Custom environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > multi-url-environment > 'Invalid multi url environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > multi-url-environment > 'Production environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > multi-url-environment > 'Staging environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > multi-url-environment > 'Unrecognized environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > nullable > 'Body properties' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > nullable > 'Invalid null value' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > nullable > 'Query parameters' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > single-url-environment-default > 'Production environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > single-url-environment-default > 'Staging environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > single-url-environment-default > 'custom baseURL' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > single-url-environment-default > 'invalid baseURL and environment' 1`] = ` +"namespace Example; + +" +`; + +exports[`snippets (default) > single-url-environment-default > 'invalid environment' 1`] = ` +"namespace Example; + +" +`; diff --git a/generators/php/dynamic-snippets/src/__test__/utils/buildDynamicSnippetsGenerator.ts b/generators/php/dynamic-snippets/src/__test__/utils/buildDynamicSnippetsGenerator.ts new file mode 100644 index 00000000000..959eb5e46a6 --- /dev/null +++ b/generators/php/dynamic-snippets/src/__test__/utils/buildDynamicSnippetsGenerator.ts @@ -0,0 +1,18 @@ +import { readFileSync } from "fs"; + +import { FernGeneratorExec } from "@fern-api/browser-compatible-base-generator"; +import { AbsoluteFilePath } from "@fern-api/path-utils"; + +import { DynamicSnippetsGenerator } from "../../DynamicSnippetsGenerator"; + +export function buildDynamicSnippetsGenerator({ + irFilepath, + config +}: { + irFilepath: AbsoluteFilePath; + config: FernGeneratorExec.GeneratorConfig; +}): DynamicSnippetsGenerator { + const content = readFileSync(irFilepath, "utf-8"); + const ir = JSON.parse(content); + return new DynamicSnippetsGenerator({ ir, config }); +} diff --git a/generators/php/dynamic-snippets/src/__test__/utils/buildGeneratorConfig.ts b/generators/php/dynamic-snippets/src/__test__/utils/buildGeneratorConfig.ts new file mode 100644 index 00000000000..29c9de8594b --- /dev/null +++ b/generators/php/dynamic-snippets/src/__test__/utils/buildGeneratorConfig.ts @@ -0,0 +1,35 @@ +import { FernGeneratorExec } from "@fern-api/browser-compatible-base-generator"; +import { BasePhpCustomConfigSchema } from "@fern-api/php-codegen"; + +const DEFAULT_CONFIG: FernGeneratorExec.GeneratorConfig = { + dryRun: false, + irFilepath: "", + output: { + path: "", + mode: FernGeneratorExec.OutputMode.github({ + version: "v1.0.0", + repoUrl: "https://github.com/acme/acme-php" + }) + }, + organization: "acme", + workspaceName: "acme", + environment: FernGeneratorExec.GeneratorEnvironment.local(), + whitelabel: false, + writeUnitTests: false, + generateOauthClients: false, + customConfig: { + namespace: "Acme" + } as BasePhpCustomConfigSchema +}; + +export function buildGeneratorConfig({ + customConfig +}: { customConfig?: Partial } = {}): FernGeneratorExec.GeneratorConfig { + return { + ...DEFAULT_CONFIG, + customConfig: { + ...(DEFAULT_CONFIG.customConfig as BasePhpCustomConfigSchema), + ...customConfig + } + }; +} diff --git a/generators/php/dynamic-snippets/src/context/DynamicSnippetsGeneratorContext.ts b/generators/php/dynamic-snippets/src/context/DynamicSnippetsGeneratorContext.ts new file mode 100644 index 00000000000..98294f6b2e8 --- /dev/null +++ b/generators/php/dynamic-snippets/src/context/DynamicSnippetsGeneratorContext.ts @@ -0,0 +1,42 @@ +import { + AbstractDynamicSnippetsGeneratorContext, + FernGeneratorExec +} from "@fern-api/browser-compatible-base-generator"; +import { FernIr } from "@fern-api/dynamic-ir-sdk"; +import { BasePhpCustomConfigSchema } from "@fern-api/php-codegen"; + +import { DynamicTypeLiteralMapper } from "./DynamicTypeLiteralMapper"; +import { FilePropertyMapper } from "./FilePropertyMapper"; + +export class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext { + public ir: FernIr.dynamic.DynamicIntermediateRepresentation; + public customConfig: BasePhpCustomConfigSchema | undefined; + public dynamicTypeLiteralMapper: DynamicTypeLiteralMapper; + public filePropertyMapper: FilePropertyMapper; + + constructor({ + ir, + config + }: { + ir: FernIr.dynamic.DynamicIntermediateRepresentation; + config: FernGeneratorExec.GeneratorConfig; + }) { + super({ ir, config }); + this.ir = ir; + this.customConfig = + config.customConfig != null ? (config.customConfig as BasePhpCustomConfigSchema) : undefined; + this.dynamicTypeLiteralMapper = new DynamicTypeLiteralMapper({ context: this }); + this.filePropertyMapper = new FilePropertyMapper({ context: this }); + } + + public clone(): DynamicSnippetsGeneratorContext { + return new DynamicSnippetsGeneratorContext({ + ir: this.ir, + config: this.config + }); + } + + public getPropertyName(name: FernIr.Name): string { + return name.camelCase.safeName; + } +} diff --git a/generators/php/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts b/generators/php/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts new file mode 100644 index 00000000000..383455f2c85 --- /dev/null +++ b/generators/php/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts @@ -0,0 +1,285 @@ +import { Severity } from "@fern-api/browser-compatible-base-generator"; +import { assertNever } from "@fern-api/core-utils"; +import { FernIr } from "@fern-api/dynamic-ir-sdk"; +import { php } from "@fern-api/php-codegen"; + +import { DynamicSnippetsGeneratorContext } from "./DynamicSnippetsGeneratorContext"; + +export declare namespace DynamicTypeLiteralMapper { + interface Args { + typeReference: FernIr.dynamic.TypeReference; + value: unknown; + as?: ConvertedAs; + } + + // Identifies what the type is being converted as, which sometimes influences how + // the type is instantiated. + type ConvertedAs = "key"; +} + +export class DynamicTypeLiteralMapper { + private context: DynamicSnippetsGeneratorContext; + + constructor({ context }: { context: DynamicSnippetsGeneratorContext }) { + this.context = context; + } + + public convert(args: DynamicTypeLiteralMapper.Args): php.TypeLiteral { + // eslint-disable-next-line eqeqeq + if (args.value === null) { + if (this.context.isNullable(args.typeReference)) { + return php.TypeLiteral.null(); + } + this.context.errors.add({ + severity: Severity.Critical, + message: "Expected non-null value, but got null" + }); + return php.TypeLiteral.nop(); + } + if (args.value === undefined) { + return php.TypeLiteral.nop(); + } + // TODO: Handle mapping types. + return php.TypeLiteral.nop(); + } + + private convertLiteral({ + literalType, + value + }: { + literalType: FernIr.dynamic.LiteralType; + value: unknown; + }): php.TypeLiteral { + switch (literalType.type) { + case "boolean": { + const bool = this.context.getValueAsBoolean({ value }); + if (bool == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.boolean(bool); + } + case "string": { + const str = this.context.getValueAsString({ value }); + if (str == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.string(str); + } + default: + assertNever(literalType); + } + } + + private convertList({ list, value }: { list: FernIr.dynamic.TypeReference; value: unknown }): php.TypeLiteral { + if (!Array.isArray(value)) { + this.context.errors.add({ + severity: Severity.Critical, + message: `Expected array but got: ${typeof value}` + }); + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.list({ + values: value.map((v, index) => { + this.context.errors.scope({ index }); + try { + return this.convert({ typeReference: list, value: v }); + } finally { + this.context.errors.unscope(); + } + }) + }); + } + + private convertMap({ map, value }: { map: FernIr.dynamic.MapType; value: unknown }): php.TypeLiteral { + if (typeof value !== "object" || value == null) { + this.context.errors.add({ + severity: Severity.Critical, + message: `Expected object but got: ${value == null ? "null" : typeof value}` + }); + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.map({ + entries: Object.entries(value).map(([key, value]) => { + this.context.errors.scope(key); + try { + return { + key: this.convert({ typeReference: map.key, value: key, as: "key" }), + value: this.convert({ typeReference: map.value, value }) + }; + } finally { + this.context.errors.unscope(); + } + }) + }); + } + + private convertNamed({ + named, + value, + as + }: { + named: FernIr.dynamic.NamedType; + value: unknown; + as?: DynamicTypeLiteralMapper.ConvertedAs; + }): php.TypeLiteral { + switch (named.type) { + case "alias": { + return this.convert({ typeReference: named.typeReference, value, as }); + } + case "discriminatedUnion": + return this.convertDiscriminatedUnion({ + discriminatedUnion: named, + value + }); + case "enum": + return this.convertEnum({ enum_: named, value }); + case "object": + return this.convertObject({ object_: named, value }); + case "undiscriminatedUnion": + return this.convertUndiscriminatedUnion({ undiscriminatedUnion: named, value }); + default: + assertNever(named); + } + } + + private convertDiscriminatedUnion({ + discriminatedUnion, + value + }: { + discriminatedUnion: FernIr.dynamic.DiscriminatedUnionType; + value: unknown; + }): php.TypeLiteral { + return php.TypeLiteral.nop(/* TODO: Implement me! */); + } + + private convertObject({ object_, value }: { object_: FernIr.dynamic.ObjectType; value: unknown }): php.TypeLiteral { + return php.TypeLiteral.nop(/* TODO: Implement me! */); + } + + private convertEnum({ enum_, value }: { enum_: FernIr.dynamic.EnumType; value: unknown }): php.TypeLiteral { + return php.TypeLiteral.nop(/* TODO: Implement me! */); + } + + private convertUndiscriminatedUnion({ + undiscriminatedUnion, + value + }: { + undiscriminatedUnion: FernIr.dynamic.UndiscriminatedUnionType; + value: unknown; + }): php.TypeLiteral { + const result = this.findMatchingUndiscriminatedUnionType({ + undiscriminatedUnion, + value + }); + if (result == null) { + return php.TypeLiteral.nop(); + } + return result; + } + + private findMatchingUndiscriminatedUnionType({ + undiscriminatedUnion, + value + }: { + undiscriminatedUnion: FernIr.dynamic.UndiscriminatedUnionType; + value: unknown; + }): php.TypeLiteral | undefined { + for (const typeReference of undiscriminatedUnion.types) { + try { + return this.convert({ typeReference, value }); + } catch (e) { + continue; + } + } + this.context.errors.add({ + severity: Severity.Critical, + message: `None of the types in the undiscriminated union matched the given "${typeof value}" value` + }); + return undefined; + } + + private convertUnknown({ value }: { value: unknown }): php.TypeLiteral { + return php.TypeLiteral.unknown(value); + } + + private convertPrimitive({ + primitive, + value, + as + }: { + primitive: FernIr.PrimitiveTypeV1; + value: unknown; + as?: DynamicTypeLiteralMapper.ConvertedAs; + }): php.TypeLiteral { + switch (primitive) { + case "INTEGER": + case "LONG": + case "UINT": + case "UINT_64": { + const num = this.getValueAsNumber({ value, as }); + if (num == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.number(num); + } + case "FLOAT": + case "DOUBLE": { + const num = this.getValueAsNumber({ value }); + if (num == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.float(num); + } + case "BOOLEAN": { + const bool = this.getValueAsBoolean({ value, as }); + if (bool == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.boolean(bool); + } + case "DATE": + case "DATE_TIME": { + const str = this.context.getValueAsString({ value }); + if (str == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.datetime(str); + } + case "BASE_64": + case "UUID": + case "BIG_INTEGER": + case "STRING": { + const str = this.context.getValueAsString({ value }); + if (str == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.string(str); + } + default: + assertNever(primitive); + } + } + + private getValueAsNumber({ + value, + as + }: { + value: unknown; + as?: DynamicTypeLiteralMapper.ConvertedAs; + }): number | undefined { + const num = as === "key" ? (typeof value === "string" ? Number(value) : value) : value; + return this.context.getValueAsNumber({ value: num }); + } + + private getValueAsBoolean({ + value, + as + }: { + value: unknown; + as?: DynamicTypeLiteralMapper.ConvertedAs; + }): boolean | undefined { + const bool = + as === "key" ? (typeof value === "string" ? value === "true" : value === "false" ? false : value) : value; + return this.context.getValueAsBoolean({ value: bool }); + } +} diff --git a/generators/php/dynamic-snippets/src/context/FilePropertyMapper.ts b/generators/php/dynamic-snippets/src/context/FilePropertyMapper.ts new file mode 100644 index 00000000000..a70cc06eeb1 --- /dev/null +++ b/generators/php/dynamic-snippets/src/context/FilePropertyMapper.ts @@ -0,0 +1,102 @@ +import { assertNever } from "@fern-api/core-utils"; +import { FernIr } from "@fern-api/dynamic-ir-sdk"; +import { php } from "@fern-api/php-codegen"; + +import { DynamicSnippetsGeneratorContext } from "./DynamicSnippetsGeneratorContext"; + +export interface FilePropertyInfo { + fileFields: php.ConstructorField[]; + bodyPropertyFields: php.ConstructorField[]; +} + +export class FilePropertyMapper { + private context: DynamicSnippetsGeneratorContext; + + constructor({ context }: { context: DynamicSnippetsGeneratorContext }) { + this.context = context; + } + + public getFilePropertyInfo({ + body, + value + }: { + body: FernIr.dynamic.FileUploadRequestBody; + value: unknown; + }): FilePropertyInfo { + const result: FilePropertyInfo = { + fileFields: [], + bodyPropertyFields: [] + }; + const record = this.context.getRecord(value) ?? {}; + for (const property of body.properties) { + switch (property.type) { + case "file": + result.fileFields.push({ + name: this.context.getPropertyName(property.name), + value: this.getSingleFileProperty({ property, record }) + }); + break; + case "fileArray": + result.fileFields.push({ + name: this.context.getPropertyName(property.name), + value: this.getArrayFileProperty({ property, record }) + }); + break; + case "bodyProperty": + result.bodyPropertyFields.push({ + name: this.context.getPropertyName(property.name.name), + value: this.getBodyProperty({ property, record }) + }); + break; + default: + assertNever(property); + } + } + return result; + } + + private getSingleFileProperty({ + property, + record + }: { + property: FernIr.dynamic.FileUploadRequestBodyProperty.File_; + record: Record; + }): php.TypeLiteral { + const fileValue = this.context.getSingleFileValue({ property, record }); + if (fileValue == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.file(fileValue); + } + + private getArrayFileProperty({ + property, + record + }: { + property: FernIr.dynamic.FileUploadRequestBodyProperty.FileArray; + record: Record; + }): php.TypeLiteral { + const fileValues = this.context.getFileArrayValues({ property, record }); + if (fileValues == null) { + return php.TypeLiteral.nop(); + } + return php.TypeLiteral.list({ values: fileValues.map((value) => php.TypeLiteral.file(value)) }); + } + + private getBodyProperty({ + property, + record + }: { + property: FernIr.dynamic.NamedParameter; + record: Record; + }): php.TypeLiteral { + const bodyPropertyValue = record[property.name.wireValue]; + if (bodyPropertyValue == null) { + return php.TypeLiteral.nop(); + } + return this.context.dynamicTypeLiteralMapper.convert({ + typeReference: property.typeReference, + value: bodyPropertyValue + }); + } +} diff --git a/generators/php/dynamic-snippets/src/index.ts b/generators/php/dynamic-snippets/src/index.ts new file mode 100644 index 00000000000..de809172668 --- /dev/null +++ b/generators/php/dynamic-snippets/src/index.ts @@ -0,0 +1,4 @@ +// Required for ES2017 compatibility. +import "string.prototype.replaceall"; + +export { DynamicSnippetsGenerator } from "./DynamicSnippetsGenerator"; diff --git a/generators/php/dynamic-snippets/tsconfig.json b/generators/php/dynamic-snippets/tsconfig.json new file mode 100644 index 00000000000..6147f45aa86 --- /dev/null +++ b/generators/php/dynamic-snippets/tsconfig.json @@ -0,0 +1,31 @@ +{ + "extends": "@fern-api/configs/tsconfig/main.json", + "compilerOptions": { + "composite": true, + "outDir": "lib", + "rootDir": "src" + }, + "include": [ + "./src/**/*" + ], + "references": [ + { + "path": "../../../packages/commons/core-utils" + }, + { + "path": "../../../packages/commons/path-utils" + }, + { + "path": "../../../packages/cli/fern-definition/schema" + }, + { + "path": "../../../packages/ir-sdk" + }, + { + "path": "../../browser-compatible-base" + }, + { + "path": "../codegen" + } + ] +} \ No newline at end of file diff --git a/generators/php/dynamic-snippets/vitest.config.ts b/generators/php/dynamic-snippets/vitest.config.ts new file mode 100644 index 00000000000..fecc099c58a --- /dev/null +++ b/generators/php/dynamic-snippets/vitest.config.ts @@ -0,0 +1 @@ +export { default } from "../../../shared/vitest.config"; diff --git a/generators/php/sdk/src/endpoint/http/HttpEndpointGenerator.ts b/generators/php/sdk/src/endpoint/http/HttpEndpointGenerator.ts index f6cedb49b62..2163c5f931f 100644 --- a/generators/php/sdk/src/endpoint/http/HttpEndpointGenerator.ts +++ b/generators/php/sdk/src/endpoint/http/HttpEndpointGenerator.ts @@ -99,6 +99,49 @@ export class HttpEndpointGenerator extends AbstractEndpointGenerator { } writer.dedent(); writer.write("} catch ("); + writer.writeNode(this.context.guzzleClient.getRequestExceptionClassReference()); + writer.writeLine(" $e) {"); + writer.indent(); + writer.writeNodeStatement(php.assignVariable(php.variable("response"), "$e->getResponse()")); + writer.controlFlow("if", php.codeblock("$response === null")); + writer.writeNodeStatement( + php.throwException({ + classReference: this.context.getBaseExceptionClassReference(), + arguments_: [ + { + name: "message", + assignment: "$e->getMessage()" + }, + { + name: "previous", + assignment: php.variable("e") + } + ] + }) + ); + writer.endControlFlow(); + writer.writeNodeStatement( + php.throwException({ + classReference: this.context.getBaseApiExceptionClassReference(), + arguments_: [ + { + name: "message", + assignment: php.string("API request failed") + }, + { + name: "statusCode", + assignment: "$response->getStatusCode()" + }, + { + name: "body", + assignment: "$response->getBody()->getContents()" + } + ], + multiline: true + }) + ); + writer.dedent(); + writer.write("} catch ("); writer.writeNode(this.context.getClientExceptionInterfaceClassReference()); writer.writeLine(" $e) {"); writer.indent(); diff --git a/generators/php/sdk/src/external/GuzzleClient.ts b/generators/php/sdk/src/external/GuzzleClient.ts index 1892b4142a3..4a388180e5a 100644 --- a/generators/php/sdk/src/external/GuzzleClient.ts +++ b/generators/php/sdk/src/external/GuzzleClient.ts @@ -6,9 +6,11 @@ import { SdkGeneratorContext } from "../SdkGeneratorContext"; * The Guzzle HTTP client. */ export class GuzzleClient { - public static NAMESPACE = "GuzzleHttp"; - public static CLIENT_CLASS_NAME = "Client"; - public static CLIENT_INTERFACE_CLASS_NAME = "ClientInterface"; + public static readonly NAMESPACE = "GuzzleHttp"; + public static readonly EXCEPTION_NAMESPACE = "GuzzleHttp\\Exception"; + public static readonly CLIENT_CLASS_NAME = "Client"; + public static readonly CLIENT_INTERFACE_CLASS_NAME = "ClientInterface"; + public static readonly REQUEST_EXCEPTION_CLASS_NAME = "RequestException"; private context: SdkGeneratorContext; @@ -30,6 +32,13 @@ export class GuzzleClient { }); } + public getRequestExceptionClassReference(): php.ClassReference { + return php.classReference({ + name: GuzzleClient.REQUEST_EXCEPTION_CLASS_NAME, + namespace: GuzzleClient.EXCEPTION_NAMESPACE + }); + } + public instantiate(): php.ClassInstantiation { return php.instantiateClass({ classReference: this.getClientClassReference(), diff --git a/generators/php/sdk/versions.yml b/generators/php/sdk/versions.yml index f5ddc1450b9..055e594558d 100644 --- a/generators/php/sdk/versions.yml +++ b/generators/php/sdk/versions.yml @@ -1,8 +1,16 @@ +- version: 0.5.1 + changelogEntry: + - type: fix + summary: >- + Catch HTTP request exceptions and rethrow it as a FooApiException. + irVersion: 55 + - version: 0.5.0 changelogEntry: - type: feat summary: >- Add the `__toString()` magic method to all generated class types. + irVersion: 55 - version: 0.4.0 changelogEntry: @@ -28,8 +36,8 @@ $httpClient = new Client(['handler' => $handlerStack]); $client = new FooClient(['client' => $client]); ``` - irVersion: 55 + - version: 0.3.2 changelogEntry: - type: internal diff --git a/generators/typescript-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts b/generators/typescript-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts index 2b5262462ed..0602a12e0bd 100644 --- a/generators/typescript-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts +++ b/generators/typescript-v2/dynamic-snippets/src/DynamicSnippetsGenerator.ts @@ -1,8 +1,4 @@ -import { - AbstractDynamicSnippetsGenerator, - FernGeneratorExec, - Result -} from "@fern-api/browser-compatible-base-generator"; +import { AbstractDynamicSnippetsGenerator, FernGeneratorExec } from "@fern-api/browser-compatible-base-generator"; import { FernIr } from "@fern-api/dynamic-ir-sdk"; import { EndpointSnippetGenerator } from "./EndpointSnippetGenerator"; @@ -10,8 +6,7 @@ import { DynamicSnippetsGeneratorContext } from "./context/DynamicSnippetsGenera export class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator< DynamicSnippetsGeneratorContext, - FernIr.dynamic.EndpointSnippetRequest, - FernIr.dynamic.EndpointSnippetResponse + EndpointSnippetGenerator > { constructor({ ir, @@ -23,63 +18,7 @@ export class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator< super(new DynamicSnippetsGeneratorContext({ ir, config })); } - public async generate( - request: FernIr.dynamic.EndpointSnippetRequest - ): Promise { - const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); - if (endpoints.length === 0) { - throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); - } - const result = new Result(); - for (const endpoint of endpoints) { - const context = this.context.clone(); - const snippetGenerator = new EndpointSnippetGenerator({ - context - }); - try { - const snippet = await snippetGenerator.generateSnippet({ endpoint, request }); - if (context.errors.empty()) { - return { - snippet, - errors: undefined - }; - } - result.update({ context, snippet }); - } catch (error) { - if (result.err == null) { - result.err = error as Error; - } - } - } - return result.getResponseOrThrow({ endpoint: request.endpoint }); - } - - public generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse { - const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint); - if (endpoints.length === 0) { - throw new Error(`No endpoints found that match "${request.endpoint.method} ${request.endpoint.path}"`); - } - const result = new Result(); - for (const endpoint of endpoints) { - const context = this.context.clone(); - const snippetGenerator = new EndpointSnippetGenerator({ - context - }); - try { - const snippet = snippetGenerator.generateSnippetSync({ endpoint, request }); - if (context.errors.empty()) { - return { - snippet, - errors: undefined - }; - } - result.update({ context, snippet }); - } catch (error) { - if (result.err == null) { - result.err = error as Error; - } - } - } - return result.getResponseOrThrow({ endpoint: request.endpoint }); + protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator { + return new EndpointSnippetGenerator({ context }); } } diff --git a/package-yml.schema.json b/package-yml.schema.json index b3c06f2f1d4..15c106ac9fc 100644 --- a/package-yml.schema.json +++ b/package-yml.schema.json @@ -1747,7 +1747,14 @@ ], "additionalProperties": false }, - "service.TypeReferenceDeclarationWithContentTypeSchema": { + "service.FormDataBodyEncodingStyle": { + "type": "string", + "enum": [ + "json", + "exploded" + ] + }, + "service.HttpInlineFileRequestBodyPropertySchema": { "type": "object", "properties": { "type": { @@ -1833,6 +1840,16 @@ } ] }, + "style": { + "oneOf": [ + { + "$ref": "#/definitions/service.FormDataBodyEncodingStyle" + }, + { + "type": "null" + } + ] + }, "content-type": { "oneOf": [ { @@ -1855,7 +1872,7 @@ "type": "string" }, { - "$ref": "#/definitions/service.TypeReferenceDeclarationWithContentTypeSchema" + "$ref": "#/definitions/service.HttpInlineFileRequestBodyPropertySchema" } ] }, diff --git a/packages/cli/api-importers/openapi/openapi-ir-parser/src/openapi/v3/converters/endpoint/convertRequest.ts b/packages/cli/api-importers/openapi/openapi-ir-parser/src/openapi/v3/converters/endpoint/convertRequest.ts index 37b3ebb3208..a1d5db2f26c 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-parser/src/openapi/v3/converters/endpoint/convertRequest.ts +++ b/packages/cli/api-importers/openapi/openapi-ir-parser/src/openapi/v3/converters/endpoint/convertRequest.ts @@ -144,7 +144,8 @@ export function convertRequest({ schema: MultipartSchema.file({ isOptional: false, isArray: false }), description: property.schema.description, contentType: - multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined + multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined, + exploded: false }); continue; } @@ -160,7 +161,8 @@ export function convertRequest({ schema: MultipartSchema.file({ isOptional: true, isArray: false }), description: property.schema.description, contentType: - multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined + multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined, + exploded: false }); continue; } @@ -176,7 +178,8 @@ export function convertRequest({ schema: MultipartSchema.file({ isOptional: false, isArray: true }), description: property.schema.description, contentType: - multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined + multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined, + exploded: false }); continue; } @@ -193,7 +196,8 @@ export function convertRequest({ schema: MultipartSchema.file({ isOptional: true, isArray: true }), description: property.schema.description, contentType: - multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined + multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined, + exploded: false }); continue; } @@ -202,7 +206,8 @@ export function convertRequest({ key: property.key, schema: MultipartSchema.json(property.schema), description: undefined, - contentType: multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined + contentType: multipartEncoding != null ? multipartEncoding[property.key]?.contentType : undefined, + exploded: multipartEncoding != null ? multipartEncoding[property.key]?.explode : undefined }); } } diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-docs/file-upload.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-docs/file-upload.json index e5e600efba6..9b17a33364e 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-docs/file-upload.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-docs/file-upload.json @@ -24,6 +24,10 @@ "request": { "body": { "properties": { + "data": { + "style": "exploded", + "type": "optional", + }, "file": { "content-type": "application/octet-stream", "docs": "The file to upload", @@ -52,6 +56,18 @@ "openapi": "../openapi.yml", }, }, + "types": { + "UploadFileRequestData": { + "docs": undefined, + "inline": true, + "properties": { + "datum": "optional", + }, + "source": { + "openapi": "../openapi.yml", + }, + }, + }, }, "rawContents": "service: auth: false @@ -77,11 +93,21 @@ type: optional> docs: This is a metadata field content-type: application/json + data: + type: optional + style: exploded content-type: multipart/form-data examples: - request: {} source: openapi: ../openapi.yml +types: + UploadFileRequestData: + properties: + datum: optional + source: + openapi: ../openapi.yml + inline: true ", }, }, diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir-in-memory/file-upload.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir-in-memory/file-upload.json index 4d0338bef7b..b1fc5823fba 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir-in-memory/file-upload.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir-in-memory/file-upload.json @@ -60,6 +60,14 @@ "metadata": { "type": "object", "description": "This is a metadata field" + }, + "data": { + "type": "object", + "properties": { + "datum": { + "type": "string" + } + } } }, "required": [ @@ -72,6 +80,9 @@ }, "metadata": { "contentType": "application/json" + }, + "data": { + "explode": true } } } diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/content-type.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/content-type.json index 16d17ef060b..3a2909b70ce 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/content-type.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/content-type.json @@ -108,7 +108,8 @@ "type": "file" }, "description": "Binary file contents. The file name of the file will be used as the document ID.", - "contentType": "application/octet-stream, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.oasis.opendocument.text, application/epub+zip, application/rtf, text/html, text/plain, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, text/markdown" + "contentType": "application/octet-stream, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.oasis.opendocument.text, application/epub+zip, application/rtf, text/html, text/plain, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, text/markdown", + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/deel.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/deel.json index 866e373e97f..01b83dcdfa0 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/deel.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/deel.json @@ -7687,7 +7687,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -7991,7 +7992,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/file-upload.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/file-upload.json index 0344fa3f16a..1bfd192cb59 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/file-upload.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/file-upload.json @@ -24,7 +24,8 @@ "isArray": false, "type": "file" }, - "description": "The file to upload" + "description": "The file to upload", + "exploded": false }, { "key": "maybe_file", @@ -32,7 +33,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -83,7 +85,8 @@ "type": "file" }, "description": "The file to upload", - "contentType": "application/octet-stream" + "contentType": "application/octet-stream", + "exploded": false }, { "key": "maybe_file", @@ -91,7 +94,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false }, { "key": "metadata", @@ -122,6 +126,52 @@ "type": "json" }, "contentType": "application/json" + }, + { + "key": "data", + "schema": { + "value": { + "generatedName": "uploadFileRequestData", + "value": { + "properties": [ + { + "key": "datum", + "schema": { + "generatedName": "uploadFileRequestDataDatum", + "value": { + "generatedName": "UploadFileRequestDataDatum", + "schema": { + "type": "string" + }, + "groupName": [], + "type": "primitive" + }, + "groupName": [], + "type": "optional" + }, + "audiences": [], + "conflict": {}, + "generatedName": "uploadFileRequestDataDatum" + } + ], + "generatedName": "UploadFileRequestData", + "allOf": [], + "allOfPropertyConflicts": [], + "groupName": [], + "fullExamples": [], + "additionalProperties": false, + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "object" + }, + "groupName": [], + "type": "optional" + }, + "type": "json" + }, + "exploded": true } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/hathora.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/hathora.json index f887a59e4d5..b0e875687f6 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/hathora.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/hathora.json @@ -2276,7 +2276,8 @@ "isOptional": false, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/ntropy.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/ntropy.json index cc3e4f0c005..54080c8437a 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/ntropy.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/ntropy.json @@ -3399,7 +3399,8 @@ "isOptional": false, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/rightbrain.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/rightbrain.json index d1d99ed206c..f41158a9a10 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/rightbrain.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/rightbrain.json @@ -4148,7 +4148,8 @@ "isOptional": false, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -4644,7 +4645,8 @@ "isOptional": false, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -6596,7 +6598,8 @@ "isOptional": false, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -14085,7 +14088,8 @@ "isOptional": true, "isArray": true, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -14417,7 +14421,8 @@ "isOptional": true, "isArray": true, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -47665,7 +47670,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/squidex.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/squidex.json index 8d0b59d7b4f..6c0145cab48 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/squidex.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/squidex.json @@ -54885,7 +54885,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -56296,7 +56297,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -57773,7 +57775,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { @@ -61930,7 +61933,8 @@ "isOptional": true, "isArray": false, "type": "file" - } + }, + "exploded": false } ], "source": { diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/uploadcare.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/uploadcare.json index ab40aceaf47..08ee0b057ee 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/uploadcare.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/uploadcare.json @@ -93,7 +93,8 @@ "isArray": true, "type": "file" }, - "description": "File's content" + "description": "File's content", + "exploded": false }, { "key": "metadata[{key}]", diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/vellum.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/vellum.json index 1bb192908c1..15bfd9c282e 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/vellum.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/vellum.json @@ -4178,7 +4178,8 @@ "isArray": false, "type": "file" }, - "description": "The file contents of the document." + "description": "The file contents of the document.", + "exploded": false }, { "key": "keywords", diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/file-upload.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/file-upload.json index e5e600efba6..9b17a33364e 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/file-upload.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/file-upload.json @@ -24,6 +24,10 @@ "request": { "body": { "properties": { + "data": { + "style": "exploded", + "type": "optional", + }, "file": { "content-type": "application/octet-stream", "docs": "The file to upload", @@ -52,6 +56,18 @@ "openapi": "../openapi.yml", }, }, + "types": { + "UploadFileRequestData": { + "docs": undefined, + "inline": true, + "properties": { + "datum": "optional", + }, + "source": { + "openapi": "../openapi.yml", + }, + }, + }, }, "rawContents": "service: auth: false @@ -77,11 +93,21 @@ type: optional> docs: This is a metadata field content-type: application/json + data: + type: optional + style: exploded content-type: multipart/form-data examples: - request: {} source: openapi: ../openapi.yml +types: + UploadFileRequestData: + properties: + datum: optional + source: + openapi: ../openapi.yml + inline: true ", }, }, diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/file-upload/openapi.yml b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/file-upload/openapi.yml index dfdcbb5d284..16c34c707ad 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/file-upload/openapi.yml +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/file-upload/openapi.yml @@ -43,10 +43,17 @@ paths: metadata: type: object description: This is a metadata field + data: + type: object + properties: + datum: + type: string required: [file] encoding: file: contentType: "application/octet-stream" metadata: contentType: "application/json" + data: + explode: true diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern/src/buildEndpoint.ts b/packages/cli/api-importers/openapi/openapi-ir-to-fern/src/buildEndpoint.ts index 3a5a3a9e36d..24a4a4bcb62 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern/src/buildEndpoint.ts +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern/src/buildEndpoint.ts @@ -606,15 +606,22 @@ function getRequest({ namespace, declarationDepth: 1 // 1 level deep for request body properties }); - if (property.contentType != null) { - if (typeof propertyTypeReference === "string") { - propertyTypeReference = { - type: propertyTypeReference, - "content-type": property.contentType - }; - } else { - propertyTypeReference["content-type"] = property.contentType; + + if (property.contentType != null || property.exploded) { + const propertySchema: RawSchemas.HttpInlineRequestBodyPropertySchema = + typeof propertyTypeReference === "string" + ? { type: propertyTypeReference } + : propertyTypeReference; + + if (property.contentType != null) { + propertySchema["content-type"] = property.contentType; } + + if (property.exploded) { + propertySchema.style = "exploded"; + } + + propertyTypeReference = propertySchema; } return [property.key, propertyTypeReference]; } diff --git a/packages/cli/api-importers/openapi/openapi-ir/fern/definition/finalIr.yml b/packages/cli/api-importers/openapi/openapi-ir/fern/definition/finalIr.yml index 44c13c8b225..709cfaf3c9d 100644 --- a/packages/cli/api-importers/openapi/openapi-ir/fern/definition/finalIr.yml +++ b/packages/cli/api-importers/openapi/openapi-ir/fern/definition/finalIr.yml @@ -424,6 +424,7 @@ types: key: string schema: MultipartSchema contentType: optional + exploded: optional FileSchema: properties: diff --git a/packages/cli/api-importers/openapi/openapi-ir/src/sdk/api/resources/finalIr/types/MultipartRequestProperty.ts b/packages/cli/api-importers/openapi/openapi-ir/src/sdk/api/resources/finalIr/types/MultipartRequestProperty.ts index d5a97dbe2cd..052c0d2477e 100644 --- a/packages/cli/api-importers/openapi/openapi-ir/src/sdk/api/resources/finalIr/types/MultipartRequestProperty.ts +++ b/packages/cli/api-importers/openapi/openapi-ir/src/sdk/api/resources/finalIr/types/MultipartRequestProperty.ts @@ -8,4 +8,5 @@ export interface MultipartRequestProperty extends FernOpenapiIr.WithDescription key: string; schema: FernOpenapiIr.MultipartSchema; contentType: string | undefined; + exploded: boolean | undefined; } diff --git a/packages/cli/api-importers/openapi/openapi-ir/src/sdk/serialization/resources/finalIr/types/MultipartRequestProperty.ts b/packages/cli/api-importers/openapi/openapi-ir/src/sdk/serialization/resources/finalIr/types/MultipartRequestProperty.ts index 8d2349c3a86..9427cb15876 100644 --- a/packages/cli/api-importers/openapi/openapi-ir/src/sdk/serialization/resources/finalIr/types/MultipartRequestProperty.ts +++ b/packages/cli/api-importers/openapi/openapi-ir/src/sdk/serialization/resources/finalIr/types/MultipartRequestProperty.ts @@ -16,6 +16,7 @@ export const MultipartRequestProperty: core.serialization.ObjectSchema< key: core.serialization.string(), schema: MultipartSchema, contentType: core.serialization.string().optional(), + exploded: core.serialization.boolean().optional(), }) .extend(WithDescription); @@ -24,5 +25,6 @@ export declare namespace MultipartRequestProperty { key: string; schema: MultipartSchema.Raw; contentType?: string | null; + exploded?: boolean | null; } } diff --git a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap index dff1adce2b7..0a2f58c70d8 100644 --- a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap @@ -4,7 +4,7 @@ exports[`ir > {"name":"auth-header-prefix"} 1`] = `"{"fdrApiDefinitionId":null," exports[`ir > {"name":"extended-examples"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"api","camelCase":{"unsafeName":"api","safeName":"api"},"snakeCase":{"unsafeName":"api","safeName":"api"},"screamingSnakeCase":{"unsafeName":"API","safeName":"API"},"pascalCase":{"unsafeName":"Api","safeName":"Api"}},"apiDisplayName":"API","apiDocs":null,"auth":{"requirement":"ALL","schemes":[{"_type":"bearer","token":{"originalName":"token","camelCase":{"unsafeName":"token","safeName":"token"},"snakeCase":{"unsafeName":"token","safeName":"token"},"screamingSnakeCase":{"unsafeName":"TOKEN","safeName":"TOKEN"},"pascalCase":{"unsafeName":"Token","safeName":"Token"}},"tokenEnvVar":null,"docs":null}],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_app:GetAppResponse":{"inline":null,"name":{"name":{"originalName":"GetAppResponse","camelCase":{"unsafeName":"getAppResponse","safeName":"getAppResponse"},"snakeCase":{"unsafeName":"get_app_response","safeName":"get_app_response"},"screamingSnakeCase":{"unsafeName":"GET_APP_RESPONSE","safeName":"GET_APP_RESPONSE"},"pascalCase":{"unsafeName":"GetAppResponse","safeName":"GetAppResponse"}},"fernFilepath":{"allParts":[{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}],"packagePath":[],"file":{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}},"typeId":"type_app:GetAppResponse"},"shape":{"_type":"object","extends":[{"name":{"originalName":"Deployment","camelCase":{"unsafeName":"deployment","safeName":"deployment"},"snakeCase":{"unsafeName":"deployment","safeName":"deployment"},"screamingSnakeCase":{"unsafeName":"DEPLOYMENT","safeName":"DEPLOYMENT"},"pascalCase":{"unsafeName":"Deployment","safeName":"Deployment"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:Deployment"}],"properties":[{"name":{"name":{"originalName":"property","camelCase":{"unsafeName":"property","safeName":"property"},"snakeCase":{"unsafeName":"property","safeName":"property"},"screamingSnakeCase":{"unsafeName":"PROPERTY","safeName":"PROPERTY"},"pascalCase":{"unsafeName":"Property","safeName":"Property"}},"wireValue":"property"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[{"name":{"name":{"originalName":"appId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"wireValue":"appId"},"valueType":{"_type":"named","name":{"originalName":"AppId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:AppId","default":null,"inline":null},"availability":null,"docs":null}]},"referencedTypes":["type_commons:Deployment","type_commons:AppId"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"Example","camelCase":{"unsafeName":"example","safeName":"example"},"snakeCase":{"unsafeName":"example","safeName":"example"},"screamingSnakeCase":{"unsafeName":"EXAMPLE","safeName":"EXAMPLE"},"pascalCase":{"unsafeName":"Example","safeName":"Example"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"appId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"wireValue":"appId"},"value":{"shape":{"type":"named","typeName":{"typeId":"type_commons:AppId","fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"name":{"originalName":"AppId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}}},"shape":{"type":"alias","value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"your-app-id"}}},"jsonExample":"your-app-id"}}},"jsonExample":"your-app-id"},"originalTypeDeclaration":{"name":{"originalName":"Deployment","camelCase":{"unsafeName":"deployment","safeName":"deployment"},"snakeCase":{"unsafeName":"deployment","safeName":"deployment"},"screamingSnakeCase":{"unsafeName":"DEPLOYMENT","safeName":"DEPLOYMENT"},"pascalCase":{"unsafeName":"Deployment","safeName":"Deployment"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:Deployment"}},{"name":{"name":{"originalName":"property","camelCase":{"unsafeName":"property","safeName":"property"},"snakeCase":{"unsafeName":"property","safeName":"property"},"screamingSnakeCase":{"unsafeName":"PROPERTY","safeName":"PROPERTY"},"pascalCase":{"unsafeName":"Property","safeName":"Property"}},"wireValue":"property"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"app-secret"}}},"jsonExample":"app-secret"},"originalTypeDeclaration":{"name":{"originalName":"GetAppResponse","camelCase":{"unsafeName":"getAppResponse","safeName":"getAppResponse"},"snakeCase":{"unsafeName":"get_app_response","safeName":"get_app_response"},"screamingSnakeCase":{"unsafeName":"GET_APP_RESPONSE","safeName":"GET_APP_RESPONSE"},"pascalCase":{"unsafeName":"GetAppResponse","safeName":"GetAppResponse"}},"fernFilepath":{"allParts":[{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}],"packagePath":[],"file":{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}},"typeId":"type_app:GetAppResponse"}}]},"jsonExample":{"appId":"your-app-id","property":"app-secret"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_commons:AppId":{"inline":null,"name":{"name":{"originalName":"AppId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:AppId"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"Example","camelCase":{"unsafeName":"example","safeName":"example"},"snakeCase":{"unsafeName":"example","safeName":"example"},"screamingSnakeCase":{"unsafeName":"EXAMPLE","safeName":"EXAMPLE"},"pascalCase":{"unsafeName":"Example","safeName":"Example"}},"shape":{"type":"alias","value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"your-app-id"}}},"jsonExample":"your-app-id"}},"jsonExample":"your-app-id","docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_commons:Deployment":{"inline":null,"name":{"name":{"originalName":"Deployment","camelCase":{"unsafeName":"deployment","safeName":"deployment"},"snakeCase":{"unsafeName":"deployment","safeName":"deployment"},"screamingSnakeCase":{"unsafeName":"DEPLOYMENT","safeName":"DEPLOYMENT"},"pascalCase":{"unsafeName":"Deployment","safeName":"Deployment"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:Deployment"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"appId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"wireValue":"appId"},"valueType":{"_type":"named","name":{"originalName":"AppId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"typeId":"type_commons:AppId","default":null,"inline":null},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":["type_commons:AppId"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":["type_app:GetAppResponse","type_commons:AppId","type_commons:Deployment"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"dynamic":{"version":"1.0.0","types":{"type_app:GetAppResponse":{"type":"object","declaration":{"name":{"originalName":"GetAppResponse","camelCase":{"unsafeName":"getAppResponse","safeName":"getAppResponse"},"snakeCase":{"unsafeName":"get_app_response","safeName":"get_app_response"},"screamingSnakeCase":{"unsafeName":"GET_APP_RESPONSE","safeName":"GET_APP_RESPONSE"},"pascalCase":{"unsafeName":"GetAppResponse","safeName":"GetAppResponse"}},"fernFilepath":{"allParts":[{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}],"packagePath":[],"file":{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}}},"properties":[{"name":{"name":{"originalName":"appId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"wireValue":"appId"},"typeReference":{"type":"named","value":"type_commons:AppId"}},{"name":{"name":{"originalName":"property","camelCase":{"unsafeName":"property","safeName":"property"},"snakeCase":{"unsafeName":"property","safeName":"property"},"screamingSnakeCase":{"unsafeName":"PROPERTY","safeName":"PROPERTY"},"pascalCase":{"unsafeName":"Property","safeName":"Property"}},"wireValue":"property"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_commons:AppId":{"type":"alias","declaration":{"name":{"originalName":"AppId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}}},"typeReference":{"type":"primitive","value":"STRING"}},"type_commons:Deployment":{"type":"object","declaration":{"name":{"originalName":"Deployment","camelCase":{"unsafeName":"deployment","safeName":"deployment"},"snakeCase":{"unsafeName":"deployment","safeName":"deployment"},"screamingSnakeCase":{"unsafeName":"DEPLOYMENT","safeName":"DEPLOYMENT"},"pascalCase":{"unsafeName":"Deployment","safeName":"Deployment"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}}},"properties":[{"name":{"name":{"originalName":"appId","camelCase":{"unsafeName":"appId","safeName":"appId"},"snakeCase":{"unsafeName":"app_id","safeName":"app_id"},"screamingSnakeCase":{"unsafeName":"APP_ID","safeName":"APP_ID"},"pascalCase":{"unsafeName":"AppId","safeName":"AppId"}},"wireValue":"appId"},"typeReference":{"type":"named","value":"type_commons:AppId"}}]}},"headers":[],"endpoints":{},"environments":null},"subpackages":{"subpackage_app":{"name":{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}},"fernFilepath":{"allParts":[{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}],"packagePath":[],"file":{"originalName":"app","camelCase":{"unsafeName":"app","safeName":"app"},"snakeCase":{"unsafeName":"app","safeName":"app"},"screamingSnakeCase":{"unsafeName":"APP","safeName":"APP"},"pascalCase":{"unsafeName":"App","safeName":"App"}}},"service":null,"types":["type_app:GetAppResponse"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null},"subpackage_commons":{"name":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}},"fernFilepath":{"allParts":[{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}],"packagePath":[],"file":{"originalName":"commons","camelCase":{"unsafeName":"commons","safeName":"commons"},"snakeCase":{"unsafeName":"commons","safeName":"commons"},"screamingSnakeCase":{"unsafeName":"COMMONS","safeName":"COMMONS"},"pascalCase":{"unsafeName":"Commons","safeName":"Commons"}}},"service":null,"types":["type_commons:AppId","type_commons:Deployment"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_app","subpackage_commons"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":false,"docs":null},"sdkConfig":{"isAuthMandatory":true,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; -exports[`ir > {"name":"file-upload"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"my-api","camelCase":{"unsafeName":"myApi","safeName":"myApi"},"snakeCase":{"unsafeName":"my_api","safeName":"my_api"},"screamingSnakeCase":{"unsafeName":"MY_API","safeName":"MY_API"},"pascalCase":{"unsafeName":"MyApi","safeName":"MyApi"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{},"errors":{},"services":{"service_file-upload":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"displayName":null,"basePath":{"head":"/movies","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_file-upload.fileUpload","name":{"originalName":"fileUpload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"POST","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"/movies","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":{"type":"fileUpload","name":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"properties":[{"type":"bodyProperty","contentType":null,"name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null},{"type":"file","value":{"type":"file","key":{"name":{"originalName":"file","camelCase":{"unsafeName":"file","safeName":"file"},"snakeCase":{"unsafeName":"file","safeName":"file"},"screamingSnakeCase":{"unsafeName":"FILE","safeName":"FILE"},"pascalCase":{"unsafeName":"File","safeName":"File"}},"wireValue":"file"},"isOptional":false,"contentType":null}},{"type":"file","value":{"type":"file","key":{"name":{"originalName":"optionalFile","camelCase":{"unsafeName":"optionalFile","safeName":"optionalFile"},"snakeCase":{"unsafeName":"optional_file","safeName":"optional_file"},"screamingSnakeCase":{"unsafeName":"OPTIONAL_FILE","safeName":"OPTIONAL_FILE"},"pascalCase":{"unsafeName":"OptionalFile","safeName":"OptionalFile"}},"wireValue":"optionalFile"},"isOptional":true,"contentType":null}},{"type":"bodyProperty","contentType":null,"name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"valueType":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}},"availability":null,"docs":null}],"docs":null},"sdkRequest":{"shape":{"type":"wrapper","wrapperName":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"bodyKey":{"originalName":"body","camelCase":{"unsafeName":"body","safeName":"body"},"snakeCase":{"unsafeName":"body","safeName":"body"},"screamingSnakeCase":{"unsafeName":"BODY","safeName":"BODY"},"pascalCase":{"unsafeName":"Body","safeName":"Body"}},"includePathParameters":false,"onlyPathParameters":false},"requestParameterName":{"originalName":"request","camelCase":{"unsafeName":"request","safeName":"request"},"snakeCase":{"unsafeName":"request","safeName":"request"},"screamingSnakeCase":{"unsafeName":"REQUEST","safeName":"REQUEST"},"pascalCase":{"unsafeName":"Request","safeName":"Request"}},"streamParameter":null},"response":{"body":null,"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[],"pagination":null,"transport":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":[]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"dynamic":{"version":"1.0.0","types":{},"headers":[],"endpoints":{"endpoint_file-upload.fileUpload":{"auth":null,"declaration":{"name":{"originalName":"fileUpload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"location":{"method":"POST","path":"/movies"},"request":{"type":"inlined","declaration":{"name":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"pathParameters":[],"queryParameters":[],"headers":[],"body":{"type":"fileUpload","properties":[{"type":"bodyProperty","name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"typeReference":{"type":"primitive","value":"STRING"}},{"type":"file","name":{"originalName":"file","camelCase":{"unsafeName":"file","safeName":"file"},"snakeCase":{"unsafeName":"file","safeName":"file"},"screamingSnakeCase":{"unsafeName":"FILE","safeName":"FILE"},"pascalCase":{"unsafeName":"File","safeName":"File"}},"wireValue":"file"},{"type":"file","name":{"originalName":"optionalFile","camelCase":{"unsafeName":"optionalFile","safeName":"optionalFile"},"snakeCase":{"unsafeName":"optional_file","safeName":"optional_file"},"screamingSnakeCase":{"unsafeName":"OPTIONAL_FILE","safeName":"OPTIONAL_FILE"},"pascalCase":{"unsafeName":"OptionalFile","safeName":"OptionalFile"}},"wireValue":"optionalFile"},{"type":"bodyProperty","name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"typeReference":{"type":"primitive","value":"INTEGER"}}]},"metadata":{"includePathParameters":false,"onlyPathParameters":false}},"response":{"type":"json"}}},"environments":null},"subpackages":{"subpackage_file-upload":{"name":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}},"service":"service_file-upload","types":[],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_file-upload"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; +exports[`ir > {"name":"file-upload"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"my-api","camelCase":{"unsafeName":"myApi","safeName":"myApi"},"snakeCase":{"unsafeName":"my_api","safeName":"my_api"},"screamingSnakeCase":{"unsafeName":"MY_API","safeName":"MY_API"},"pascalCase":{"unsafeName":"MyApi","safeName":"MyApi"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{},"errors":{},"services":{"service_file-upload":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"displayName":null,"basePath":{"head":"/movies","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_file-upload.fileUpload","name":{"originalName":"fileUpload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"POST","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"/movies","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":{"type":"fileUpload","name":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"properties":[{"type":"bodyProperty","style":null,"contentType":null,"name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null},{"type":"file","value":{"type":"file","key":{"name":{"originalName":"file","camelCase":{"unsafeName":"file","safeName":"file"},"snakeCase":{"unsafeName":"file","safeName":"file"},"screamingSnakeCase":{"unsafeName":"FILE","safeName":"FILE"},"pascalCase":{"unsafeName":"File","safeName":"File"}},"wireValue":"file"},"isOptional":false,"contentType":null}},{"type":"file","value":{"type":"file","key":{"name":{"originalName":"optionalFile","camelCase":{"unsafeName":"optionalFile","safeName":"optionalFile"},"snakeCase":{"unsafeName":"optional_file","safeName":"optional_file"},"screamingSnakeCase":{"unsafeName":"OPTIONAL_FILE","safeName":"OPTIONAL_FILE"},"pascalCase":{"unsafeName":"OptionalFile","safeName":"OptionalFile"}},"wireValue":"optionalFile"},"isOptional":true,"contentType":null}},{"type":"bodyProperty","style":null,"contentType":null,"name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"valueType":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}},"availability":null,"docs":null}],"docs":null},"sdkRequest":{"shape":{"type":"wrapper","wrapperName":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"bodyKey":{"originalName":"body","camelCase":{"unsafeName":"body","safeName":"body"},"snakeCase":{"unsafeName":"body","safeName":"body"},"screamingSnakeCase":{"unsafeName":"BODY","safeName":"BODY"},"pascalCase":{"unsafeName":"Body","safeName":"Body"}},"includePathParameters":false,"onlyPathParameters":false},"requestParameterName":{"originalName":"request","camelCase":{"unsafeName":"request","safeName":"request"},"snakeCase":{"unsafeName":"request","safeName":"request"},"screamingSnakeCase":{"unsafeName":"REQUEST","safeName":"REQUEST"},"pascalCase":{"unsafeName":"Request","safeName":"Request"}},"streamParameter":null},"response":{"body":null,"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[],"pagination":null,"transport":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":[]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"dynamic":{"version":"1.0.0","types":{},"headers":[],"endpoints":{"endpoint_file-upload.fileUpload":{"auth":null,"declaration":{"name":{"originalName":"fileUpload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"location":{"method":"POST","path":"/movies"},"request":{"type":"inlined","declaration":{"name":{"originalName":"FileUploadRequest","camelCase":{"unsafeName":"fileUploadRequest","safeName":"fileUploadRequest"},"snakeCase":{"unsafeName":"file_upload_request","safeName":"file_upload_request"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD_REQUEST","safeName":"FILE_UPLOAD_REQUEST"},"pascalCase":{"unsafeName":"FileUploadRequest","safeName":"FileUploadRequest"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}}},"pathParameters":[],"queryParameters":[],"headers":[],"body":{"type":"fileUpload","properties":[{"type":"bodyProperty","name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"typeReference":{"type":"primitive","value":"STRING"}},{"type":"file","name":{"originalName":"file","camelCase":{"unsafeName":"file","safeName":"file"},"snakeCase":{"unsafeName":"file","safeName":"file"},"screamingSnakeCase":{"unsafeName":"FILE","safeName":"FILE"},"pascalCase":{"unsafeName":"File","safeName":"File"}},"wireValue":"file"},{"type":"file","name":{"originalName":"optionalFile","camelCase":{"unsafeName":"optionalFile","safeName":"optionalFile"},"snakeCase":{"unsafeName":"optional_file","safeName":"optional_file"},"screamingSnakeCase":{"unsafeName":"OPTIONAL_FILE","safeName":"OPTIONAL_FILE"},"pascalCase":{"unsafeName":"OptionalFile","safeName":"OptionalFile"}},"wireValue":"optionalFile"},{"type":"bodyProperty","name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"typeReference":{"type":"primitive","value":"INTEGER"}}]},"metadata":{"includePathParameters":false,"onlyPathParameters":false}},"response":{"type":"json"}}},"environments":null},"subpackages":{"subpackage_file-upload":{"name":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}},"fernFilepath":{"allParts":[{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}],"packagePath":[],"file":{"originalName":"file-upload","camelCase":{"unsafeName":"fileUpload","safeName":"fileUpload"},"snakeCase":{"unsafeName":"file_upload","safeName":"file_upload"},"screamingSnakeCase":{"unsafeName":"FILE_UPLOAD","safeName":"FILE_UPLOAD"},"pascalCase":{"unsafeName":"FileUpload","safeName":"FileUpload"}}},"service":"service_file-upload","types":[],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_file-upload"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; exports[`ir > {"name":"migration","version":"v1"} 1`] = `"{"apiName":"my-api","auth":{"requirement":"ALL","schemes":[]},"headers":[{"name":{"originalValue":"apiVersion","camelCase":"apiVersion","pascalCase":"ApiVersion","snakeCase":"api_version","screamingSnakeCase":"API_VERSION","wireValue":"X-API-VERSION"},"nameV2":{"wireValue":"X-API-VERSION","name":{"safeName":{"originalValue":"apiVersion","camelCase":"apiVersion","pascalCase":"ApiVersion","snakeCase":"api_version","screamingSnakeCase":"API_VERSION"},"unsafeName":{"originalValue":"apiVersion","camelCase":"apiVersion","pascalCase":"ApiVersion","snakeCase":"api_version","screamingSnakeCase":"API_VERSION"}}},"valueType":{"container":{"optional":{"primitive":"STRING","_type":"primitive"},"_type":"optional"},"_type":"container"},"availability":{"status":"GENERAL_AVAILABILITY"}}],"types":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},"shape":{"extends":[],"properties":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"name","camelCase":"name","pascalCase":"Name","snakeCase":"name","screamingSnakeCase":"NAME","wireValue":"name"},"nameV2":{"wireValue":"name","name":{"safeName":{"originalValue":"name","camelCase":"name","pascalCase":"Name","snakeCase":"name","screamingSnakeCase":"NAME"},"unsafeName":{"originalValue":"name","camelCase":"name","pascalCase":"Name","snakeCase":"name","screamingSnakeCase":"NAME"}}},"valueType":{"primitive":"STRING","_type":"primitive"}},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE","wireValue":"age"},"nameV2":{"wireValue":"age","name":{"safeName":{"originalValue":"age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},"valueType":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}},"_type":"named"}}],"_type":"object"},"examples":[{"properties":[{"wireKey":"name","value":{"primitive":{"string":"George the Director","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}},{"wireKey":"age","value":{"typeName":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},"shape":{"value":{"primitive":{"integer":20,"type":"integer"},"type":"primitive"},"type":"alias"},"type":"named"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}}],"type":"object"}],"referencedTypes":[{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}}]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},"shape":{"aliasOf":{"primitive":"INTEGER","_type":"primitive"},"resolvedType":{"primitive":"INTEGER","_type":"primitive"},"_type":"alias"},"examples":[{"value":{"primitive":{"integer":20,"type":"integer"},"type":"primitive"},"type":"alias"}],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"LiteralString","nameV2":{"originalValue":"LiteralString","camelCase":"literalString","pascalCase":"LiteralString","snakeCase":"literal_string","screamingSnakeCase":"LITERAL_STRING"},"nameV3":{"safeName":{"originalValue":"LiteralString","camelCase":"literalString","pascalCase":"LiteralString","snakeCase":"literal_string","screamingSnakeCase":"LITERAL_STRING"},"unsafeName":{"originalValue":"LiteralString","camelCase":"literalString","pascalCase":"LiteralString","snakeCase":"literal_string","screamingSnakeCase":"LITERAL_STRING"}}},"shape":{"aliasOf":{"container":{"literal":{"string":"hello","type":"string"},"_type":"literal"},"_type":"container"},"resolvedType":{"container":{"literal":{"string":"hello","type":"string"},"_type":"literal"},"_type":"container"},"_type":"alias"},"examples":[],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CurrencyAmount","nameV2":{"originalValue":"CurrencyAmount","camelCase":"currencyAmount","pascalCase":"CurrencyAmount","snakeCase":"currency_amount","screamingSnakeCase":"CURRENCY_AMOUNT"},"nameV3":{"safeName":{"originalValue":"CurrencyAmount","camelCase":"currencyAmount","pascalCase":"CurrencyAmount","snakeCase":"currency_amount","screamingSnakeCase":"CURRENCY_AMOUNT"},"unsafeName":{"originalValue":"CurrencyAmount","camelCase":"currencyAmount","pascalCase":"CurrencyAmount","snakeCase":"currency_amount","screamingSnakeCase":"CURRENCY_AMOUNT"}}},"shape":{"aliasOf":{"primitive":"STRING","_type":"primitive"},"resolvedType":{"primitive":"STRING","_type":"primitive"},"_type":"alias"},"examples":[{"value":{"primitive":{"string":"$4.50","type":"string"},"type":"primitive"},"type":"alias"}],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}}},"shape":{"aliasOf":{"primitive":"STRING","_type":"primitive"},"resolvedType":{"primitive":"STRING","_type":"primitive"},"_type":"alias"},"examples":[{"value":{"primitive":{"string":"id1","type":"string"},"type":"primitive"},"type":"alias"},{"value":{"primitive":{"string":"id2","type":"string"},"type":"primitive"},"type":"alias"}],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"ActorId","nameV2":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"nameV3":{"safeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"unsafeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"}}},"shape":{"aliasOf":{"primitive":"STRING","_type":"primitive"},"resolvedType":{"primitive":"STRING","_type":"primitive"},"_type":"alias"},"examples":[],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}}},"shape":{"extends":[],"properties":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"id","camelCase":"id","pascalCase":"Id","snakeCase":"id","screamingSnakeCase":"ID","wireValue":"id"},"nameV2":{"wireValue":"id","name":{"safeName":{"originalValue":"id","camelCase":"id","pascalCase":"Id","snakeCase":"id","screamingSnakeCase":"ID"},"unsafeName":{"originalValue":"id","camelCase":"id","pascalCase":"Id","snakeCase":"id","screamingSnakeCase":"ID"}}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"_type":"named"}},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE","wireValue":"title"},"nameV2":{"wireValue":"title","name":{"safeName":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE"},"unsafeName":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE"}}},"valueType":{"primitive":"STRING","_type":"primitive"}},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"rating","camelCase":"rating","pascalCase":"Rating","snakeCase":"rating","screamingSnakeCase":"RATING","wireValue":"rating"},"nameV2":{"wireValue":"rating","name":{"safeName":{"originalValue":"rating","camelCase":"rating","pascalCase":"Rating","snakeCase":"rating","screamingSnakeCase":"RATING"},"unsafeName":{"originalValue":"rating","camelCase":"rating","pascalCase":"Rating","snakeCase":"rating","screamingSnakeCase":"RATING"}}},"valueType":{"primitive":"DOUBLE","_type":"primitive"}}],"_type":"object"},"examples":[{"properties":[{"wireKey":"id","value":{"typeName":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}}},"shape":{"value":{"primitive":{"string":"my-movie-id","type":"string"},"type":"primitive"},"type":"alias"},"type":"named"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}}}},{"wireKey":"title","value":{"primitive":{"string":"Goodwill Hunting","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}}}},{"wireKey":"rating","value":{"primitive":{"double":14.5,"type":"double"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}}}}],"type":"object"}],"referencedTypes":[{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}}}]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}},"shape":{"extends":[],"properties":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE","wireValue":"title"},"nameV2":{"wireValue":"title","name":{"safeName":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE"},"unsafeName":{"originalValue":"title","camelCase":"title","pascalCase":"Title","snakeCase":"title","screamingSnakeCase":"TITLE"}}},"valueType":{"primitive":"STRING","_type":"primitive"}},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"ratings","camelCase":"ratings","pascalCase":"Ratings","snakeCase":"ratings","screamingSnakeCase":"RATINGS","wireValue":"ratings"},"nameV2":{"wireValue":"ratings","name":{"safeName":{"originalValue":"ratings","camelCase":"ratings","pascalCase":"Ratings","snakeCase":"ratings","screamingSnakeCase":"RATINGS"},"unsafeName":{"originalValue":"ratings","camelCase":"ratings","pascalCase":"Ratings","snakeCase":"ratings","screamingSnakeCase":"RATINGS"}}},"valueType":{"container":{"list":{"primitive":"DOUBLE","_type":"primitive"},"_type":"list"},"_type":"container"}}],"_type":"object"},"examples":[{"properties":[{"wireKey":"title","value":{"primitive":{"string":"Winnie the Pooh","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"ratings","value":{"container":{"list":[{"primitive":{"double":1,"type":"double"},"type":"primitive"},{"primitive":{"double":2,"type":"double"},"type":"primitive"},{"primitive":{"double":3,"type":"double"},"type":"primitive"}],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}}],"type":"object"}],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"DirectorWrapper","nameV2":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"},"nameV3":{"safeName":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"},"unsafeName":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"}}},"shape":{"extends":[],"properties":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR","wireValue":"director"},"nameV2":{"wireValue":"director","name":{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},"valueType":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}},"_type":"named"}}],"_type":"object"},"examples":[{"properties":[{"wireKey":"director","value":{"typeName":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},"shape":{"properties":[{"wireKey":"name","value":{"primitive":{"string":"George the Director","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}},{"wireKey":"age","value":{"typeName":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},"shape":{"value":{"primitive":{"integer":20,"type":"integer"},"type":"primitive"},"type":"alias"},"type":"named"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}}],"type":"object"},"type":"named"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"DirectorWrapper","nameV2":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"},"nameV3":{"safeName":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"},"unsafeName":{"originalValue":"DirectorWrapper","camelCase":"directorWrapper","pascalCase":"DirectorWrapper","snakeCase":"director_wrapper","screamingSnakeCase":"DIRECTOR_WRAPPER"}}}}],"type":"object"}],"referencedTypes":[{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}}]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}}},"shape":{"extends":[],"properties":[],"_type":"object"},"examples":[],"referencedTypes":[]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Person","nameV2":{"originalValue":"Person","camelCase":"person","pascalCase":"Person","snakeCase":"person","screamingSnakeCase":"PERSON"},"nameV3":{"safeName":{"originalValue":"Person","camelCase":"person","pascalCase":"Person","snakeCase":"person","screamingSnakeCase":"PERSON"},"unsafeName":{"originalValue":"Person","camelCase":"person","pascalCase":"Person","snakeCase":"person","screamingSnakeCase":"PERSON"}}},"shape":{"discriminant":"type","discriminantV2":{"originalValue":"type","camelCase":"type","pascalCase":"Type","snakeCase":"type","screamingSnakeCase":"TYPE","wireValue":"type"},"discriminantV3":{"wireValue":"type","name":{"safeName":{"originalValue":"type","camelCase":"type","pascalCase":"Type","snakeCase":"type","screamingSnakeCase":"TYPE"},"unsafeName":{"originalValue":"type","camelCase":"type","pascalCase":"Type","snakeCase":"type","screamingSnakeCase":"TYPE"}}},"types":[{"discriminantValue":{"originalValue":"actor","camelCase":"actor","pascalCase":"Actor","snakeCase":"actor","screamingSnakeCase":"ACTOR","wireValue":"actor"},"discriminantValueV2":{"wireValue":"actor","name":{"safeName":{"originalValue":"actor","camelCase":"actor","pascalCase":"Actor","snakeCase":"actor","screamingSnakeCase":"ACTOR"},"unsafeName":{"originalValue":"actor","camelCase":"actor","pascalCase":"Actor","snakeCase":"actor","screamingSnakeCase":"ACTOR"}}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"ActorId","nameV2":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"nameV3":{"safeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"unsafeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"}},"_type":"named"},"shape":{"name":{"originalValue":"value","camelCase":"value","pascalCase":"Value","snakeCase":"value","screamingSnakeCase":"VALUE","wireValue":"value"},"nameV2":{"wireValue":"value","name":{"safeName":{"originalValue":"value","camelCase":"value","pascalCase":"Value","snakeCase":"value","screamingSnakeCase":"VALUE"},"unsafeName":{"originalValue":"value","camelCase":"value","pascalCase":"Value","snakeCase":"value","screamingSnakeCase":"VALUE"}}},"type":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"ActorId","nameV2":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"nameV3":{"safeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"unsafeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"}},"_type":"named"},"_type":"singleProperty"}},{"discriminantValue":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR","wireValue":"director"},"discriminantValueV2":{"wireValue":"director","name":{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},"valueType":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}},"_type":"named"},"shape":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}},"_type":"samePropertiesAsObject"}},{"discriminantValue":{"originalValue":"producer","camelCase":"producer","pascalCase":"Producer","snakeCase":"producer","screamingSnakeCase":"PRODUCER","wireValue":"producer"},"discriminantValueV2":{"wireValue":"producer","name":{"safeName":{"originalValue":"producer","camelCase":"producer","pascalCase":"Producer","snakeCase":"producer","screamingSnakeCase":"PRODUCER"},"unsafeName":{"originalValue":"producer","camelCase":"producer","pascalCase":"Producer","snakeCase":"producer","screamingSnakeCase":"PRODUCER"}}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}},"_type":"named"},"shape":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}},"_type":"samePropertiesAsObject"}},{"docs":"i am docs","discriminantValue":{"originalValue":"cinematographer","camelCase":"cinematographer","pascalCase":"Cinematographer","snakeCase":"cinematographer","screamingSnakeCase":"CINEMATOGRAPHER","wireValue":"cinematographer"},"discriminantValueV2":{"wireValue":"cinematographer","name":{"safeName":{"originalValue":"cinematographer","camelCase":"cinematographer","pascalCase":"Cinematographer","snakeCase":"cinematographer","screamingSnakeCase":"CINEMATOGRAPHER"},"unsafeName":{"originalValue":"cinematographer","camelCase":"cinematographer","pascalCase":"Cinematographer","snakeCase":"cinematographer","screamingSnakeCase":"CINEMATOGRAPHER"}}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}},"_type":"named"},"shape":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}},"_type":"samePropertiesAsObject"}}],"_type":"union"},"examples":[{"wireDiscriminantValue":"actor","properties":{"singleProperty":{"typeName":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"ActorId","nameV2":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"nameV3":{"safeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"unsafeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"}}},"shape":{"value":{"primitive":{"string":"Matt Damon","type":"string"},"type":"primitive"},"type":"alias"},"type":"named"},"type":"singleProperty"},"type":"union"},{"wireDiscriminantValue":"director","properties":{"typeName":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},"shape":{"properties":[{"wireKey":"name","value":{"primitive":{"string":"George the Directory","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}},{"wireKey":"age","value":{"typeName":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},"shape":{"value":{"primitive":{"integer":100,"type":"integer"},"type":"primitive"},"type":"alias"},"type":"named"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}}}],"type":"object"},"type":"samePropertiesAsObject"},"type":"union"},{"wireDiscriminantValue":"producer","properties":{"typeName":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}}},"shape":{"properties":[],"type":"object"},"type":"samePropertiesAsObject"},"type":"union"}],"referencedTypes":[{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"ActorId","nameV2":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"nameV3":{"safeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"},"unsafeName":{"originalValue":"ActorId","camelCase":"actorId","pascalCase":"ActorId","snakeCase":"actor_id","screamingSnakeCase":"ACTOR_ID"}}},{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Director","nameV2":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"nameV3":{"safeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"Director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}},{"fernFilepath":[{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}],"fernFilepathV2":[{"safeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"},"unsafeName":{"originalValue":"director","camelCase":"director","pascalCase":"Director","snakeCase":"director","screamingSnakeCase":"DIRECTOR"}}],"name":"Age","nameV2":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"nameV3":{"safeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"},"unsafeName":{"originalValue":"Age","camelCase":"age","pascalCase":"Age","snakeCase":"age","screamingSnakeCase":"AGE"}}},{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"EmptyObject","nameV2":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"nameV3":{"safeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"},"unsafeName":{"originalValue":"EmptyObject","camelCase":"emptyObject","pascalCase":"EmptyObject","snakeCase":"empty_object","screamingSnakeCase":"EMPTY_OBJECT"}}}]},{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}},"shape":{"extends":[{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}],"properties":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"selfReferencing","camelCase":"selfReferencing","pascalCase":"SelfReferencing","snakeCase":"self_referencing","screamingSnakeCase":"SELF_REFERENCING","wireValue":"selfReferencing"},"nameV2":{"wireValue":"selfReferencing","name":{"safeName":{"originalValue":"selfReferencing","camelCase":"selfReferencing","pascalCase":"SelfReferencing","snakeCase":"self_referencing","screamingSnakeCase":"SELF_REFERENCING"},"unsafeName":{"originalValue":"selfReferencing","camelCase":"selfReferencing","pascalCase":"SelfReferencing","snakeCase":"self_referencing","screamingSnakeCase":"SELF_REFERENCING"}}},"valueType":{"container":{"list":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}},"_type":"named"},"_type":"list"},"_type":"container"}}],"_type":"object"},"examples":[{"properties":[{"wireKey":"title","value":{"primitive":{"string":"The Godfather","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"ratings","value":{"container":{"list":[{"primitive":{"double":10,"type":"double"},"type":"primitive"},{"primitive":{"double":5,"type":"double"},"type":"primitive"},{"primitive":{"double":9,"type":"double"},"type":"primitive"}],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"selfReferencing","value":{"container":{"list":[{"typeName":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}},"shape":{"properties":[{"wireKey":"title","value":{"primitive":{"string":"The Godfather II","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"ratings","value":{"container":{"list":[{"primitive":{"double":10,"type":"double"},"type":"primitive"},{"primitive":{"double":11,"type":"double"},"type":"primitive"}],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"selfReferencing","value":{"container":{"list":[],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}}}],"type":"object"},"type":"named"},{"typeName":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}},"shape":{"properties":[{"wireKey":"title","value":{"primitive":{"string":"The Godfather III","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"ratings","value":{"container":{"list":[],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"selfReferencing","value":{"container":{"list":[],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}}}],"type":"object"},"type":"named"}],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}}}],"type":"object"},{"properties":[{"wireKey":"title","value":{"primitive":{"string":"Goodfellas","type":"string"},"type":"primitive"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"ratings","value":{"container":{"list":[{"primitive":{"double":1,"type":"double"},"type":"primitive"},{"primitive":{"double":2,"type":"double"},"type":"primitive"},{"primitive":{"double":3,"type":"double"},"type":"primitive"}],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}}},{"wireKey":"selfReferencing","value":{"container":{"list":[],"type":"list"},"type":"container"},"originalTypeDeclaration":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}}}],"type":"object"}],"referencedTypes":[{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}}},{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"RecursiveType","nameV2":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"nameV3":{"safeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"},"unsafeName":{"originalValue":"RecursiveType","camelCase":"recursiveType","pascalCase":"RecursiveType","snakeCase":"recursive_type","screamingSnakeCase":"RECURSIVE_TYPE"}}}]}],"services":{"websocket":[],"http":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"name":"ImdbService","fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}]},"basePath":"/movies","basePathV2":{"head":"/movies","parts":[]},"headers":[],"pathParameters":[],"endpoints":[{"availability":{"status":"GENERAL_AVAILABILITY"},"id":"createMovie","name":{"originalValue":"createMovie","camelCase":"createMovie","pascalCase":"CreateMovie","snakeCase":"create_movie","screamingSnakeCase":"CREATE_MOVIE"},"nameV2":{"safeName":{"originalValue":"createMovie","camelCase":"createMovie","pascalCase":"CreateMovie","snakeCase":"create_movie","screamingSnakeCase":"CREATE_MOVIE"},"unsafeName":{"originalValue":"createMovie","camelCase":"createMovie","pascalCase":"CreateMovie","snakeCase":"create_movie","screamingSnakeCase":"CREATE_MOVIE"}},"method":"POST","headers":[],"path":{"head":"","parts":[]},"pathParameters":[],"queryParameters":[],"request":{"type":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}},"_type":"named"},"typeV2":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"CreateMovieRequest","nameV2":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"nameV3":{"safeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"},"unsafeName":{"originalValue":"CreateMovieRequest","camelCase":"createMovieRequest","pascalCase":"CreateMovieRequest","snakeCase":"create_movie_request","screamingSnakeCase":"CREATE_MOVIE_REQUEST"}},"_type":"named"}},"response":{"type":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"_type":"named"},"typeV2":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"_type":"named"}},"errors":[{"error":{"name":"BadRequestError","nameV2":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"nameV3":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}},"fernFilepath":[{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}],"fernFilepathV2":[{"safeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"},"unsafeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}}]}}],"errorsV2":{"discriminant":{"originalValue":"errorName","camelCase":"errorName","snakeCase":"error_name","pascalCase":"ErrorName","screamingSnakeCase":"ERROR_NAME","wireValue":"errorName"},"types":[{"discriminantValue":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR","wireValue":"BadRequestError"},"shape":{"type":"noProperties"}}]},"auth":false},{"availability":{"status":"GENERAL_AVAILABILITY"},"id":"getMovie","name":{"originalValue":"getMovie","camelCase":"getMovie","pascalCase":"GetMovie","snakeCase":"get_movie","screamingSnakeCase":"GET_MOVIE"},"nameV2":{"safeName":{"originalValue":"getMovie","camelCase":"getMovie","pascalCase":"GetMovie","snakeCase":"get_movie","screamingSnakeCase":"GET_MOVIE"},"unsafeName":{"originalValue":"getMovie","camelCase":"getMovie","pascalCase":"GetMovie","snakeCase":"get_movie","screamingSnakeCase":"GET_MOVIE"}},"method":"GET","headers":[],"path":{"head":"/","parts":[{"pathParameter":"movieId","tail":""}]},"pathParameters":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV2":{"safeName":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"_type":"named"}}],"queryParameters":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"movieName","camelCase":"movieName","pascalCase":"MovieName","snakeCase":"movie_name","screamingSnakeCase":"MOVIE_NAME","wireValue":"movieName"},"nameV2":{"wireValue":"movieName","name":{"safeName":{"originalValue":"movieName","camelCase":"movieName","pascalCase":"MovieName","snakeCase":"movie_name","screamingSnakeCase":"MOVIE_NAME"},"unsafeName":{"originalValue":"movieName","camelCase":"movieName","pascalCase":"MovieName","snakeCase":"movie_name","screamingSnakeCase":"MOVIE_NAME"}}},"valueType":{"primitive":"STRING","_type":"primitive"},"allowMultiple":true}],"request":{"type":{"_type":"void"}},"response":{"type":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}},"_type":"named"},"typeV2":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"Movie","nameV2":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"nameV3":{"safeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"},"unsafeName":{"originalValue":"Movie","camelCase":"movie","pascalCase":"Movie","snakeCase":"movie","screamingSnakeCase":"MOVIE"}},"_type":"named"}},"errors":[{"error":{"name":"NotFoundError","nameV2":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"nameV3":{"safeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"unsafeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"}},"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}]}},{"error":{"name":"BadRequestError","nameV2":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"nameV3":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}},"fernFilepath":[{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}],"fernFilepathV2":[{"safeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"},"unsafeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}}]}}],"errorsV2":{"discriminant":{"originalValue":"errorName","camelCase":"errorName","snakeCase":"error_name","pascalCase":"ErrorName","screamingSnakeCase":"ERROR_NAME","wireValue":"errorName"},"types":[{"discriminantValue":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR","wireValue":"NotFoundError"},"shape":{"name":{"originalValue":"content","camelCase":"content","snakeCase":"content","pascalCase":"Content","screamingSnakeCase":"CONTENT","wireValue":"content"},"error":{"name":"NotFoundError","nameV2":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"nameV3":{"safeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"unsafeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"}},"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}]},"type":"singleProperty"}},{"discriminantValue":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR","wireValue":"BadRequestError"},"shape":{"type":"noProperties"}}]},"auth":false},{"availability":{"status":"GENERAL_AVAILABILITY"},"id":"delete","name":{"originalValue":"delete","camelCase":"delete","pascalCase":"Delete","snakeCase":"delete","screamingSnakeCase":"DELETE"},"nameV2":{"safeName":{"originalValue":"delete","camelCase":"delete","pascalCase":"Delete","snakeCase":"delete","screamingSnakeCase":"DELETE"},"unsafeName":{"originalValue":"delete","camelCase":"delete","pascalCase":"Delete","snakeCase":"delete","screamingSnakeCase":"DELETE"}},"method":"DELETE","headers":[],"path":{"head":"/","parts":[{"pathParameter":"movieId","tail":""}]},"pathParameters":[{"availability":{"status":"GENERAL_AVAILABILITY"},"name":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV2":{"safeName":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"movieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"valueType":{"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}],"name":"MovieId","nameV2":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"nameV3":{"safeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"},"unsafeName":{"originalValue":"MovieId","camelCase":"movieId","pascalCase":"MovieId","snakeCase":"movie_id","screamingSnakeCase":"MOVIE_ID"}},"_type":"named"}}],"queryParameters":[],"request":{"type":{"_type":"void"}},"response":{"type":{"_type":"void"}},"errors":[{"error":{"name":"BadRequestError","nameV2":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"nameV3":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}},"fernFilepath":[{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}],"fernFilepathV2":[{"safeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"},"unsafeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}}]}}],"errorsV2":{"discriminant":{"originalValue":"errorName","camelCase":"errorName","snakeCase":"error_name","pascalCase":"ErrorName","screamingSnakeCase":"ERROR_NAME","wireValue":"errorName"},"types":[{"discriminantValue":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR","wireValue":"BadRequestError"},"shape":{"type":"noProperties"}}]},"auth":false}]}]},"constants":{"errorDiscriminant":"_error","errorInstanceIdKey":"_errorInstanceId","unknownErrorDiscriminantValue":"_unknown"},"constantsV2":{"errors":{"errorInstanceIdKey":{"originalValue":"errorInstanceId","camelCase":"errorInstanceId","pascalCase":"ErrorInstanceId","snakeCase":"error_instance_id","screamingSnakeCase":"ERROR_INSTANCE_ID","wireValue":"errorInstanceId"},"errorDiscriminant":{"originalValue":"error","camelCase":"error","snakeCase":"error","pascalCase":"Error","screamingSnakeCase":"ERROR","wireValue":"error"},"errorContentKey":{"originalValue":"content","camelCase":"content","snakeCase":"content","pascalCase":"Content","screamingSnakeCase":"CONTENT","wireValue":"content"}},"errorsV2":{"errorInstanceIdKey":{"wireValue":"errorInstanceId","name":{"safeName":{"originalValue":"errorInstanceId","camelCase":"errorInstanceId","pascalCase":"ErrorInstanceId","snakeCase":"error_instance_id","screamingSnakeCase":"ERROR_INSTANCE_ID"},"unsafeName":{"originalValue":"errorInstanceId","camelCase":"errorInstanceId","pascalCase":"ErrorInstanceId","snakeCase":"error_instance_id","screamingSnakeCase":"ERROR_INSTANCE_ID"}}},"errorDiscriminant":{"name":{"unsafeName":{"originalValue":"error","camelCase":"error","snakeCase":"error","pascalCase":"Error","screamingSnakeCase":"ERROR"},"safeName":{"originalValue":"error","camelCase":"error","snakeCase":"error","pascalCase":"Error","screamingSnakeCase":"ERROR"}},"wireValue":"error"},"errorContentKey":{"name":{"unsafeName":{"originalValue":"content","camelCase":"content","snakeCase":"content","pascalCase":"Content","screamingSnakeCase":"CONTENT"},"safeName":{"originalValue":"content","camelCase":"content","snakeCase":"content","pascalCase":"Content","screamingSnakeCase":"CONTENT"}},"wireValue":"content"}}},"environments":[],"errorDiscriminant":{"safeName":{"originalValue":"error","camelCase":"error","pascalCase":"Error","snakeCase":"error","screamingSnakeCase":"ERROR"},"unsafeName":{"originalValue":"error","camelCase":"error","pascalCase":"Error","snakeCase":"error","screamingSnakeCase":"ERROR"}},"errorDiscriminationStrategy":{"discriminant":{"wireValue":"error","name":{"safeName":{"originalValue":"error","camelCase":"error","pascalCase":"Error","snakeCase":"error","screamingSnakeCase":"ERROR"},"unsafeName":{"originalValue":"error","camelCase":"error","pascalCase":"Error","snakeCase":"error","screamingSnakeCase":"ERROR"}}},"contentProperty":{"wireValue":"content","name":{"safeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"},"unsafeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"}}},"type":"property"},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version"}},"errors":[{"name":{"name":"BadRequestError","nameV2":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"nameV3":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}},"fernFilepath":[{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}],"fernFilepathV2":[{"safeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"},"unsafeName":{"originalValue":"commons","camelCase":"commons","pascalCase":"Commons","snakeCase":"commons","screamingSnakeCase":"COMMONS"}}]},"discriminantValue":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR","wireValue":"BadRequestError"},"discriminantValueV2":{"wireValue":"BadRequestError","name":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}}},"discriminantValueV3":{"wireValue":"content","name":{"safeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"},"unsafeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"}},"type":"property"},"discriminantValueV4":{"wireValue":"BadRequestError","name":{"safeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"},"unsafeName":{"originalValue":"BadRequestError","camelCase":"badRequestError","pascalCase":"BadRequestError","snakeCase":"bad_request_error","screamingSnakeCase":"BAD_REQUEST_ERROR"}}},"type":{"aliasOf":{"_type":"void"},"resolvedType":{"_type":"void"},"_type":"alias"},"http":{"statusCode":400},"statusCode":400},{"name":{"name":"NotFoundError","nameV2":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"nameV3":{"safeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"unsafeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"}},"fernFilepath":[{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}],"fernFilepathV2":[{"safeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"},"unsafeName":{"originalValue":"imdb","camelCase":"imdb","pascalCase":"Imdb","snakeCase":"imdb","screamingSnakeCase":"IMDB"}}]},"discriminantValue":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR","wireValue":"NotFoundError"},"discriminantValueV2":{"wireValue":"NotFoundError","name":{"safeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"unsafeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"}}},"discriminantValueV3":{"wireValue":"content","name":{"safeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"},"unsafeName":{"originalValue":"content","camelCase":"content","pascalCase":"Content","snakeCase":"content","screamingSnakeCase":"CONTENT"}},"type":"property"},"discriminantValueV4":{"wireValue":"NotFoundError","name":{"safeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"},"unsafeName":{"originalValue":"NotFoundError","camelCase":"notFoundError","pascalCase":"NotFoundError","snakeCase":"not_found_error","screamingSnakeCase":"NOT_FOUND_ERROR"}}},"type":{"aliasOf":{"primitive":"STRING","_type":"primitive"},"resolvedType":{"primitive":"STRING","_type":"primitive"},"_type":"alias"},"typeV2":{"aliasOf":{"primitive":"STRING","_type":"primitive"},"resolvedType":{"primitive":"STRING","_type":"primitive"},"_type":"alias"},"typeV3":{"primitive":"STRING","_type":"primitive"},"http":{"statusCode":404},"statusCode":404}]}"`; diff --git a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/FormDataBodyEncodingStyle.ts b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/FormDataBodyEncodingStyle.ts new file mode 100644 index 00000000000..4be44b8ee37 --- /dev/null +++ b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/FormDataBodyEncodingStyle.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type FormDataBodyEncodingStyle = "json" | "exploded"; +export const FormDataBodyEncodingStyle = { + Json: "json", + Exploded: "exploded", +} as const; diff --git a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts new file mode 100644 index 00000000000..9232df1f72f --- /dev/null +++ b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernDefinition from "../../../index"; + +export interface HttpInlineFileRequestBodyPropertySchema extends FernDefinition.TypeReferenceDeclarationWithName { + /** Defaults to json encoding */ + style?: FernDefinition.FormDataBodyEncodingStyle; + "content-type"?: string; +} diff --git a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineRequestBodyPropertySchema.ts b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineRequestBodyPropertySchema.ts index b47c3d25bef..5872d056361 100644 --- a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineRequestBodyPropertySchema.ts +++ b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/HttpInlineRequestBodyPropertySchema.ts @@ -4,4 +4,4 @@ import * as FernDefinition from "../../../index"; -export type HttpInlineRequestBodyPropertySchema = string | FernDefinition.TypeReferenceDeclarationWithContentTypeSchema; +export type HttpInlineRequestBodyPropertySchema = string | FernDefinition.HttpInlineFileRequestBodyPropertySchema; diff --git a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts deleted file mode 100644 index 36e1b348be8..00000000000 --- a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as FernDefinition from "../../../index"; - -export interface TypeReferenceDeclarationWithContentTypeSchema extends FernDefinition.TypeReferenceDeclarationWithName { - "content-type"?: string; -} diff --git a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/index.ts b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/index.ts index 650d1f11d2e..1b50a3ae2f9 100644 --- a/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/index.ts +++ b/packages/cli/fern-definition/schema/src/schemas/api/resources/service/types/index.ts @@ -12,7 +12,8 @@ export * from "./HttpRequestBodySchema"; export * from "./HttpReferencedRequestBodySchema"; export * from "./HttpInlineRequestBodySchema"; export * from "./HttpInlineRequestBodyPropertySchema"; -export * from "./TypeReferenceDeclarationWithContentTypeSchema"; +export * from "./HttpInlineFileRequestBodyPropertySchema"; +export * from "./FormDataBodyEncodingStyle"; export * from "./HttpQueryParameterSchema"; export * from "./QueryParameterTypeReferenceDetailed"; export * from "./HttpResponseSchema"; diff --git a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/FormDataBodyEncodingStyle.ts b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/FormDataBodyEncodingStyle.ts new file mode 100644 index 00000000000..9b369e006a6 --- /dev/null +++ b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/FormDataBodyEncodingStyle.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as FernDefinition from "../../../../api/index"; +import * as core from "../../../../core"; + +export const FormDataBodyEncodingStyle: core.serialization.Schema< + serializers.FormDataBodyEncodingStyle.Raw, + FernDefinition.FormDataBodyEncodingStyle +> = core.serialization.enum_(["json", "exploded"]); + +export declare namespace FormDataBodyEncodingStyle { + export type Raw = "json" | "exploded"; +} diff --git a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts similarity index 56% rename from packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts rename to packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts index 66f8e0d8bcf..bdddef32840 100644 --- a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/TypeReferenceDeclarationWithContentTypeSchema.ts +++ b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineFileRequestBodyPropertySchema.ts @@ -5,19 +5,22 @@ import * as serializers from "../../../index"; import * as FernDefinition from "../../../../api/index"; import * as core from "../../../../core"; +import { FormDataBodyEncodingStyle } from "./FormDataBodyEncodingStyle"; import { TypeReferenceDeclarationWithName } from "../../types/types/TypeReferenceDeclarationWithName"; -export const TypeReferenceDeclarationWithContentTypeSchema: core.serialization.ObjectSchema< - serializers.TypeReferenceDeclarationWithContentTypeSchema.Raw, - FernDefinition.TypeReferenceDeclarationWithContentTypeSchema +export const HttpInlineFileRequestBodyPropertySchema: core.serialization.ObjectSchema< + serializers.HttpInlineFileRequestBodyPropertySchema.Raw, + FernDefinition.HttpInlineFileRequestBodyPropertySchema > = core.serialization .object({ + style: FormDataBodyEncodingStyle.optional(), "content-type": core.serialization.string().optional(), }) .extend(TypeReferenceDeclarationWithName); -export declare namespace TypeReferenceDeclarationWithContentTypeSchema { +export declare namespace HttpInlineFileRequestBodyPropertySchema { export interface Raw extends TypeReferenceDeclarationWithName.Raw { + style?: FormDataBodyEncodingStyle.Raw | null; "content-type"?: string | null; } } diff --git a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineRequestBodyPropertySchema.ts b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineRequestBodyPropertySchema.ts index b3e94685b7f..cd83997203b 100644 --- a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineRequestBodyPropertySchema.ts +++ b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/HttpInlineRequestBodyPropertySchema.ts @@ -5,16 +5,13 @@ import * as serializers from "../../../index"; import * as FernDefinition from "../../../../api/index"; import * as core from "../../../../core"; -import { TypeReferenceDeclarationWithContentTypeSchema } from "./TypeReferenceDeclarationWithContentTypeSchema"; +import { HttpInlineFileRequestBodyPropertySchema } from "./HttpInlineFileRequestBodyPropertySchema"; export const HttpInlineRequestBodyPropertySchema: core.serialization.Schema< serializers.HttpInlineRequestBodyPropertySchema.Raw, FernDefinition.HttpInlineRequestBodyPropertySchema -> = core.serialization.undiscriminatedUnion([ - core.serialization.string(), - TypeReferenceDeclarationWithContentTypeSchema, -]); +> = core.serialization.undiscriminatedUnion([core.serialization.string(), HttpInlineFileRequestBodyPropertySchema]); export declare namespace HttpInlineRequestBodyPropertySchema { - export type Raw = string | TypeReferenceDeclarationWithContentTypeSchema.Raw; + export type Raw = string | HttpInlineFileRequestBodyPropertySchema.Raw; } diff --git a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/index.ts b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/index.ts index 650d1f11d2e..1b50a3ae2f9 100644 --- a/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/index.ts +++ b/packages/cli/fern-definition/schema/src/schemas/serialization/resources/service/types/index.ts @@ -12,7 +12,8 @@ export * from "./HttpRequestBodySchema"; export * from "./HttpReferencedRequestBodySchema"; export * from "./HttpInlineRequestBodySchema"; export * from "./HttpInlineRequestBodyPropertySchema"; -export * from "./TypeReferenceDeclarationWithContentTypeSchema"; +export * from "./HttpInlineFileRequestBodyPropertySchema"; +export * from "./FormDataBodyEncodingStyle"; export * from "./HttpQueryParameterSchema"; export * from "./QueryParameterTypeReferenceDetailed"; export * from "./HttpResponseSchema"; diff --git a/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts b/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts index 9fb199f75c5..dc3aa19ff93 100644 --- a/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts +++ b/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts @@ -34,6 +34,7 @@ export declare namespace RawFileUploadRequest { availability?: AvailabilityUnionSchema | undefined; key: string; contentType?: string; + style?: "exploded" | "json"; } } @@ -85,6 +86,7 @@ function createRawFileUploadRequest( (acc, [key, propertyType]) => { const docs = typeof propertyType !== "string" ? propertyType.docs : undefined; const contentType = typeof propertyType !== "string" ? propertyType["content-type"] : undefined; + const style = typeof propertyType !== "string" ? propertyType.style : undefined; const maybeParsedFileType = parseRawFileType( typeof propertyType === "string" ? propertyType : propertyType.type ); @@ -95,7 +97,8 @@ function createRawFileUploadRequest( docs, isOptional: maybeParsedFileType.isOptional, isArray: maybeParsedFileType.isArray, - contentType + contentType, + style }); } else { acc.push({ isFile: false, key, propertyType, docs, contentType }); diff --git a/packages/cli/fern-definition/validator/src/ast/visitors/services/visitHttpService.ts b/packages/cli/fern-definition/validator/src/ast/visitors/services/visitHttpService.ts index f8cc340f9bd..de9824577e6 100644 --- a/packages/cli/fern-definition/validator/src/ast/visitors/services/visitHttpService.ts +++ b/packages/cli/fern-definition/validator/src/ast/visitors/services/visitHttpService.ts @@ -205,6 +205,7 @@ function visitEndpoint({ validation: property.validation }); }, + style: noop, "content-type": noop, audiences: noop, encoding: noop, diff --git a/packages/cli/fern-definition/validator/src/getAllRules.ts b/packages/cli/fern-definition/validator/src/getAllRules.ts index 3d3563bf39f..6476b887732 100644 --- a/packages/cli/fern-definition/validator/src/getAllRules.ts +++ b/packages/cli/fern-definition/validator/src/getAllRules.ts @@ -1,5 +1,6 @@ import { Rule } from "./Rule"; import { ContentTypeOnlyForMultipartRule } from "./rules/content-type-only-for-multipart"; +import { ExplodedFormDataIsArrayRule } from "./rules/exploded-form-data-is-array"; import { ImportFileExistsRule } from "./rules/import-file-exists"; import { MatchingEnvironmentUrlsRule } from "./rules/matching-environment-urls"; import { NoCircularImportsRule } from "./rules/no-circular-imports"; @@ -89,7 +90,8 @@ export function getAllRules(): Rule[] { NoUnusedGenericRule, ValidGenericRule, ContentTypeOnlyForMultipartRule, - ValidPathParametersConfigurationRule + ValidPathParametersConfigurationRule, + ExplodedFormDataIsArrayRule ]; } diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/exploded-form-data-is-array.test.ts b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/exploded-form-data-is-array.test.ts new file mode 100644 index 00000000000..637f94c4e5b --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/exploded-form-data-is-array.test.ts @@ -0,0 +1,32 @@ +import { AbsoluteFilePath, RelativeFilePath, join } from "@fern-api/fs-utils"; + +import { getViolationsForRule } from "../../../testing-utils/getViolationsForRule"; +import { ExplodedFormDataIsArrayRule } from "../exploded-form-data-is-array"; + +describe("exploded-form-data-is-array", () => { + it("simple", async () => { + const violations = await getViolationsForRule({ + rule: ExplodedFormDataIsArrayRule, + absolutePathToWorkspace: join( + AbsoluteFilePath.of(__dirname), + RelativeFilePath.of("fixtures"), + RelativeFilePath.of("simple") + ) + }); + + expect(violations).toMatchInlineSnapshot(` + [ + { + "message": "invalid-exploded is exploded and must be a list. Did you mean list?", + "nodePath": [ + "service", + "endpoints", + "uploadDocument", + ], + "relativeFilepath": "1.yml", + "severity": "error", + }, + ] + `); + }); +}); diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/1.yml b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/1.yml new file mode 100644 index 00000000000..146297faf5e --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/1.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json + + +service: + base-path: /documents + auth: false + endpoints: + uploadDocument: + path: /upload + method: POST + request: + name: UploadDocumentRequest + body: + properties: + file: file + invalid-exploded: + type: string + style: exploded + exploded: + type: list + style: exploded + exploded2: + type: optional> + style: exploded diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/api.yml b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/api.yml new file mode 100644 index 00000000000..eee3f038239 --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/definition/api.yml @@ -0,0 +1 @@ +name: simple-api diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/generators.yml b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/__test__/fixtures/simple/generators.yml @@ -0,0 +1 @@ +{} diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/exploded-form-data-is-array.ts b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/exploded-form-data-is-array.ts new file mode 100644 index 00000000000..0277a50a8c2 --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/exploded-form-data-is-array.ts @@ -0,0 +1,87 @@ +import { RawSchemas } from "@fern-api/fern-definition-schema"; +import { ResolvedType, TypeResolverImpl, constructFernFileContext } from "@fern-api/ir-generator"; + +import { Rule, RuleViolation } from "../../Rule"; +import { CASINGS_GENERATOR } from "../../utils/casingsGenerator"; + +export const ExplodedFormDataIsArrayRule: Rule = { + name: "exploded-form-data-is-array", + create: ({ workspace }) => { + const typeResolver = new TypeResolverImpl(workspace); + return { + definitionFile: { + httpEndpoint: ({ endpoint }, { relativeFilepath, contents: definitionFile }) => { + if ( + endpoint.request == null || + typeof endpoint.request === "string" || + endpoint.request?.body == null || + typeof endpoint.request.body === "string" + ) { + return []; + } + + if (!isHttpInlineRequestBodySchema(endpoint.request.body)) { + return []; + } + + const violations: RuleViolation[] = []; + + for (const [propertyKey, propertyShape] of Object.entries(endpoint.request.body.properties ?? {})) { + if (typeof propertyShape === "string") { + continue; + } + + if (propertyShape.style !== "exploded") { + continue; + } + + const file = constructFernFileContext({ + relativeFilepath, + definitionFile, + casingsGenerator: CASINGS_GENERATOR, + rootApiFile: workspace.definition.rootApiFile.contents + }); + + const resolvedType = typeResolver.resolveType({ + type: propertyShape.type, + file + }); + + if (resolvedType == null) { + // This error is caught by another rule. + return []; + } + + if (!isListType(resolvedType)) { + violations.push({ + message: `${propertyKey} is exploded and must be a list. Did you mean list<${propertyShape.type}>?`, + severity: "error" + }); + } + } + + return violations; + } + } + }; + } +}; + +function isListType(type: ResolvedType): boolean { + if (type._type !== "container") { + return false; + } + if (type.container._type === "list") { + return true; + } + if (type.container._type === "optional" || type.container._type === "nullable") { + return isListType(type.container.itemType); + } + return false; +} + +function isHttpInlineRequestBodySchema( + body: RawSchemas.HttpRequestBodySchema +): body is RawSchemas.HttpInlineRequestBodySchema { + return (body as RawSchemas.HttpInlineRequestBodySchema)?.properties != null; +} diff --git a/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/index.ts b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/index.ts new file mode 100644 index 00000000000..184b54bd888 --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/exploded-form-data-is-array/index.ts @@ -0,0 +1 @@ +export { ExplodedFormDataIsArrayRule } from "./exploded-form-data-is-array"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts b/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts index 96fcd3ad7a4..5dda7e4dd1b 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts @@ -85,6 +85,7 @@ export function convertHttpRequestBody({ availability: convertAvailability(property.availability), file }), + style: property.style, contentType: property.contentType }); } diff --git a/packages/cli/workspace/lazy-fern-workspace/src/fern.schema.json b/packages/cli/workspace/lazy-fern-workspace/src/fern.schema.json index 9e8cf0da18a..7f28614709e 100644 --- a/packages/cli/workspace/lazy-fern-workspace/src/fern.schema.json +++ b/packages/cli/workspace/lazy-fern-workspace/src/fern.schema.json @@ -1727,7 +1727,14 @@ ], "additionalProperties": false }, - "service.TypeReferenceDeclarationWithContentTypeSchema": { + "service.FormDataBodyEncodingStyle": { + "type": "string", + "enum": [ + "json", + "exploded" + ] + }, + "service.HttpInlineFileRequestBodyPropertySchema": { "type": "object", "properties": { "type": { @@ -1813,6 +1820,16 @@ } ] }, + "style": { + "oneOf": [ + { + "$ref": "#/definitions/service.FormDataBodyEncodingStyle" + }, + { + "type": "null" + } + ] + }, "content-type": { "oneOf": [ { @@ -1835,7 +1852,7 @@ "type": "string" }, { - "$ref": "#/definitions/service.TypeReferenceDeclarationWithContentTypeSchema" + "$ref": "#/definitions/service.HttpInlineFileRequestBodyPropertySchema" } ] }, diff --git a/packages/cli/workspace/lazy-fern-workspace/src/package-yml.schema.json b/packages/cli/workspace/lazy-fern-workspace/src/package-yml.schema.json index b3c06f2f1d4..15c106ac9fc 100644 --- a/packages/cli/workspace/lazy-fern-workspace/src/package-yml.schema.json +++ b/packages/cli/workspace/lazy-fern-workspace/src/package-yml.schema.json @@ -1747,7 +1747,14 @@ ], "additionalProperties": false }, - "service.TypeReferenceDeclarationWithContentTypeSchema": { + "service.FormDataBodyEncodingStyle": { + "type": "string", + "enum": [ + "json", + "exploded" + ] + }, + "service.HttpInlineFileRequestBodyPropertySchema": { "type": "object", "properties": { "type": { @@ -1833,6 +1840,16 @@ } ] }, + "style": { + "oneOf": [ + { + "$ref": "#/definitions/service.FormDataBodyEncodingStyle" + }, + { + "type": "null" + } + ] + }, "content-type": { "oneOf": [ { @@ -1855,7 +1872,7 @@ "type": "string" }, { - "$ref": "#/definitions/service.TypeReferenceDeclarationWithContentTypeSchema" + "$ref": "#/definitions/service.HttpInlineFileRequestBodyPropertySchema" } ] }, diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml index 820550e8f88..93fc37cfe43 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml @@ -142,6 +142,11 @@ types: extends: InlinedRequestBodyProperty properties: contentType: optional + style: optional + FileUploadBodyPropertyEncoding: + enum: + - exploded + - json FileProperty: union: file: FilePropertySingle diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyProperty.ts index 9fbb2f9a9ef..49e97ea91f5 100644 --- a/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyProperty.ts @@ -6,4 +6,5 @@ import * as FernIr from "../../../index"; export interface FileUploadBodyProperty extends FernIr.InlinedRequestBodyProperty { contentType: string | undefined; + style: FernIr.FileUploadBodyPropertyEncoding | undefined; } diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyPropertyEncoding.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyPropertyEncoding.ts new file mode 100644 index 00000000000..546834fbc48 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadBodyPropertyEncoding.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type FileUploadBodyPropertyEncoding = "exploded" | "json"; +export const FileUploadBodyPropertyEncoding = { + Exploded: "exploded", + Json: "json", + _visit: (value: FileUploadBodyPropertyEncoding, visitor: FileUploadBodyPropertyEncoding.Visitor) => { + switch (value) { + case FileUploadBodyPropertyEncoding.Exploded: + return visitor.exploded(); + case FileUploadBodyPropertyEncoding.Json: + return visitor.json(); + default: + return visitor._other(); + } + }, +} as const; + +export namespace FileUploadBodyPropertyEncoding { + export interface Visitor { + exploded: () => R; + json: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts index 849ed56935f..e5894ef0ecd 100644 --- a/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts @@ -18,6 +18,7 @@ export * from "./FileUploadRequest"; export * from "./BytesRequest"; export * from "./FileUploadRequestProperty"; export * from "./FileUploadBodyProperty"; +export * from "./FileUploadBodyPropertyEncoding"; export * from "./FileProperty"; export * from "./FilePropertySingle"; export * from "./FilePropertyArray"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyProperty.ts index fc084efa05e..097aae4248d 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyProperty.ts @@ -5,6 +5,7 @@ import * as serializers from "../../../index"; import * as FernIr from "../../../../api/index"; import * as core from "../../../../core"; +import { FileUploadBodyPropertyEncoding } from "./FileUploadBodyPropertyEncoding"; import { InlinedRequestBodyProperty } from "./InlinedRequestBodyProperty"; export const FileUploadBodyProperty: core.serialization.ObjectSchema< @@ -13,11 +14,13 @@ export const FileUploadBodyProperty: core.serialization.ObjectSchema< > = core.serialization .objectWithoutOptionalProperties({ contentType: core.serialization.string().optional(), + style: FileUploadBodyPropertyEncoding.optional(), }) .extend(InlinedRequestBodyProperty); export declare namespace FileUploadBodyProperty { export interface Raw extends InlinedRequestBodyProperty.Raw { contentType?: string | null; + style?: FileUploadBodyPropertyEncoding.Raw | null; } } diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyPropertyEncoding.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyPropertyEncoding.ts new file mode 100644 index 00000000000..eaf30e7b8b6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadBodyPropertyEncoding.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as FernIr from "../../../../api/index"; +import * as core from "../../../../core"; + +export const FileUploadBodyPropertyEncoding: core.serialization.Schema< + serializers.FileUploadBodyPropertyEncoding.Raw, + FernIr.FileUploadBodyPropertyEncoding +> = core.serialization.enum_(["exploded", "json"]); + +export declare namespace FileUploadBodyPropertyEncoding { + export type Raw = "exploded" | "json"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts index 849ed56935f..e5894ef0ecd 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts @@ -18,6 +18,7 @@ export * from "./FileUploadRequest"; export * from "./BytesRequest"; export * from "./FileUploadRequestProperty"; export * from "./FileUploadBodyProperty"; +export * from "./FileUploadBodyPropertyEncoding"; export * from "./FileProperty"; export * from "./FilePropertySingle"; export * from "./FilePropertyArray"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5a471482cb..de3ff3b993b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -853,6 +853,63 @@ importers: specifier: ^2.1.9 version: 2.1.9(@types/node@18.15.3)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) + generators/php/dynamic-snippets: + devDependencies: + '@esbuild-plugins/node-globals-polyfill': + specifier: ^0.2.3 + version: 0.2.3(esbuild@0.24.0) + '@esbuild-plugins/node-modules-polyfill': + specifier: ^0.2.2 + version: 0.2.2(esbuild@0.24.0) + '@fern-api/browser-compatible-base-generator': + specifier: workspace:* + version: link:../../browser-compatible-base + '@fern-api/configs': + specifier: workspace:* + version: link:../../../packages/configs + '@fern-api/core-utils': + specifier: workspace:* + version: link:../../../packages/commons/core-utils + '@fern-api/dynamic-ir-sdk': + specifier: ^55.0.0 + version: 55.0.0 + '@fern-api/path-utils': + specifier: workspace:* + version: link:../../../packages/commons/path-utils + '@fern-api/php-codegen': + specifier: workspace:* + version: link:../codegen + '@trivago/prettier-plugin-sort-imports': + specifier: ^5.2.1 + version: 5.2.1(@vue/compiler-sfc@3.5.13)(prettier@3.4.2) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.14 + '@types/node': + specifier: 18.15.3 + version: 18.15.3 + depcheck: + specifier: ^1.4.7 + version: 1.4.7 + eslint: + specifier: ^8.56.0 + version: 8.56.0 + prettier: + specifier: ^3.4.2 + version: 3.4.2 + string.prototype.replaceall: + specifier: ^1.0.10 + version: 1.0.10 + tsup: + specifier: ^8.3.5 + version: 8.3.5(postcss@8.5.1)(typescript@5.7.2)(yaml@2.3.3) + typescript: + specifier: 5.7.2 + version: 5.7.2 + vitest: + specifier: ^2.1.8 + version: 2.1.9(@types/node@18.15.3)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) + generators/php/model: devDependencies: '@fern-api/base-generator': diff --git a/seed/php-sdk/accept-header/src/Service/ServiceClient.php b/seed/php-sdk/accept-header/src/Service/ServiceClient.php index 97a233503a8..3c424ba0ea0 100644 --- a/seed/php-sdk/accept-header/src/Service/ServiceClient.php +++ b/seed/php-sdk/accept-header/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -68,6 +69,16 @@ public function endpoint(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/alias-extends/src/SeedClient.php b/seed/php-sdk/alias-extends/src/SeedClient.php index 9ca45feac7c..949ce2b17f1 100644 --- a/seed/php-sdk/alias-extends/src/SeedClient.php +++ b/seed/php-sdk/alias-extends/src/SeedClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -83,6 +84,16 @@ public function extendedInlineRequestBody(InlinedChildRequest $request, ?array $ if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/alias/src/SeedClient.php b/seed/php-sdk/alias/src/SeedClient.php index 92c46abe114..de997a75fbf 100644 --- a/seed/php-sdk/alias/src/SeedClient.php +++ b/seed/php-sdk/alias/src/SeedClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -81,6 +82,16 @@ public function get(string $typeId, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/any-auth/src/Auth/AuthClient.php b/seed/php-sdk/any-auth/src/Auth/AuthClient.php index efce4e31b87..47dea73530c 100644 --- a/seed/php-sdk/any-auth/src/Auth/AuthClient.php +++ b/seed/php-sdk/any-auth/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class AuthClient @@ -77,6 +78,16 @@ public function getToken(GetTokenRequest $request, ?array $options = null): Toke } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/any-auth/src/User/UserClient.php b/seed/php-sdk/any-auth/src/User/UserClient.php index 78c468c9283..e9609740718 100644 --- a/seed/php-sdk/any-auth/src/User/UserClient.php +++ b/seed/php-sdk/any-auth/src/User/UserClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -75,6 +76,16 @@ public function get(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/api-wide-base-path/src/Service/ServiceClient.php b/seed/php-sdk/api-wide-base-path/src/Service/ServiceClient.php index bc30cef61f0..c25a8cdc38d 100644 --- a/seed/php-sdk/api-wide-base-path/src/Service/ServiceClient.php +++ b/seed/php-sdk/api-wide-base-path/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -72,6 +73,16 @@ public function post(string $pathParam, string $serviceParam, string $resourcePa if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/audiences/src/FolderA/Service/ServiceClient.php b/seed/php-sdk/audiences/src/FolderA/Service/ServiceClient.php index 032655d4c31..d100e5e5661 100644 --- a/seed/php-sdk/audiences/src/FolderA/Service/ServiceClient.php +++ b/seed/php-sdk/audiences/src/FolderA/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -74,6 +75,16 @@ public function getDirectThread(?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/audiences/src/FolderD/Service/ServiceClient.php b/seed/php-sdk/audiences/src/FolderD/Service/ServiceClient.php index df160553721..4c93f4cc501 100644 --- a/seed/php-sdk/audiences/src/FolderD/Service/ServiceClient.php +++ b/seed/php-sdk/audiences/src/FolderD/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -74,6 +75,16 @@ public function getDirectThread(?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/audiences/src/Foo/FooClient.php b/seed/php-sdk/audiences/src/Foo/FooClient.php index 5999952c5c5..6b8bf771167 100644 --- a/seed/php-sdk/audiences/src/Foo/FooClient.php +++ b/seed/php-sdk/audiences/src/Foo/FooClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class FooClient @@ -82,6 +83,16 @@ public function find(FindRequest $request, ?array $options = null): ImportingTyp } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/auth-environment-variables/src/Service/ServiceClient.php b/seed/php-sdk/auth-environment-variables/src/Service/ServiceClient.php index 134601b2355..3ba43f2a85d 100644 --- a/seed/php-sdk/auth-environment-variables/src/Service/ServiceClient.php +++ b/seed/php-sdk/auth-environment-variables/src/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Service\Requests\HeaderAuthRequest; @@ -77,6 +78,16 @@ public function getWithApiKey(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -121,6 +132,16 @@ public function getWithHeader(HeaderAuthRequest $request, ?array $options = null } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/basic-auth-environment-variables/src/BasicAuth/BasicAuthClient.php b/seed/php-sdk/basic-auth-environment-variables/src/BasicAuth/BasicAuthClient.php index d9f0adb69a0..6f196de429c 100644 --- a/seed/php-sdk/basic-auth-environment-variables/src/BasicAuth/BasicAuthClient.php +++ b/seed/php-sdk/basic-auth-environment-variables/src/BasicAuth/BasicAuthClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class BasicAuthClient @@ -76,6 +77,16 @@ public function getWithBasicAuth(?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function postWithBasicAuth(mixed $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/basic-auth/src/BasicAuth/BasicAuthClient.php b/seed/php-sdk/basic-auth/src/BasicAuth/BasicAuthClient.php index d9f0adb69a0..6f196de429c 100644 --- a/seed/php-sdk/basic-auth/src/BasicAuth/BasicAuthClient.php +++ b/seed/php-sdk/basic-auth/src/BasicAuth/BasicAuthClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class BasicAuthClient @@ -76,6 +77,16 @@ public function getWithBasicAuth(?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function postWithBasicAuth(mixed $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/bearer-token-environment-variable/src/Service/ServiceClient.php b/seed/php-sdk/bearer-token-environment-variable/src/Service/ServiceClient.php index 707b8d0e9cc..1ca8bdd8be8 100644 --- a/seed/php-sdk/bearer-token-environment-variable/src/Service/ServiceClient.php +++ b/seed/php-sdk/bearer-token-environment-variable/src/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -76,6 +77,16 @@ public function getWithBearerToken(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/bytes/src/Service/ServiceClient.php b/seed/php-sdk/bytes/src/Service/ServiceClient.php index 2f991d00746..0f0b7fcc149 100644 --- a/seed/php-sdk/bytes/src/Service/ServiceClient.php +++ b/seed/php-sdk/bytes/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -68,6 +69,16 @@ public function upload(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/cross-package-type-names/src/FolderA/Service/ServiceClient.php b/seed/php-sdk/cross-package-type-names/src/FolderA/Service/ServiceClient.php index 032655d4c31..d100e5e5661 100644 --- a/seed/php-sdk/cross-package-type-names/src/FolderA/Service/ServiceClient.php +++ b/seed/php-sdk/cross-package-type-names/src/FolderA/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -74,6 +75,16 @@ public function getDirectThread(?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/cross-package-type-names/src/FolderD/Service/ServiceClient.php b/seed/php-sdk/cross-package-type-names/src/FolderD/Service/ServiceClient.php index 649f31236e4..1ab55ee7b2a 100644 --- a/seed/php-sdk/cross-package-type-names/src/FolderD/Service/ServiceClient.php +++ b/seed/php-sdk/cross-package-type-names/src/FolderD/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -74,6 +75,16 @@ public function getDirectThread(?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/cross-package-type-names/src/Foo/FooClient.php b/seed/php-sdk/cross-package-type-names/src/Foo/FooClient.php index 5999952c5c5..6b8bf771167 100644 --- a/seed/php-sdk/cross-package-type-names/src/Foo/FooClient.php +++ b/seed/php-sdk/cross-package-type-names/src/Foo/FooClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class FooClient @@ -82,6 +83,16 @@ public function find(FindRequest $request, ?array $options = null): ImportingTyp } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/custom-auth/src/CustomAuth/CustomAuthClient.php b/seed/php-sdk/custom-auth/src/CustomAuth/CustomAuthClient.php index 949d04b1c0d..62ce43ce270 100644 --- a/seed/php-sdk/custom-auth/src/CustomAuth/CustomAuthClient.php +++ b/seed/php-sdk/custom-auth/src/CustomAuth/CustomAuthClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class CustomAuthClient @@ -76,6 +77,16 @@ public function getWithCustomAuth(?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function postWithCustomAuth(mixed $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/enum/src/InlinedRequest/InlinedRequestClient.php b/seed/php-sdk/enum/src/InlinedRequest/InlinedRequestClient.php index 0282a0dbeba..abf01a1f80b 100644 --- a/seed/php-sdk/enum/src/InlinedRequest/InlinedRequestClient.php +++ b/seed/php-sdk/enum/src/InlinedRequest/InlinedRequestClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class InlinedRequestClient @@ -71,6 +72,16 @@ public function send(SendEnumInlinedRequest $request, ?array $options = null): v if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/enum/src/PathParam/PathParamClient.php b/seed/php-sdk/enum/src/PathParam/PathParamClient.php index 5b7384975a2..7e47a32f165 100644 --- a/seed/php-sdk/enum/src/PathParam/PathParamClient.php +++ b/seed/php-sdk/enum/src/PathParam/PathParamClient.php @@ -10,6 +10,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class PathParamClient @@ -72,6 +73,16 @@ public function send(string $operand, string $operandOrColor, ?array $options = if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/enum/src/QueryParam/QueryParamClient.php b/seed/php-sdk/enum/src/QueryParam/QueryParamClient.php index 9500b8ea2d4..0b6cf10d5f3 100644 --- a/seed/php-sdk/enum/src/QueryParam/QueryParamClient.php +++ b/seed/php-sdk/enum/src/QueryParam/QueryParamClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\QueryParam\Requests\SendEnumListAsQueryParamRequest; @@ -81,6 +82,16 @@ public function send(SendEnumAsQueryParamRequest $request, ?array $options = nul if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -126,6 +137,16 @@ public function sendList(SendEnumListAsQueryParamRequest $request, ?array $optio if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/error-property/src/PropertyBasedError/PropertyBasedErrorClient.php b/seed/php-sdk/error-property/src/PropertyBasedError/PropertyBasedErrorClient.php index bbc7137191e..f68434e4b30 100644 --- a/seed/php-sdk/error-property/src/PropertyBasedError/PropertyBasedErrorClient.php +++ b/seed/php-sdk/error-property/src/PropertyBasedError/PropertyBasedErrorClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class PropertyBasedErrorClient @@ -76,6 +77,16 @@ public function throwError(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/examples/src/File/Notification/Service/ServiceClient.php b/seed/php-sdk/examples/src/File/Notification/Service/ServiceClient.php index e6ab32158ac..2f97fc97850 100644 --- a/seed/php-sdk/examples/src/File/Notification/Service/ServiceClient.php +++ b/seed/php-sdk/examples/src/File/Notification/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -75,6 +76,16 @@ public function getException(string $notificationId, ?array $options = null): mi } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/examples/src/File/Service/ServiceClient.php b/seed/php-sdk/examples/src/File/Service/ServiceClient.php index 9389a54d589..a8dab139a61 100644 --- a/seed/php-sdk/examples/src/File/Service/ServiceClient.php +++ b/seed/php-sdk/examples/src/File/Service/ServiceClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -82,6 +83,16 @@ public function getFile(string $filename, GetFileRequest $request, ?array $optio } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/examples/src/Health/Service/ServiceClient.php b/seed/php-sdk/examples/src/Health/Service/ServiceClient.php index 54611940e27..9022eb5d88f 100644 --- a/seed/php-sdk/examples/src/Health/Service/ServiceClient.php +++ b/seed/php-sdk/examples/src/Health/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Core\Json\JsonDecoder; use JsonException; @@ -73,6 +74,16 @@ public function check(string $id, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -113,6 +124,16 @@ public function ping(?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/examples/src/SeedClient.php b/seed/php-sdk/examples/src/SeedClient.php index 73cccbb2939..24f57339d21 100644 --- a/seed/php-sdk/examples/src/SeedClient.php +++ b/seed/php-sdk/examples/src/SeedClient.php @@ -13,6 +13,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Types\BasicType; use Seed\Types\ComplexType; @@ -118,6 +119,16 @@ public function echo_(string $request, ?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -158,6 +169,16 @@ public function createType(string $request, ?array $options = null): Identifier } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/examples/src/Service/ServiceClient.php b/seed/php-sdk/examples/src/Service/ServiceClient.php index 0fad92ae5bf..fdf6899c47f 100644 --- a/seed/php-sdk/examples/src/Service/ServiceClient.php +++ b/seed/php-sdk/examples/src/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Core\Json\JsonDecoder; use Seed\Service\Requests\GetMetadataRequest; @@ -79,6 +80,16 @@ public function getMovie(string $movieId, ?array $options = null): Movie } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function createMovie(Movie $request, ?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -169,6 +190,16 @@ public function getMetadata(GetMetadataRequest $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -209,6 +240,16 @@ public function createBigEntity(BigEntity $request, ?array $options = null): Res } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Container/ContainerClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Container/ContainerClient.php index 3f1ede42929..e4c4adb417c 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Container/ContainerClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Container/ContainerClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonSerializer; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Types\Object\Types\ObjectWithRequiredField; @@ -78,6 +79,16 @@ public function getAndReturnListOfPrimitives(array $request, ?array $options = n } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function getAndReturnListOfObjects(array $request, ?array $options = null } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -158,6 +179,16 @@ public function getAndReturnSetOfPrimitives(array $request, ?array $options = nu } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -198,6 +229,16 @@ public function getAndReturnSetOfObjects(array $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -238,6 +279,16 @@ public function getAndReturnMapPrimToPrim(array $request, ?array $options = null } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -278,6 +329,16 @@ public function getAndReturnMapOfPrimToObject(array $request, ?array $options = } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -321,6 +382,16 @@ public function getAndReturnOptional(?ObjectWithRequiredField $request = null, ? } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/ContentType/ContentTypeClient.php b/seed/php-sdk/exhaustive/src/Endpoints/ContentType/ContentTypeClient.php index 3d7b7ed4819..1a4f7b3b511 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/ContentType/ContentTypeClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/ContentType/ContentTypeClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ContentTypeClient @@ -71,6 +72,16 @@ public function postJsonPatchContentType(ObjectWithOptionalField $request, ?arra if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -107,6 +118,16 @@ public function postJsonPatchContentWithCharsetType(ObjectWithOptionalField $req if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Enum/EnumClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Enum/EnumClient.php index 7f224572e7a..bf795599b05 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Enum/EnumClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Enum/EnumClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class EnumClient @@ -77,6 +78,16 @@ public function getAndReturnEnum(string $request, ?array $options = null): strin } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/HttpMethods/HttpMethodsClient.php b/seed/php-sdk/exhaustive/src/Endpoints/HttpMethods/HttpMethodsClient.php index 332ce039e64..c5449714254 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/HttpMethods/HttpMethodsClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/HttpMethods/HttpMethodsClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Types\Object\Types\ObjectWithRequiredField; use Seed\Types\Object\Types\ObjectWithOptionalField; @@ -77,6 +78,16 @@ public function testGet(string $id, ?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -117,6 +128,16 @@ public function testPost(ObjectWithRequiredField $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -158,6 +179,16 @@ public function testPut(string $id, ObjectWithRequiredField $request, ?array $op } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -199,6 +230,16 @@ public function testPatch(string $id, ObjectWithOptionalField $request, ?array $ } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -238,6 +279,16 @@ public function testDelete(string $id, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Object/ObjectClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Object/ObjectClient.php index 2469f71bed5..7a07ec74543 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Object/ObjectClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Object/ObjectClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Types\Object\Types\ObjectWithRequiredField; use Seed\Types\Object\Types\ObjectWithMapOfMap; @@ -81,6 +82,16 @@ public function getAndReturnWithOptionalField(ObjectWithOptionalField $request, } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -121,6 +132,16 @@ public function getAndReturnWithRequiredField(ObjectWithRequiredField $request, } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -161,6 +182,16 @@ public function getAndReturnWithMapOfMap(ObjectWithMapOfMap $request, ?array $op } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -201,6 +232,16 @@ public function getAndReturnNestedWithOptionalField(NestedObjectWithOptionalFiel } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -242,6 +283,16 @@ public function getAndReturnNestedWithRequiredField(string $string, NestedObject } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -282,6 +333,16 @@ public function getAndReturnNestedWithRequiredFieldAsList(array $request, ?array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Params/ParamsClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Params/ParamsClient.php index d54c7dc47f9..e5034754235 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Params/ParamsClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Params/ParamsClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Endpoints\Params\Requests\GetWithInlinePath; use Seed\Endpoints\Params\Requests\GetWithQuery; @@ -83,6 +84,16 @@ public function getWithPath(string $param, ?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -125,6 +136,16 @@ public function getWithInlinePath(string $param, GetWithInlinePath $request, ?ar } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -166,6 +187,16 @@ public function getWithQuery(GetWithQuery $request, ?array $options = null): voi if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -207,6 +238,16 @@ public function getWithAllowMultipleQuery(GetWithMultipleQuery $request, ?array if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -248,6 +289,16 @@ public function getWithPathAndQuery(string $param, GetWithPathAndQuery $request, if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -289,6 +340,16 @@ public function getWithInlinePathAndQuery(string $param, GetWithInlinePathAndQue if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -332,6 +393,16 @@ public function modifyWithPath(string $param, string $request, ?array $options = } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -375,6 +446,16 @@ public function modifyWithInlinePath(string $param, ModifyResourceAtInlinedPath } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Primitive/PrimitiveClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Primitive/PrimitiveClient.php index 0163a50fa88..d5aa3a5f90c 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Primitive/PrimitiveClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Primitive/PrimitiveClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use DateTime; use Seed\Core\Json\JsonSerializer; @@ -78,6 +79,16 @@ public function getAndReturnString(string $request, ?array $options = null): str } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function getAndReturnInt(int $request, ?array $options = null): int } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -158,6 +179,16 @@ public function getAndReturnLong(int $request, ?array $options = null): int } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -198,6 +229,16 @@ public function getAndReturnDouble(float $request, ?array $options = null): floa } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -238,6 +279,16 @@ public function getAndReturnBool(bool $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -278,6 +329,16 @@ public function getAndReturnDatetime(DateTime $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -318,6 +379,16 @@ public function getAndReturnDate(DateTime $request, ?array $options = null): Dat } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -358,6 +429,16 @@ public function getAndReturnUuid(string $request, ?array $options = null): strin } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -398,6 +479,16 @@ public function getAndReturnBase64(string $request, ?array $options = null): str } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/Endpoints/Union/UnionClient.php b/seed/php-sdk/exhaustive/src/Endpoints/Union/UnionClient.php index 3bafa75da04..39447b10df5 100644 --- a/seed/php-sdk/exhaustive/src/Endpoints/Union/UnionClient.php +++ b/seed/php-sdk/exhaustive/src/Endpoints/Union/UnionClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UnionClient @@ -76,6 +77,16 @@ public function getAndReturnUnion(mixed $request, ?array $options = null): mixed } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/InlinedRequests/InlinedRequestsClient.php b/seed/php-sdk/exhaustive/src/InlinedRequests/InlinedRequestsClient.php index 644460019a8..2b314111f97 100644 --- a/seed/php-sdk/exhaustive/src/InlinedRequests/InlinedRequestsClient.php +++ b/seed/php-sdk/exhaustive/src/InlinedRequests/InlinedRequestsClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class InlinedRequestsClient @@ -79,6 +80,16 @@ public function postWithObjectBodyandResponse(PostWithObjectBody $request, ?arra } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/NoAuth/NoAuthClient.php b/seed/php-sdk/exhaustive/src/NoAuth/NoAuthClient.php index cf644822efc..d4a172492f7 100644 --- a/seed/php-sdk/exhaustive/src/NoAuth/NoAuthClient.php +++ b/seed/php-sdk/exhaustive/src/NoAuth/NoAuthClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class NoAuthClient @@ -78,6 +79,16 @@ public function postWithNoAuth(mixed $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/NoReqBody/NoReqBodyClient.php b/seed/php-sdk/exhaustive/src/NoReqBody/NoReqBodyClient.php index e9d45610094..9e3729fb50b 100644 --- a/seed/php-sdk/exhaustive/src/NoReqBody/NoReqBodyClient.php +++ b/seed/php-sdk/exhaustive/src/NoReqBody/NoReqBodyClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Core\Json\JsonDecoder; @@ -75,6 +76,16 @@ public function getWithNoRequestBody(?array $options = null): ObjectWithOptional } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -113,6 +124,16 @@ public function postWithNoRequestBody(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/exhaustive/src/ReqWithHeaders/ReqWithHeadersClient.php b/seed/php-sdk/exhaustive/src/ReqWithHeaders/ReqWithHeadersClient.php index 6c0ec0bb661..53727729eb3 100644 --- a/seed/php-sdk/exhaustive/src/ReqWithHeaders/ReqWithHeadersClient.php +++ b/seed/php-sdk/exhaustive/src/ReqWithHeaders/ReqWithHeadersClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ReqWithHeadersClient @@ -75,6 +76,16 @@ public function getWithCustomHeader(ReqWithHeaders $request, ?array $options = n if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/extends/src/SeedClient.php b/seed/php-sdk/extends/src/SeedClient.php index af27a5570b5..cb637603841 100644 --- a/seed/php-sdk/extends/src/SeedClient.php +++ b/seed/php-sdk/extends/src/SeedClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -83,6 +84,16 @@ public function extendedInlineRequestBody(Inlined $request, ?array $options = nu if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/extra-properties/src/User/UserClient.php b/seed/php-sdk/extra-properties/src/User/UserClient.php index 8878542e341..3fe627e11ef 100644 --- a/seed/php-sdk/extra-properties/src/User/UserClient.php +++ b/seed/php-sdk/extra-properties/src/User/UserClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -77,6 +78,16 @@ public function createUser(CreateUserRequest $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/file-download/src/Service/ServiceClient.php b/seed/php-sdk/file-download/src/Service/ServiceClient.php index e6c1d9efee3..c9f675e5e2c 100644 --- a/seed/php-sdk/file-download/src/Service/ServiceClient.php +++ b/seed/php-sdk/file-download/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -65,6 +66,16 @@ public function downloadFile(?array $options = null): void $options, ); $statusCode = $response->getStatusCode(); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/file-upload/src/Service/ServiceClient.php b/seed/php-sdk/file-upload/src/Service/ServiceClient.php index 2e5b5ad9d14..a10e34f84fb 100644 --- a/seed/php-sdk/file-upload/src/Service/ServiceClient.php +++ b/seed/php-sdk/file-upload/src/Service/ServiceClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonEncoder; use Seed\Core\Multipart\MultipartApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Service\Requests\JustFileRequest; use Seed\Service\Requests\JustFileWithQueryParamsRequest; @@ -113,6 +114,16 @@ public function post(MyRequest $request, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -151,6 +162,16 @@ public function justFile(JustFileRequest $request, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -202,6 +223,16 @@ public function justFileWithQueryParams(JustFileWithQueryParamsRequest $request, if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -258,6 +289,16 @@ public function withContentType(WithContentTypeRequest $request, ?array $options if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/folders/src/A/B/BClient.php b/seed/php-sdk/folders/src/A/B/BClient.php index 1978e69a140..3a3c7d17482 100644 --- a/seed/php-sdk/folders/src/A/B/BClient.php +++ b/seed/php-sdk/folders/src/A/B/BClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class BClient @@ -68,6 +69,16 @@ public function foo(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/folders/src/A/C/CClient.php b/seed/php-sdk/folders/src/A/C/CClient.php index 5f8ea6f80f2..56f4630bdd9 100644 --- a/seed/php-sdk/folders/src/A/C/CClient.php +++ b/seed/php-sdk/folders/src/A/C/CClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class CClient @@ -68,6 +69,16 @@ public function foo(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/folders/src/Folder/FolderClient.php b/seed/php-sdk/folders/src/Folder/FolderClient.php index 7e769bed8d0..aa1da21ef9e 100644 --- a/seed/php-sdk/folders/src/Folder/FolderClient.php +++ b/seed/php-sdk/folders/src/Folder/FolderClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class FolderClient @@ -75,6 +76,16 @@ public function foo(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/folders/src/Folder/Service/ServiceClient.php b/seed/php-sdk/folders/src/Folder/Service/ServiceClient.php index aff9e93a721..ea7c83d3a3f 100644 --- a/seed/php-sdk/folders/src/Folder/Service/ServiceClient.php +++ b/seed/php-sdk/folders/src/Folder/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -68,6 +69,16 @@ public function endpoint(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -104,6 +115,16 @@ public function unknownRequest(mixed $request, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/folders/src/SeedClient.php b/seed/php-sdk/folders/src/SeedClient.php index 6065c53a952..8c4b45145aa 100644 --- a/seed/php-sdk/folders/src/SeedClient.php +++ b/seed/php-sdk/folders/src/SeedClient.php @@ -10,6 +10,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -95,6 +96,16 @@ public function foo(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/idempotency-headers/src/Payment/PaymentClient.php b/seed/php-sdk/idempotency-headers/src/Payment/PaymentClient.php index ed60eb3e1d4..8d3b23cc7bb 100644 --- a/seed/php-sdk/idempotency-headers/src/Payment/PaymentClient.php +++ b/seed/php-sdk/idempotency-headers/src/Payment/PaymentClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class PaymentClient @@ -77,6 +78,16 @@ public function create(CreatePaymentRequest $request, ?array $options = null): s } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -112,6 +123,16 @@ public function delete(string $paymentId, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/imdb/clientName/src/Imdb/ImdbClient.php b/seed/php-sdk/imdb/clientName/src/Imdb/ImdbClient.php index 839b99d348d..b6d0e5efe62 100644 --- a/seed/php-sdk/imdb/clientName/src/Imdb/ImdbClient.php +++ b/seed/php-sdk/imdb/clientName/src/Imdb/ImdbClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Imdb\Types\Movie; @@ -80,6 +81,16 @@ public function createMovie(CreateMovieRequest $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getMovie(string $movieId, ?array $options = null): Movie } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/imdb/namespace/src/Imdb/ImdbClient.php b/seed/php-sdk/imdb/namespace/src/Imdb/ImdbClient.php index 96b4334cee6..5f2c9e7ac56 100644 --- a/seed/php-sdk/imdb/namespace/src/Imdb/ImdbClient.php +++ b/seed/php-sdk/imdb/namespace/src/Imdb/ImdbClient.php @@ -11,6 +11,7 @@ use Fern\Core\Client\HttpMethod; use Fern\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Fern\Imdb\Types\Movie; @@ -80,6 +81,16 @@ public function createMovie(CreateMovieRequest $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getMovie(string $movieId, ?array $options = null): Movie } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/imdb/no-custom-config/src/Imdb/ImdbClient.php b/seed/php-sdk/imdb/no-custom-config/src/Imdb/ImdbClient.php index 839b99d348d..b6d0e5efe62 100644 --- a/seed/php-sdk/imdb/no-custom-config/src/Imdb/ImdbClient.php +++ b/seed/php-sdk/imdb/no-custom-config/src/Imdb/ImdbClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Imdb\Types\Movie; @@ -80,6 +81,16 @@ public function createMovie(CreateMovieRequest $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getMovie(string $movieId, ?array $options = null): Movie } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/imdb/packageName/src/Imdb/ImdbClient.php b/seed/php-sdk/imdb/packageName/src/Imdb/ImdbClient.php index 839b99d348d..b6d0e5efe62 100644 --- a/seed/php-sdk/imdb/packageName/src/Imdb/ImdbClient.php +++ b/seed/php-sdk/imdb/packageName/src/Imdb/ImdbClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Imdb\Types\Movie; @@ -80,6 +81,16 @@ public function createMovie(CreateMovieRequest $request, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getMovie(string $movieId, ?array $options = null): Movie } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/license/src/SeedClient.php b/seed/php-sdk/license/src/SeedClient.php index becf0fd9c5b..914541a7c92 100644 --- a/seed/php-sdk/license/src/SeedClient.php +++ b/seed/php-sdk/license/src/SeedClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -80,6 +81,16 @@ public function get(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/literal/src/Headers/HeadersClient.php b/seed/php-sdk/literal/src/Headers/HeadersClient.php index 457c627b86c..7eba1167aca 100644 --- a/seed/php-sdk/literal/src/Headers/HeadersClient.php +++ b/seed/php-sdk/literal/src/Headers/HeadersClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class HeadersClient @@ -81,6 +82,16 @@ public function send(SendLiteralsInHeadersRequest $request, ?array $options = nu } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/literal/src/Inlined/InlinedClient.php b/seed/php-sdk/literal/src/Inlined/InlinedClient.php index ef2a7b2944a..c279291afea 100644 --- a/seed/php-sdk/literal/src/Inlined/InlinedClient.php +++ b/seed/php-sdk/literal/src/Inlined/InlinedClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class InlinedClient @@ -77,6 +78,16 @@ public function send(SendLiteralsInlinedRequest $request, ?array $options = null } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/literal/src/Path/PathClient.php b/seed/php-sdk/literal/src/Path/PathClient.php index 930e822a754..da9bdb8b2fa 100644 --- a/seed/php-sdk/literal/src/Path/PathClient.php +++ b/seed/php-sdk/literal/src/Path/PathClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class PathClient @@ -75,6 +76,16 @@ public function send(string $id, ?array $options = null): SendResponse } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/literal/src/Query/QueryClient.php b/seed/php-sdk/literal/src/Query/QueryClient.php index 721647a77ab..0d8eef385fe 100644 --- a/seed/php-sdk/literal/src/Query/QueryClient.php +++ b/seed/php-sdk/literal/src/Query/QueryClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class QueryClient @@ -95,6 +96,16 @@ public function send(SendLiteralsInQueryRequest $request, ?array $options = null } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/literal/src/Reference/ReferenceClient.php b/seed/php-sdk/literal/src/Reference/ReferenceClient.php index b41083a1c5f..d33e812c0c4 100644 --- a/seed/php-sdk/literal/src/Reference/ReferenceClient.php +++ b/seed/php-sdk/literal/src/Reference/ReferenceClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ReferenceClient @@ -77,6 +78,16 @@ public function send(SendRequest $request, ?array $options = null): SendResponse } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/mixed-case/src/Service/ServiceClient.php b/seed/php-sdk/mixed-case/src/Service/ServiceClient.php index 8f21a1011d1..b2f660b2e4c 100644 --- a/seed/php-sdk/mixed-case/src/Service/ServiceClient.php +++ b/seed/php-sdk/mixed-case/src/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Service\Requests\ListResourcesRequest; use Seed\Core\Types\Constant; @@ -77,6 +78,16 @@ public function getResource(string $resourceId, ?array $options = null): mixed } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -120,6 +131,16 @@ public function listResources(ListResourcesRequest $request, ?array $options = n } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/mixed-file-directory/src/Organization/OrganizationClient.php b/seed/php-sdk/mixed-file-directory/src/Organization/OrganizationClient.php index b85e03ce421..1662e36c70e 100644 --- a/seed/php-sdk/mixed-file-directory/src/Organization/OrganizationClient.php +++ b/seed/php-sdk/mixed-file-directory/src/Organization/OrganizationClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class OrganizationClient @@ -79,6 +80,16 @@ public function create(CreateOrganizationRequest $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/mixed-file-directory/src/User/Events/EventsClient.php b/seed/php-sdk/mixed-file-directory/src/User/Events/EventsClient.php index e59f908c24e..3863c55065c 100644 --- a/seed/php-sdk/mixed-file-directory/src/User/Events/EventsClient.php +++ b/seed/php-sdk/mixed-file-directory/src/User/Events/EventsClient.php @@ -13,6 +13,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class EventsClient @@ -91,6 +92,16 @@ public function listEvents(ListUserEventsRequest $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/mixed-file-directory/src/User/Events/Metadata/MetadataClient.php b/seed/php-sdk/mixed-file-directory/src/User/Events/Metadata/MetadataClient.php index d4acd6879ad..5e4a69343ee 100644 --- a/seed/php-sdk/mixed-file-directory/src/User/Events/Metadata/MetadataClient.php +++ b/seed/php-sdk/mixed-file-directory/src/User/Events/Metadata/MetadataClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class MetadataClient @@ -81,6 +82,16 @@ public function getMetadata(GetEventMetadataRequest $request, ?array $options = } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/mixed-file-directory/src/User/UserClient.php b/seed/php-sdk/mixed-file-directory/src/User/UserClient.php index b3a21472d58..cacd0ca8759 100644 --- a/seed/php-sdk/mixed-file-directory/src/User/UserClient.php +++ b/seed/php-sdk/mixed-file-directory/src/User/UserClient.php @@ -13,6 +13,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -91,6 +92,16 @@ public function list(ListUsersRequest $request, ?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/multi-line-docs/src/User/UserClient.php b/seed/php-sdk/multi-line-docs/src/User/UserClient.php index 99205a134f5..efa1e07f8a4 100644 --- a/seed/php-sdk/multi-line-docs/src/User/UserClient.php +++ b/seed/php-sdk/multi-line-docs/src/User/UserClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\User\Requests\CreateUserRequest; use Seed\User\Types\User; @@ -78,6 +79,16 @@ public function getUser(string $userId, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -121,6 +132,16 @@ public function createUser(CreateUserRequest $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/no-environment/src/Dummy/DummyClient.php b/seed/php-sdk/no-environment/src/Dummy/DummyClient.php index be226731045..aa4ac93b8e5 100644 --- a/seed/php-sdk/no-environment/src/Dummy/DummyClient.php +++ b/seed/php-sdk/no-environment/src/Dummy/DummyClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class DummyClient @@ -74,6 +75,16 @@ public function getDummy(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/nullable/src/Nullable/NullableClient.php b/seed/php-sdk/nullable/src/Nullable/NullableClient.php index 2dfa3af95ad..92ade48bf57 100644 --- a/seed/php-sdk/nullable/src/Nullable/NullableClient.php +++ b/seed/php-sdk/nullable/src/Nullable/NullableClient.php @@ -12,6 +12,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Nullable\Requests\CreateUserRequest; use Seed\Nullable\Requests\DeleteUserRequest; @@ -96,6 +97,16 @@ public function getUsers(GetUsersRequest $request, ?array $options = null): arra } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -136,6 +147,16 @@ public function createUser(CreateUserRequest $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -176,6 +197,16 @@ public function deleteUser(DeleteUserRequest $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/oauth-client-credentials-custom/src/Auth/AuthClient.php b/seed/php-sdk/oauth-client-credentials-custom/src/Auth/AuthClient.php index 8a99244a611..2ba3a13236b 100644 --- a/seed/php-sdk/oauth-client-credentials-custom/src/Auth/AuthClient.php +++ b/seed/php-sdk/oauth-client-credentials-custom/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Auth\Requests\RefreshTokenRequest; @@ -78,6 +79,16 @@ public function getTokenWithClientCredentials(GetTokenRequest $request, ?array $ } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function refreshToken(RefreshTokenRequest $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/oauth-client-credentials-default/src/Auth/AuthClient.php b/seed/php-sdk/oauth-client-credentials-default/src/Auth/AuthClient.php index efce4e31b87..47dea73530c 100644 --- a/seed/php-sdk/oauth-client-credentials-default/src/Auth/AuthClient.php +++ b/seed/php-sdk/oauth-client-credentials-default/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class AuthClient @@ -77,6 +78,16 @@ public function getToken(GetTokenRequest $request, ?array $options = null): Toke } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/oauth-client-credentials-environment-variables/src/Auth/AuthClient.php b/seed/php-sdk/oauth-client-credentials-environment-variables/src/Auth/AuthClient.php index 8a99244a611..2ba3a13236b 100644 --- a/seed/php-sdk/oauth-client-credentials-environment-variables/src/Auth/AuthClient.php +++ b/seed/php-sdk/oauth-client-credentials-environment-variables/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Auth\Requests\RefreshTokenRequest; @@ -78,6 +79,16 @@ public function getTokenWithClientCredentials(GetTokenRequest $request, ?array $ } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function refreshToken(RefreshTokenRequest $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/oauth-client-credentials-nested-root/src/Auth/AuthClient.php b/seed/php-sdk/oauth-client-credentials-nested-root/src/Auth/AuthClient.php index efce4e31b87..47dea73530c 100644 --- a/seed/php-sdk/oauth-client-credentials-nested-root/src/Auth/AuthClient.php +++ b/seed/php-sdk/oauth-client-credentials-nested-root/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class AuthClient @@ -77,6 +78,16 @@ public function getToken(GetTokenRequest $request, ?array $options = null): Toke } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/oauth-client-credentials/src/Auth/AuthClient.php b/seed/php-sdk/oauth-client-credentials/src/Auth/AuthClient.php index 8a99244a611..2ba3a13236b 100644 --- a/seed/php-sdk/oauth-client-credentials/src/Auth/AuthClient.php +++ b/seed/php-sdk/oauth-client-credentials/src/Auth/AuthClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Auth\Requests\RefreshTokenRequest; @@ -78,6 +79,16 @@ public function getTokenWithClientCredentials(GetTokenRequest $request, ?array $ } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function refreshToken(RefreshTokenRequest $request, ?array $options = nul } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/optional/src/Optional/OptionalClient.php b/seed/php-sdk/optional/src/Optional/OptionalClient.php index a0f64ff700a..c254efc1802 100644 --- a/seed/php-sdk/optional/src/Optional/OptionalClient.php +++ b/seed/php-sdk/optional/src/Optional/OptionalClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonSerializer; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class OptionalClient @@ -77,6 +78,16 @@ public function sendOptionalBody(?array $request = null, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/package-yml/src/SeedClient.php b/seed/php-sdk/package-yml/src/SeedClient.php index ccd11f3f715..2c0d4625d04 100644 --- a/seed/php-sdk/package-yml/src/SeedClient.php +++ b/seed/php-sdk/package-yml/src/SeedClient.php @@ -12,6 +12,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -98,6 +99,16 @@ public function echo_(string $id, EchoRequest $request, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/package-yml/src/Service/ServiceClient.php b/seed/php-sdk/package-yml/src/Service/ServiceClient.php index edfe582c8c9..2ce16ff32a9 100644 --- a/seed/php-sdk/package-yml/src/Service/ServiceClient.php +++ b/seed/php-sdk/package-yml/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -70,6 +71,16 @@ public function nop(string $id, string $nestedId, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/pagination/src/Complex/ComplexClient.php b/seed/php-sdk/pagination/src/Complex/ComplexClient.php index a3db10dedc0..d8c5377c0d4 100644 --- a/seed/php-sdk/pagination/src/Complex/ComplexClient.php +++ b/seed/php-sdk/pagination/src/Complex/ComplexClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ComplexClient @@ -77,6 +78,16 @@ public function search(SearchRequest $request, ?array $options = null): Paginate } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/pagination/src/Users/UsersClient.php b/seed/php-sdk/pagination/src/Users/UsersClient.php index 8e26f0fb7fe..65b3b0c10d6 100644 --- a/seed/php-sdk/pagination/src/Users/UsersClient.php +++ b/seed/php-sdk/pagination/src/Users/UsersClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Users\Requests\ListUsersMixedTypeCursorPaginationRequest; use Seed\Users\Types\ListUsersMixedTypePaginationResponse; @@ -106,6 +107,16 @@ public function listWithCursorPagination(ListUsersCursorPaginationRequest $reque } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -150,6 +161,16 @@ public function listWithMixedTypeCursorPagination(ListUsersMixedTypeCursorPagina } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -190,6 +211,16 @@ public function listWithBodyCursorPagination(ListUsersBodyCursorPaginationReques } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -243,6 +274,16 @@ public function listWithOffsetPagination(ListUsersOffsetPaginationRequest $reque } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -296,6 +337,16 @@ public function listWithDoubleOffsetPagination(ListUsersDoubleOffsetPaginationRe } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -336,6 +387,16 @@ public function listWithBodyOffsetPagination(ListUsersBodyOffsetPaginationReques } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -386,6 +447,16 @@ public function listWithOffsetStepPagination(ListUsersOffsetStepPaginationReques } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -436,6 +507,16 @@ public function listWithOffsetPaginationHasNextPage(ListWithOffsetPaginationHasN } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -480,6 +561,16 @@ public function listWithExtendedResults(ListUsersExtendedRequest $request, ?arra } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -524,6 +615,16 @@ public function listWithExtendedResultsAndOptionalData(ListUsersExtendedRequestF } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -568,6 +669,16 @@ public function listUsernames(ListUsernamesRequest $request, ?array $options = n } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -612,6 +723,16 @@ public function listWithGlobalConfig(ListWithGlobalConfigRequest $request, ?arra } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/path-parameters/src/Organizations/OrganizationsClient.php b/seed/php-sdk/path-parameters/src/Organizations/OrganizationsClient.php index dccf8a700d5..fd442fa19c4 100644 --- a/seed/php-sdk/path-parameters/src/Organizations/OrganizationsClient.php +++ b/seed/php-sdk/path-parameters/src/Organizations/OrganizationsClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Organizations\Requests\GetOrganizationUserRequest; use Seed\User\Types\User; @@ -80,6 +81,16 @@ public function getOrganization(string $tenantId, string $organizationId, ?array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -122,6 +133,16 @@ public function getOrganizationUser(string $tenantId, string $organizationId, st } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -168,6 +189,16 @@ public function searchOrganizations(string $tenantId, string $organizationId, Se } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/path-parameters/src/User/UserClient.php b/seed/php-sdk/path-parameters/src/User/UserClient.php index a99d1779144..e4adb6e85af 100644 --- a/seed/php-sdk/path-parameters/src/User/UserClient.php +++ b/seed/php-sdk/path-parameters/src/User/UserClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\User\Requests\UpdateUserRequest; use Seed\User\Requests\SearchUsersRequest; @@ -81,6 +82,16 @@ public function getUser(string $tenantId, string $userId, GetUsersRequest $reque } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -122,6 +133,16 @@ public function createUser(string $tenantId, User $request, ?array $options = nu } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -164,6 +185,16 @@ public function updateUser(string $tenantId, string $userId, UpdateUserRequest $ } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -210,6 +241,16 @@ public function searchUsers(string $tenantId, string $userId, SearchUsersRequest } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/plain-text/src/Service/ServiceClient.php b/seed/php-sdk/plain-text/src/Service/ServiceClient.php index f820403b9fb..4ebd22bf17b 100644 --- a/seed/php-sdk/plain-text/src/Service/ServiceClient.php +++ b/seed/php-sdk/plain-text/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -69,6 +70,16 @@ public function getText(?array $options = null): string if ($statusCode >= 200 && $statusCode < 400) { return $response->getBody()->getContents(); } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/query-parameters/src/User/UserClient.php b/seed/php-sdk/query-parameters/src/User/UserClient.php index 384485f9b4b..9cbce03d0ab 100644 --- a/seed/php-sdk/query-parameters/src/User/UserClient.php +++ b/seed/php-sdk/query-parameters/src/User/UserClient.php @@ -12,6 +12,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -99,6 +100,16 @@ public function getUsername(GetUsersRequest $request, ?array $options = null): U } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/reserved-keywords/src/Package/PackageClient.php b/seed/php-sdk/reserved-keywords/src/Package/PackageClient.php index cab6d0d774a..402a84e3f84 100644 --- a/seed/php-sdk/reserved-keywords/src/Package/PackageClient.php +++ b/seed/php-sdk/reserved-keywords/src/Package/PackageClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class PackageClient @@ -73,6 +74,16 @@ public function test(TestRequest $request, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/response-property/src/Service/ServiceClient.php b/seed/php-sdk/response-property/src/Service/ServiceClient.php index 5d7319720f9..38638d6bae8 100644 --- a/seed/php-sdk/response-property/src/Service/ServiceClient.php +++ b/seed/php-sdk/response-property/src/Service/ServiceClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Types\StringResponse; use Seed\Service\Types\WithDocs; @@ -78,6 +79,16 @@ public function getMovie(string $request, ?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -118,6 +129,16 @@ public function getMovieDocs(string $request, ?array $options = null): Response } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -158,6 +179,16 @@ public function getMovieName(string $request, ?array $options = null): StringRes } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -198,6 +229,16 @@ public function getMovieMetadata(string $request, ?array $options = null): Respo } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -241,6 +282,16 @@ public function getOptionalMovie(string $request, ?array $options = null): ?Resp } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -284,6 +335,16 @@ public function getOptionalMovieDocs(string $request, ?array $options = null): ? } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -327,6 +388,16 @@ public function getOptionalMovieName(string $request, ?array $options = null): ? } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/server-sent-event-examples/src/Completions/CompletionsClient.php b/seed/php-sdk/server-sent-event-examples/src/Completions/CompletionsClient.php index 95e0e68bf42..83132b494c2 100644 --- a/seed/php-sdk/server-sent-event-examples/src/Completions/CompletionsClient.php +++ b/seed/php-sdk/server-sent-event-examples/src/Completions/CompletionsClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class CompletionsClient @@ -68,6 +69,16 @@ public function stream(StreamCompletionRequest $request, ?array $options = null) $options, ); $statusCode = $response->getStatusCode(); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/server-sent-events/src/Completions/CompletionsClient.php b/seed/php-sdk/server-sent-events/src/Completions/CompletionsClient.php index 95e0e68bf42..83132b494c2 100644 --- a/seed/php-sdk/server-sent-events/src/Completions/CompletionsClient.php +++ b/seed/php-sdk/server-sent-events/src/Completions/CompletionsClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class CompletionsClient @@ -68,6 +69,16 @@ public function stream(StreamCompletionRequest $request, ?array $options = null) $options, ); $statusCode = $response->getStatusCode(); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/simple-fhir/src/SeedClient.php b/seed/php-sdk/simple-fhir/src/SeedClient.php index 11f1fff5b6c..73b6f56aa49 100644 --- a/seed/php-sdk/simple-fhir/src/SeedClient.php +++ b/seed/php-sdk/simple-fhir/src/SeedClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class SeedClient @@ -87,6 +88,16 @@ public function getAccount(string $accountId, ?array $options = null): Account } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/single-url-environment-default/src/Dummy/DummyClient.php b/seed/php-sdk/single-url-environment-default/src/Dummy/DummyClient.php index e325aa5dc48..89c1e91907f 100644 --- a/seed/php-sdk/single-url-environment-default/src/Dummy/DummyClient.php +++ b/seed/php-sdk/single-url-environment-default/src/Dummy/DummyClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class DummyClient @@ -75,6 +76,16 @@ public function getDummy(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/single-url-environment-no-default/src/Dummy/DummyClient.php b/seed/php-sdk/single-url-environment-no-default/src/Dummy/DummyClient.php index be226731045..aa4ac93b8e5 100644 --- a/seed/php-sdk/single-url-environment-no-default/src/Dummy/DummyClient.php +++ b/seed/php-sdk/single-url-environment-no-default/src/Dummy/DummyClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class DummyClient @@ -74,6 +75,16 @@ public function getDummy(?array $options = null): string } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/streaming-parameter/src/Dummy/DummyClient.php b/seed/php-sdk/streaming-parameter/src/Dummy/DummyClient.php index 2dd35ee5f85..d0c3a224623 100644 --- a/seed/php-sdk/streaming-parameter/src/Dummy/DummyClient.php +++ b/seed/php-sdk/streaming-parameter/src/Dummy/DummyClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class DummyClient @@ -68,6 +69,16 @@ public function generate(GenerateRequest $request, ?array $options = null): void $options, ); $statusCode = $response->getStatusCode(); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/streaming/src/Dummy/DummyClient.php b/seed/php-sdk/streaming/src/Dummy/DummyClient.php index c5870933499..e19e69cf855 100644 --- a/seed/php-sdk/streaming/src/Dummy/DummyClient.php +++ b/seed/php-sdk/streaming/src/Dummy/DummyClient.php @@ -9,6 +9,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Dummy\Requests\Generateequest; use Seed\Dummy\Types\StreamResponse; @@ -71,6 +72,16 @@ public function generateStream(GenerateStreamRequest $request, ?array $options = $options, ); $statusCode = $response->getStatusCode(); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -111,6 +122,16 @@ public function generate(Generateequest $request, ?array $options = null): Strea } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Admin/AdminClient.php b/seed/php-sdk/trace/src/Admin/AdminClient.php index 6dc2f3bb24b..ef9d48e371d 100644 --- a/seed/php-sdk/trace/src/Admin/AdminClient.php +++ b/seed/php-sdk/trace/src/Admin/AdminClient.php @@ -9,6 +9,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Environments; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Submission\Types\TestSubmissionUpdate; use Seed\Submission\Types\WorkspaceSubmissionUpdate; @@ -78,6 +79,16 @@ public function updateTestSubmissionStatus(string $submissionId, mixed $request, if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -115,6 +126,16 @@ public function sendTestSubmissionUpdate(string $submissionId, TestSubmissionUpd if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -152,6 +173,16 @@ public function updateWorkspaceSubmissionStatus(string $submissionId, mixed $req if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -189,6 +220,16 @@ public function sendWorkspaceSubmissionUpdate(string $submissionId, WorkspaceSub if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -227,6 +268,16 @@ public function storeTracedTestCase(string $submissionId, string $testCaseId, St if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -265,6 +316,16 @@ public function storeTracedTestCaseV2(string $submissionId, string $testCaseId, if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -302,6 +363,16 @@ public function storeTracedWorkspace(string $submissionId, StoreTracedWorkspaceR if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -339,6 +410,16 @@ public function storeTracedWorkspaceV2(string $submissionId, array $request, ?ar if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Homepage/HomepageClient.php b/seed/php-sdk/trace/src/Homepage/HomepageClient.php index f7bd7c6a676..6e463931571 100644 --- a/seed/php-sdk/trace/src/Homepage/HomepageClient.php +++ b/seed/php-sdk/trace/src/Homepage/HomepageClient.php @@ -11,6 +11,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Core\Json\JsonSerializer; @@ -76,6 +77,16 @@ public function getHomepageProblems(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -112,6 +123,16 @@ public function setHomepageProblems(array $request, ?array $options = null): voi if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Migration/MigrationClient.php b/seed/php-sdk/trace/src/Migration/MigrationClient.php index 7ebb16c8fb1..21e2dcd191e 100644 --- a/seed/php-sdk/trace/src/Migration/MigrationClient.php +++ b/seed/php-sdk/trace/src/Migration/MigrationClient.php @@ -13,6 +13,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class MigrationClient @@ -81,6 +82,16 @@ public function getAttemptedMigrations(GetAttemptedMigrationsRequest $request, ? } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Playlist/PlaylistClient.php b/seed/php-sdk/trace/src/Playlist/PlaylistClient.php index 4a9cc3ae633..46891d30b7d 100644 --- a/seed/php-sdk/trace/src/Playlist/PlaylistClient.php +++ b/seed/php-sdk/trace/src/Playlist/PlaylistClient.php @@ -13,6 +13,7 @@ use Seed\Environments; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Playlist\Requests\GetPlaylistsRequest; use Seed\Core\Json\JsonDecoder; @@ -91,6 +92,16 @@ public function createPlaylist(int $serviceParam, CreatePlaylistRequest $request } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -144,6 +155,16 @@ public function getPlaylists(int $serviceParam, GetPlaylistsRequest $request, ?a } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -186,6 +207,16 @@ public function getPlaylist(int $serviceParam, string $playlistId, ?array $optio } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -233,6 +264,16 @@ public function updatePlaylist(int $serviceParam, string $playlistId, ?UpdatePla } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -271,6 +312,16 @@ public function deletePlaylist(int $serviceParam, string $playlistId, ?array $op if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Problem/ProblemClient.php b/seed/php-sdk/trace/src/Problem/ProblemClient.php index d50af167984..0697572c447 100644 --- a/seed/php-sdk/trace/src/Problem/ProblemClient.php +++ b/seed/php-sdk/trace/src/Problem/ProblemClient.php @@ -12,6 +12,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Problem\Types\UpdateProblemResponse; use Seed\Problem\Requests\GetDefaultStarterFilesRequest; @@ -83,6 +84,16 @@ public function createProblem(CreateProblemRequest $request, ?array $options = n } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -126,6 +137,16 @@ public function updateProblem(string $problemId, CreateProblemRequest $request, } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -163,6 +184,16 @@ public function deleteProblem(string $problemId, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -205,6 +236,16 @@ public function getDefaultStarterFiles(GetDefaultStarterFilesRequest $request, ? } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Submission/SubmissionClient.php b/seed/php-sdk/trace/src/Submission/SubmissionClient.php index d83759fa875..d9fbfc96560 100644 --- a/seed/php-sdk/trace/src/Submission/SubmissionClient.php +++ b/seed/php-sdk/trace/src/Submission/SubmissionClient.php @@ -12,6 +12,7 @@ use Seed\Environments; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Submission\Types\GetExecutionSessionStateResponse; @@ -80,6 +81,16 @@ public function createExecutionSession(string $language, ?array $options = null) } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -124,6 +135,16 @@ public function getExecutionSession(string $sessionId, ?array $options = null): } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -161,6 +182,16 @@ public function stopExecutionSession(string $sessionId, ?array $options = null): if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -199,6 +230,16 @@ public function getExecutionSessionsState(?array $options = null): GetExecutionS } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/Sysprop/SyspropClient.php b/seed/php-sdk/trace/src/Sysprop/SyspropClient.php index bd66460c6db..ee484757d03 100644 --- a/seed/php-sdk/trace/src/Sysprop/SyspropClient.php +++ b/seed/php-sdk/trace/src/Sysprop/SyspropClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Environments; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Core\Json\JsonDecoder; use JsonException; @@ -74,6 +75,16 @@ public function setNumWarmInstances(string $language, int $numWarmInstances, ?ar if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -112,6 +123,16 @@ public function getNumWarmInstances(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/V2/Problem/ProblemClient.php b/seed/php-sdk/trace/src/V2/Problem/ProblemClient.php index 7fe2e74a078..3aaaca3bf3b 100644 --- a/seed/php-sdk/trace/src/V2/Problem/ProblemClient.php +++ b/seed/php-sdk/trace/src/V2/Problem/ProblemClient.php @@ -12,6 +12,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\V2\Problem\Types\ProblemInfoV2; @@ -79,6 +80,16 @@ public function getLightweightProblems(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getProblems(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -160,6 +181,16 @@ public function getLatestProblem(string $problemId, ?array $options = null): Pro } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -202,6 +233,16 @@ public function getProblemVersion(string $problemId, int $problemVersion, ?array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/V2/V2Client.php b/seed/php-sdk/trace/src/V2/V2Client.php index 3c798507e0f..d09c0fe3d7e 100644 --- a/seed/php-sdk/trace/src/V2/V2Client.php +++ b/seed/php-sdk/trace/src/V2/V2Client.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Environments; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class V2Client @@ -83,6 +84,16 @@ public function test(?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/ProblemClient.php b/seed/php-sdk/trace/src/V2/V3/Problem/ProblemClient.php index 661627d2676..67769989702 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/ProblemClient.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/ProblemClient.php @@ -12,6 +12,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\V2\V3\Problem\Types\ProblemInfoV2; @@ -79,6 +80,16 @@ public function getLightweightProblems(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -119,6 +130,16 @@ public function getProblems(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -160,6 +181,16 @@ public function getLatestProblem(string $problemId, ?array $options = null): Pro } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -202,6 +233,16 @@ public function getProblemVersion(string $problemId, int $problemVersion, ?array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/undiscriminated-unions/src/Union/UnionClient.php b/seed/php-sdk/undiscriminated-unions/src/Union/UnionClient.php index 4a1d8c011f7..fb5a763c133 100644 --- a/seed/php-sdk/undiscriminated-unions/src/Union/UnionClient.php +++ b/seed/php-sdk/undiscriminated-unions/src/Union/UnionClient.php @@ -12,6 +12,7 @@ use Seed\Core\Types\Union; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Union\Types\KeyType; @@ -79,6 +80,16 @@ public function get(string|array|int $request, ?array $options = null): string|a } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -117,6 +128,16 @@ public function getMetadata(?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/unions/src/Union/UnionClient.php b/seed/php-sdk/unions/src/Union/UnionClient.php index 5b2ab08e25f..7ec7bf1eca1 100644 --- a/seed/php-sdk/unions/src/Union/UnionClient.php +++ b/seed/php-sdk/unions/src/Union/UnionClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UnionClient @@ -75,6 +76,16 @@ public function get(string $id, ?array $options = null): mixed } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -115,6 +126,16 @@ public function update(mixed $request, ?array $options = null): bool } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/unknown/src/Unknown/UnknownClient.php b/seed/php-sdk/unknown/src/Unknown/UnknownClient.php index ab324a5a52f..ae556f33e01 100644 --- a/seed/php-sdk/unknown/src/Unknown/UnknownClient.php +++ b/seed/php-sdk/unknown/src/Unknown/UnknownClient.php @@ -10,6 +10,7 @@ use Seed\Core\Client\HttpMethod; use Seed\Core\Json\JsonDecoder; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Unknown\Types\MyObject; @@ -77,6 +78,16 @@ public function post(mixed $request, ?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -117,6 +128,16 @@ public function postObject(MyObject $request, ?array $options = null): array } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/validation/src/SeedClient.php b/seed/php-sdk/validation/src/SeedClient.php index aa4b42994c8..72a3c01685f 100644 --- a/seed/php-sdk/validation/src/SeedClient.php +++ b/seed/php-sdk/validation/src/SeedClient.php @@ -11,6 +11,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; use Seed\Requests\GetRequest; @@ -90,6 +91,16 @@ public function create(CreateRequest $request, ?array $options = null): Type } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } @@ -134,6 +145,16 @@ public function get(GetRequest $request, ?array $options = null): Type } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/variables/src/Service/ServiceClient.php b/seed/php-sdk/variables/src/Service/ServiceClient.php index ce432114198..b47e1618bb1 100644 --- a/seed/php-sdk/variables/src/Service/ServiceClient.php +++ b/seed/php-sdk/variables/src/Service/ServiceClient.php @@ -8,6 +8,7 @@ use Seed\Exceptions\SeedApiException; use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class ServiceClient @@ -69,6 +70,16 @@ public function post(string $endpointParam, ?array $options = null): void if ($statusCode >= 200 && $statusCode < 400) { return; } + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/version-no-default/src/User/UserClient.php b/seed/php-sdk/version-no-default/src/User/UserClient.php index 2b88fedd84b..6b9ca69d7fb 100644 --- a/seed/php-sdk/version-no-default/src/User/UserClient.php +++ b/seed/php-sdk/version-no-default/src/User/UserClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -75,6 +76,16 @@ public function getUser(string $userId, ?array $options = null): User } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); } diff --git a/seed/php-sdk/version/src/User/UserClient.php b/seed/php-sdk/version/src/User/UserClient.php index 2b88fedd84b..6b9ca69d7fb 100644 --- a/seed/php-sdk/version/src/User/UserClient.php +++ b/seed/php-sdk/version/src/User/UserClient.php @@ -10,6 +10,7 @@ use Seed\Core\Json\JsonApiRequest; use Seed\Core\Client\HttpMethod; use JsonException; +use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; class UserClient @@ -75,6 +76,16 @@ public function getUser(string $userId, ?array $options = null): User } } catch (JsonException $e) { throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SeedException(message: $e->getMessage(), previous: $e); + } + throw new SeedApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); } catch (ClientExceptionInterface $e) { throw new SeedException(message: $e->getMessage(), previous: $e); }