-module(oaspec@codegen@context). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/oaspec/codegen/context.gleam"). -export([new/2, spec/1, config/1]). -export_type([context/0, file_target/0, generated_file/0]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. -opaque context() :: {context, oaspec@openapi@spec:open_api_spec(oaspec@openapi@spec:resolved()), oaspec@config:config()}. -type file_target() :: shared_target | server_target | client_target. -type generated_file() :: {generated_file, binary(), binary(), file_target()}. -file("src/oaspec/codegen/context.gleam", 19). ?DOC(" Create a new generation context from a resolved spec.\n"). -spec new( oaspec@openapi@spec:open_api_spec(oaspec@openapi@spec:resolved()), oaspec@config:config() ) -> context(). new(Spec, Config) -> {context, Spec, Config}. -file("src/oaspec/codegen/context.gleam", 24). ?DOC(" The resolved OpenAPI spec this context wraps.\n"). -spec spec(context()) -> oaspec@openapi@spec:open_api_spec(oaspec@openapi@spec:resolved()). spec(Ctx) -> erlang:element(2, Ctx). -file("src/oaspec/codegen/context.gleam", 29). ?DOC(" The generation config this context wraps.\n"). -spec config(context()) -> oaspec@config:config(). config(Ctx) -> erlang:element(3, Ctx).