@fern-api/csharp-dynamic-snippets 2.57.0-rc.0 → 2.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -30,7 +30,7 @@ ${ki(this).map(r=>` ${r.fn} - ${r.path}:${r.position}`).join(`
30
30
  `),r.writeTextStatement("set"),r.writeNoIndent(`#endif
31
31
  `)):(this.hasSameAccess(this.init)||r.write(`${this.init} `),this.accessors?.init?(r.write("init"),r.write(" => "),this.accessors.init(r),r.writeTextStatement("")):r.write("init; "))),this.set&&(this.hasSameAccess(this.set)||r.write(`${this.set} `),this.accessors?.set?(r.write("set"),r.write(" => "),this.accessors.set(r),r.writeTextStatement("")):r.write("set; ")),r.write("}")),this.initializer!=null?(c?r.write(" => "):r.write(" = "),this.initializer.write(r),r.writeLine(";")):!this.skipDefaultInitializer&&!i&&o?V.Type(this.type)&&this.type.writeEmptyCollectionInitializer(r):!this.get&&!this.init&&r.writeLine(";")}hasSameAccess(r){return r===!0||r===this.access}};n();a();s();var Qe;(function(e){e[e.INSTANCE=0]="INSTANCE",e[e.STATIC=1]="STATIC"})(Qe||(Qe={}));var Ft=class e extends bt{constructor({name:r,isAsync:i,override:o,access:c,return_:l,body:S,noBody:w,bodyType:I,summary:A,doc:P,type:L,classReference:R,parameters:j,typeParameters:M,annotations:D,codeExample:G,interfaceReference:K,origin:oe,enclosingType:Q},X){super({enclosingType:Q},oe,X);y(this,"name");y(this,"isAsync");y(this,"access");y(this,"return");y(this,"noBody");y(this,"body");y(this,"bodyType");y(this,"summary");y(this,"doc");y(this,"type");y(this,"reference");y(this,"override");y(this,"parameters");y(this,"typeParameters");y(this,"annotations");y(this,"interfaceReference");this.name=r,this.isAsync=i??!1,this.override=o??!1,this.access=c,this.return=l,this.noBody=w??!1,this.body=S,this.bodyType=I??e.BodyType.Statement,this.summary=A,this.doc=this.csharp.xmlDocBlockOf(P??{summary:A,codeExample:G}),this.type=L??Qe.INSTANCE,this.reference=R,this.parameters=j??[],this.typeParameters=M??[],this.annotations=(D??[]).map(C=>C instanceof _e?this.csharp.annotation({reference:C}):C),this.interfaceReference=K}get isAsyncEnumerable(){return V.AsyncEnumerable(this.return)}addParameter(r){return r instanceof Ke||(r=new Ke(r,this.generation)),this.parameters.push(r),r}write(r){if(r.writeNode(this.doc),this.annotations.forEach(i=>{i.write(r)}),r.writeNewLineIfLastLineNot(),this.access&&r.write(`${this.access} `),this.type===Qe.STATIC&&r.write("static "),this.isAsync&&r.write("async "),this.override&&r.write("override "),this.return==null?this.isAsync?(r.writeNode(this.System.Threading.Tasks.Task()),r.write(" ")):r.write("void "):(this.isAsync&&!this.isAsyncEnumerable?r.writeNode(this.System.Threading.Tasks.Task(this.return)):this.return.write(r),r.write(" ")),this.interfaceReference&&r.write(`${this.interfaceReference.name}.`),r.write(this.name),this.typeParameters.length>0&&(r.write("<"),this.typeParameters.forEach((i,o)=>{i.write(r),o<this.typeParameters.length-1&&r.write(", ")}),r.write(">")),r.write("("),this.parameters.forEach((i,o)=>{i.write(r),o<this.parameters.length-1&&r.write(", ")}),r.write(")"),this.noBody)r.writeLine(";");else switch(this.bodyType){case e.BodyType.Statement:r.write(" "),r.pushScope(),this.body?.write(r),r.popScope();break;case e.BodyType.Expression:r.write(" => "),this.body?.write(r),r.writeSemicolonIfLastCharacterIsNot();break;default:ce(this.bodyType)}}getParameters(){return this.parameters}};(function(e){e.BodyType={Statement:"statement",Expression:"expression"}})(Ft||(Ft={}));var Kr=class extends Be{constructor({name:r,namespace:i,access:o,partial:c,interfaceReferences:l,enclosingType:S,origin:w},I){super(w,I);y(this,"access");y(this,"partial");y(this,"reference");y(this,"interfaceReferences");y(this,"fields",[]);y(this,"methods",[]);r=r||(w?this.model.getClassNameFor(w):de("Class/Interface name or origin is required")),this.reference=S?this.csharp.classReference({name:r,enclosingType:S}):this.csharp.classReference({name:r,namespace:i||de("Class/Interface: Namespace or enclosingType is required ")}),this.access=o,this.partial=c??!1,this.interfaceReferences=l??[]}get name(){return this.reference.name}get namespace(){return this.reference.namespace}get enclosingType(){return this.reference.enclosingType}get isNested(){return this.enclosingType!=null}explicit(r){return this.origin?this.model.explicit(V.Provenance(this.origin)?this.origin.node:this.origin,r):de(`Cannot create explicit named member '${r}' on '${this.name}' because the class is not bound to an origin.`)}getField(r){return this.fields.find(i=>this.model.provenance(i.origin)?.jsonPath===r.jsonPath)}addField(r){r.enclosingType=this.reference;let i=new Jr(r,this.generation);return this.fields.push(i),i}addMethod(r){r.enclosingType=this.reference;let i=new Ft(r,this.generation);return this.methods.push(i),i}get multipartMethodName(){return"AddJsonPart"}get multipartMethodNameForCollection(){return"AddJsonParts"}get isOptional(){return!1}get isCollection(){return!1}get isReferenceType(){}asOptional(){return new ze(this,this.generation)}asNullable(){return new er(this,this.generation)}asNonOptional(){return this}get defaultValue(){return this.csharp.Literal.null()}get fullyQualifiedName(){return this.reference.fullyQualifiedName}};var Ve=class Ve extends Kr{constructor({name:r,namespace:i,access:o,static_:c,abstract_:l,sealed:S,partial:w,readonly:I,parentClassReference:A,interfaceReferences:P,enclosingType:L,type:R,summary:j,doc:M,annotations:D,primaryConstructor:G,origin:K},oe){super({name:r,namespace:i,access:o,partial:w,interfaceReferences:P,enclosingType:L,origin:K},oe);y(this,"static_");y(this,"abstract_");y(this,"sealed");y(this,"readonly");y(this,"parentClassReference");y(this,"type");y(this,"summary");y(this,"doc");y(this,"annotations",[]);y(this,"primaryConstructor");y(this,"namespaceReferences",[]);y(this,"constructors",[]);y(this,"operators",[]);y(this,"nestedClasses",[]);y(this,"nestedInterfaces",[]);y(this,"rawBodyBlocks",[]);this.static_=c??!1,this.abstract_=l??!1,this.sealed=S??!1,this.readonly=I??!1,this.type=R??Ve.ClassType.Class,this.summary=j,this.doc=this.csharp.xmlDocBlockOf(M??{summary:j}),this.parentClassReference=A,this.annotations=(D??[]).map(Q=>Q instanceof _e?this.csharp.annotation({reference:Q}):Q),this.primaryConstructor=G}addConstructor(r){let i=new Ve.Constructor(r,this.generation);return this.constructors.push(i),i}addNestedClass(r){if(r instanceof Ve||(r.enclosingType=this.reference,r=new Ve(r,this.generation)),!r.isNested)throw new Error(`Set the enclosingType of the class ${this.name} to add the nested class ${r.name}.`);return this.nestedClasses.push(r),r}addNestedClasses(r){r.forEach(i=>{i instanceof Ve?this.addNestedClass(i):this.addNestedClass(i)})}addAnnotation(r){return r instanceof ft||(r=new ft(r,this.generation)),this.annotations.push(r),r}addOperator(r){this.operators.push(r)}addOperators(r){r.forEach(i=>this.addOperator(i))}addRawBodyContent(r){this.rawBodyBlocks.push(r)}write(r){if(this.namespaceReferences.forEach(i=>{r.addNamespace(i)}),this.isNested||(r.writeLine(`namespace ${this.namespace};`),r.newLine()),r.writeNode(this.doc),this.annotations.forEach(i=>{i.write(r)}),r.writeNewLineIfLastLineNot(),r.write(`${this.access}`),this.static_&&r.write(" static"),this.abstract_&&r.write(" abstract"),this.sealed&&r.write(" sealed"),this.readonly&&r.write(" readonly"),this.partial&&r.write(" partial"),r.write(` ${this.type}`),r.write(` ${this.name}`),this.primaryConstructor!=null&&this.primaryConstructor.parameters.length>0){let i=this.primaryConstructor;r.write("("),i.parameters.forEach((o,c)=>{c>0&&r.write(","),o.write(r)}),r.write(")")}if(this.parentClassReference!=null||this.interfaceReferences.length>0){if(r.write(" : "),this.parentClassReference!=null&&(this.parentClassReference.write(r),this.interfaceReferences.length>0&&r.write(", ")),this.primaryConstructor!=null&&this.primaryConstructor.superClassArguments.length>0){let i=this.primaryConstructor;r.write("("),this.primaryConstructor.superClassArguments.forEach((o,c)=>{o.write(r),c<i.superClassArguments.length-1&&r.write(", ")}),r.write(")")}this.interfaceReferences.forEach((i,o)=>{i.write(r),o<this.interfaceReferences.length-1&&r.write(", ")})}if(!this.hasBody()){r.write(";");return}r.writeNewLineIfLastLineNot(),r.pushScope(),this.writeConsts(r),this.writeFieldFields(r),this.writeConstructors(r),this.writeProperties(r),this.writeMethods(r),this.writeOperators(r),this.writeRawBodyBlocks(r),this.writeNestedClasses(r),this.writeNestedInterfaces(r),r.popScope()}hasBody(){return this.fields.length>0||this.constructors.length>0||this.nestedClasses.length>0||this.nestedInterfaces.length>0||this.methods.length>0||this.operators.length>0||this.rawBodyBlocks.length>0}writeConstructors(r){this.constructors.forEach(i=>{r.writeNode(this.csharp.xmlDocBlockOf(i.doc)),i.annotations.forEach(o=>{o.write(r),r.writeNewLineIfLastLineNot()}),r.write(`${i.access} ${this.name} (`),i.parameters.forEach((o,c)=>{o.write(r),c<i.parameters.length-1&&r.write(", ")}),r.write(")"),i.baseConstructorCall!=null&&(r.write(" : "),i.baseConstructorCall.write(r)),r.pushScope(),i.body.write(r),r.popScope(),r.newLine()})}writeFields({writer:r,fields:i}){i.forEach((o,c)=>{o.write(r),r.writeNewLineIfLastLineNot(),c<this.fields.length-1&&r.newLine()})}writeConsts(r){this.writeFields({writer:r,fields:this.getFields().sort(Qr).sort(fu).filter(this.fieldConstFilter())})}writeFieldFields(r){this.writeFields({writer:r,fields:this.getFields().sort(Qr).sort(fu).filter(this.fieldFieldFilter())})}writeProperties(r){this.writeFields({writer:r,fields:this.getFields().sort(Qr).sort(fu).filter(this.fieldPropertyFilter())})}writeMethods(r){this.methods.sort(Qr).sort(ry).sort(ty).forEach(i=>{i.write(r),r.writeNewLineIfLastLineNot(),r.newLine()})}writeOperators(r){this.operators.forEach(i=>{this.writeOperator({writer:r,operator:i}),r.newLine()})}writeRawBodyBlocks(r){this.rawBodyBlocks.forEach(i=>{i.write(r),r.writeNewLineIfLastLineNot()})}writeNestedClasses(r){this.nestedClasses.sort(Qr).forEach((i,o)=>{i.write(r),r.writeNewLineIfLastLineNot(),o<this.fields.length-1&&r.newLine()})}writeNestedInterfaces(r){this.nestedInterfaces.sort(Qr).forEach((i,o)=>{i.write(r),r.writeNewLineIfLastLineNot(),o<this.fields.length-1&&r.newLine()})}fieldConstFilter(){return r=>r.isConst}fieldFieldFilter(){return r=>r.isField}fieldPropertyFilter(){return r=>r.isProperty}getFields(){return this.fields}get isReferenceType(){return this.type===Ve.ClassType.Class||this.type===Ve.ClassType.Record}writeOperator({writer:r,operator:i}){if(r.write("public static "),i.type===Ve.CastOperator.Type.Explicit||i.type===Ve.CastOperator.Type.Implicit){r.write(`${i.type} `),r.write("operator ");let o=i.to??this.reference;r.writeNode(o),r.write("("),i.parameter.write(r)}else{let o=i;o.return.write(r),r.write(" operator "),r.write(`${i.type}(`),o.parameters.forEach((c,l)=>{c.write(r),l<o.parameters.length-1&&r.write(", ")})}i.useExpressionBody?(r.write(") => "),r.writeNodeStatement(i.body)):(r.write(") {"),r.writeNode(i.body),r.writeLine("}"))}addNamespaceReference(r){this.namespaceReferences.push(r)}};y(Ve,"ClassType",{Class:"class",Record:"record",Struct:"struct",RecordStruct:"record struct"}),y(Ve,"Access",ge);var rt=Ve;(function(e){class t{constructor({doc:o,body:c,parameters:l,access:S,baseConstructorCall:w,annotations:I},A){y(this,"generation");y(this,"doc");y(this,"body");y(this,"parameters");y(this,"access");y(this,"baseConstructorCall");y(this,"annotations");this.generation=A,this.parameters=l??[],this.access=S??ge.Public,this.doc=o,this.annotations=I??[],this.body=new Pt({},this.generation),c!=null&&this.body.append(c),this.baseConstructorCall=w}addParameter(o){let c=new Ke(o,this.generation);return this.parameters.push(c),c}}e.Constructor=t;let r;(function(i){i.Type={Implicit:"implicit",Explicit:"explicit"}})(r=e.CastOperator||(e.CastOperator={}))})(rt||(rt={}));function xf(e){switch(e){case void 0:return 0;case ge.Private:return 1;case ge.Protected:return 2;case ge.Internal:return 3;case ge.Public:return 4}}function Qr(e,t){return xf(e.access)-xf(t.access)}function fu(e,t){return e.isStatic===t.isStatic?0:e.isStatic?-1:1}function ty(e,t){return e.type===Qe.STATIC&&t.type!==Qe.STATIC?-1:e.type!==Qe.STATIC&&t.type===Qe.STATIC?1:0}function ry(e,t){return e.name==="FromProto"||e.name==="ToProto"?t.name==="Equals"||t.name==="ToString"?-1:1:t.name==="FromProto"||t.name==="ToProto"?e.name==="Equals"||e.name==="ToString"?1:-1:e.name==="ToString"?1:t.name==="ToString"?-1:e.name==="Equals"?t.name==="ToString"?-1:1:t.name==="Equals"?e.name==="ToString"?1:-1:0}n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();var iy="__package__",uF=`${iy}.yml`;var Sf="default-group",wf="spec-origin",Tf="async-api",Ef="openapi",Af="openapi-overrides",If="api-settings";var Nf="local";var $e={};z($e,{API_ORIGIN_LOCATION_KEY:()=>wf,API_SETTINGS_KEY:()=>If,ASYNC_API_LOCATION_KEY:()=>Tf,CoerceConstsTo:()=>Vf,DEFAULT_GROUP_GENERATORS_CONFIG_KEY:()=>Sf,DEFAULT_GROUP_NAME:()=>Nf,DefaultIntegerFormat:()=>vf,ExampleStyle:()=>zf,FormParameterEncoding:()=>qf,GenerationLanguage:()=>Rf,GithubCommitAndReleaseMode:()=>Kf,GithubLicenseType:()=>Yf,GithubSelfhostedMode:()=>Qf,Language:()=>Gf,MessageNamingSettingsSchema:()=>Wf,ModelProvider:()=>Cf,OPENAPI_LOCATION_KEY:()=>Ef,OPENAPI_OVERRIDES_LOCATION_KEY:()=>Af,PathParameterOrder:()=>$f,RemoveDiscriminantsFromSchemas:()=>Hf,UnionSettingsSchema:()=>Jf,ai:()=>mu,fernDefinition:()=>hu,generators:()=>yu,getPackageName:()=>Of,group:()=>gu,isApiConfigurationV2Schema:()=>Om,isAsyncApiSpecSchema:()=>Pm,isConjureSchema:()=>Cm,isGraphQLSpecSchema:()=>_m,isNamespacedApiConfiguration:()=>km,isOpenApiSpecSchema:()=>Fm,isOpenRpcSpecSchema:()=>Lm,isProtoSpecSchema:()=>jm,isRawProtobufAPIDefinitionSchema:()=>Pf,license:()=>bu,replay:()=>Xf,reviewers:()=>Zf,serialization:()=>Vu});n();a();s();n();a();s();var Rf={TYPESCRIPT:"typescript",JAVA:"java",PYTHON:"python",GO:"go",RUBY:"ruby",CSHARP:"csharp",SWIFT:"swift",PHP:"php",RUST:"rust"};function Of({generatorInvocation:e}){return e.language==="go"?ny(e):e.outputMode._visit({downloadFiles:()=>{},github:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),githubV2:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),publish:()=>{},publishV2:()=>{},_other:()=>{}})}function ny(e){return e.outputMode._visit({downloadFiles:()=>{},github:t=>`github.com/${t.owner}/${t.repo}`,githubV2:t=>`github.com/${t.owner}/${t.repo}`,publish:()=>{},publishV2:()=>{},_other:()=>{}})}n();a();s();function Pf(e){return typeof e!="string"&&"proto"in e}n();a();s();n();a();s();var mu={};z(mu,{ModelProvider:()=>Cf});n();a();s();n();a();s();var Cf={Openai:"openai",Anthropic:"anthropic",Bedrock:"bedrock"};var hu={};z(hu,{AvailabilityStatusSchema:()=>kf,auth:()=>_f,availability:()=>du,commons:()=>Ff,encoding:()=>Lf,environments:()=>jf,file:()=>Bf,service:()=>Df,types:()=>Uf,validation:()=>Mf});n();a();s();n();a();s();var _f={};n();a();s();var du={};z(du,{AvailabilityStatusSchema:()=>kf});n();a();s();n();a();s();var kf={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available"};var Ff={};n();a();s();var Lf={};n();a();s();var jf={};n();a();s();var Bf={};n();a();s();var Df={};n();a();s();var Uf={};n();a();s();var Mf={};n();a();s();var yu={};z(yu,{CoerceConstsTo:()=>Vf,DefaultIntegerFormat:()=>vf,ExampleStyle:()=>zf,FormParameterEncoding:()=>qf,Language:()=>Gf,MessageNamingSettingsSchema:()=>Wf,PathParameterOrder:()=>$f,RemoveDiscriminantsFromSchemas:()=>Hf,UnionSettingsSchema:()=>Jf});n();a();s();n();a();s();var Vf={Literals:"literals",Enums:"enums",EnumsCoerceableToLiterals:"enums-coerceable-to-literals"};n();a();s();var vf={Int32:"int32",Int64:"int64",Uint32:"uint32",Uint64:"uint64"};n();a();s();var zf={Minimal:"minimal",Comprehensive:"comprehensive"};n();a();s();var qf={Form:"form",Json:"json"};n();a();s();var Gf={Java:"java",Python:"python",Go:"go",Ruby:"ruby",Csharp:"csharp",Typescript:"typescript",Php:"php",Rust:"rust",Swift:"swift"};n();a();s();var Wf={V1:"v1",V2:"v2"};n();a();s();var $f={UrlOrder:"url-order",SpecOrder:"spec-order"};n();a();s();var Hf={Always:"always",Never:"never"};n();a();s();var Jf={V1:"v1"};var gu={};z(gu,{GithubCommitAndReleaseMode:()=>Kf,GithubSelfhostedMode:()=>Qf});n();a();s();n();a();s();var Kf={Commit:"commit",Release:"release"};n();a();s();var Qf={PullRequest:"pull-request",Push:"push"};var bu={};z(bu,{GithubLicenseType:()=>Yf});n();a();s();n();a();s();var Yf={Mit:"MIT",Apache:"Apache-2.0"};var Xf={};n();a();s();var Zf={};n();a();s();var Vu={};z(Vu,{AiServicesSchema:()=>ds,ApiConfigurationSchema:()=>xa,ApiConfigurationSchemaInternal:()=>mi,ApiConfigurationV2Schema:()=>ga,ApiConfigurationV2SettingsSchema:()=>yi,ApiConfigurationV2SpecsSchema:()=>gi,ApiDefinitionList:()=>ra,ApiDefinitionPathSchema:()=>Dt,ApiDefinitionSchema:()=>ta,ApiDefinitionSettingsSchema:()=>ci,ApiDefinitionWithOverridesSchema:()=>pi,AsyncApiSettingsSchema:()=>hi,AsyncApiSpecSchema:()=>la,BaseApiSettingsSchema:()=>di,BaseGeneratorInvocationSchema:()=>bi,CoerceConstsTo:()=>ia,ConjureSchema:()=>pa,CratesOutputLocationSchema:()=>Aa,CustomGeneratorInvocationSchema:()=>Wa,DefaultGeneratorInvocationSchema:()=>$a,DefaultIntegerFormat:()=>na,ExampleStyle:()=>Sa,FormParameterEncoding:()=>sa,GeneratorApiSettingsSchema:()=>Ea,GeneratorGroupSchema:()=>Ja,GeneratorImageObjectSchema:()=>wa,GeneratorInvocationSchema:()=>Ha,GeneratorOutputSchema:()=>La,GeneratorPublishMetadataSchema:()=>An,GeneratorSnippetsSchema:()=>Da,GeneratorsConfigurationSchema:()=>Rm,GeneratorsOpenApiObjectSchema:()=>Qa,GeneratorsOpenApiSchema:()=>Ya,GithubCommitAndReleaseMode:()=>Ua,GithubCommitAndReleaseSchema:()=>Ma,GithubConfigurationSchema:()=>Ga,GithubLicenseCustomSchema:()=>ja,GithubLicenseSchema:()=>We,GithubLicenseType:()=>Ba,GithubPullRequestSchema:()=>Va,GithubPushSchema:()=>va,GithubSelfhostedMode:()=>za,GithubSelfhostedSchema:()=>qa,GraphQlSpecSchema:()=>fa,Language:()=>Xa,LocalFileSystemOutputLocationSchema:()=>Ia,MavenOutputLocationSchema:()=>Ra,MavenOutputSignatureSchema:()=>Na,MessageNamingSettingsSchema:()=>ai,ModelName:()=>fs,ModelProvider:()=>ms,NamespacedApiConfigurationSchema:()=>ba,NpmOutputLocationSchema:()=>Oa,NugetOutputLocationSchema:()=>Pa,OpenApiExampleGenerationSchema:()=>aa,OpenApiFilterSchema:()=>oa,OpenApiSettingsSchema:()=>Ut,OpenApiSpecSchema:()=>ma,OpenRpcSpecSchema:()=>da,OutputMetadataAuthor:()=>Ta,OutputMetadataSchema:()=>Mt,OverridesSchema:()=>Ge,PathParameterOrder:()=>oi,PostmanOutputLocationSchema:()=>Ca,ProtobufApiDefinitionSchema:()=>fi,ProtobufDefinitionSchema:()=>li,ProtobufSpecSchema:()=>ha,PypiOutputLocationSchema:()=>ka,PypiOutputMetadataSchema:()=>_a,ReadmeCustomSectionSchema:()=>Za,ReadmeEndpointObjectSchema:()=>eo,ReadmeEndpointSchema:()=>In,ReadmeSchema:()=>to,RemoveDiscriminantsFromSchemas:()=>ui,ReplayConfigSchema:()=>Ka,RequestOrResponseExampleGenerationSchema:()=>Tn,ResolveAliases:()=>ca,ResolveAliasesSchema:()=>ua,ReviewerSchema:()=>En,ReviewersSchema:()=>Vt,RubyGemsOutputLocationSchema:()=>Fa,SpecSchema:()=>ya,UnionSettingsSchema:()=>ea,WhitelabelConfigurationSchema:()=>io,WhitelabelGithubConfigurationSchema:()=>ro,ai:()=>Au,fernDefinition:()=>Lu,generators:()=>ju,group:()=>Bu,license:()=>Du,replay:()=>Uu,reviewers:()=>Mu});n();a();s();n();a();s();var Au={};z(Au,{AiServicesSchema:()=>ds,ModelName:()=>fs,ModelProvider:()=>ms});n();a();s();n();a();s();n();a();s();var p={};z(p,{JsonError:()=>Yr,ParseError:()=>Xr,any:()=>mm,bigint:()=>tm,boolean:()=>dm,booleanLiteral:()=>lm,date:()=>rm,discriminant:()=>Am,enum_:()=>cs,getObjectLikeUtils:()=>Ye,getObjectUtils:()=>rr,getSchemaUtils:()=>ae,isProperty:()=>dt,lazy:()=>im,lazyObject:()=>cm,list:()=>ls,never:()=>hm,number:()=>ym,object:()=>ps,objectWithoutOptionalProperties:()=>um,optional:()=>xu,property:()=>sm,record:()=>Sm,set:()=>wm,string:()=>gm,stringLiteral:()=>fm,transform:()=>Su,undiscriminatedUnion:()=>Em,union:()=>Nm,unknown:()=>bm,withParsedProperties:()=>Eu});n();a();s();n();a();s();n();a();s();n();a();s();var H={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};n();a();s();function se(e,t){return`Expected ${t}. Received ${sy(e)}.`}function sy(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}n();a();s();function Te(e){return{...e,json:em(e.json),parse:em(e.parse)}}function em(e){return(t,r)=>{let i=e(t,r),{skipValidation:o=!1}=r??{};return!i.ok&&o?(console.warn(["Failed to validate.",...i.errors.map(c=>" - "+(c.path.length>0?`${c.path.join(".")}: ${c.message}`:c.message))].join(`
32
32
  `)),{ok:!0,value:t}):i}}n();a();s();n();a();s();n();a();s();n();a();s();function us(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var Yr=class e extends Error{constructor(r){super(r.map(us).join("; "));y(this,"errors");this.errors=r,Object.setPrototypeOf(this,e.prototype)}};n();a();s();var Xr=class e extends Error{constructor(r){super(r.map(us).join("; "));y(this,"errors");this.errors=r,Object.setPrototypeOf(this,e.prototype)}};function ae(e){return{nullable:()=>ay(e),optional:()=>xu(e),optionalNullable:()=>oy(e),transform:t=>Su(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new Xr(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new Yr(i.errors)}}}function ay(e){let t={parse:(r,i)=>r==null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>H.NULLABLE};return{...t,...ae(t)}}function xu(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>H.OPTIONAL};return{...t,...ae(t)}}function oy(e){let t={parse:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,i),getType:()=>H.OPTIONAL_NULLABLE};return{...t,...ae(t)}}function Su(e,t){let r={parse:(i,o)=>{let c=e.parse(i,o);return c.ok?{ok:!0,value:t.transform(c.value)}:c},json:(i,o)=>{let c=t.untransform(i);return e.json(c,o)},getType:()=>e.getType()};return{...r,...ae(r)}}function tm(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:se(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:se(t,"bigint")}]}:{ok:!0,value:t},getType:()=>H.BIGINT};return{...Te(e),...ae(e)}}n();a();s();n();a();s();var uy=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function rm(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:se(t,"string")}]}:uy.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:se(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:se(t,"Date object")}]},getType:()=>H.DATE};return{...Te(e),...ae(e)}}n();a();s();n();a();s();n();a();s();function Ee(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...Te(r),...ae(r)}}}function cs(e){let t=new Set(e);return Ee(H.ENUM,(i,{allowUnrecognizedEnumValues:o,breadcrumbsPrefix:c=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:c,message:se(i,"string")}]}:!t.has(i)&&!o?{ok:!1,errors:[{path:c,message:se(i,"enum")}]}:{ok:!0,value:i})()}n();a();s();n();a();s();function im(e){let t=wu(e);return{...t,...ae(t)}}function wu(e){return{parse:(t,r)=>Zr(e).parse(t,r),json:(t,r)=>Zr(e).json(t,r),getType:()=>Zr(e).getType()}}function Zr(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}n();a();s();n();a();s();n();a();s();n();a();s();function Tu(e){return Object.entries(e)}n();a();s();function Sn(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[o,c])=>(r.has(o)&&(i[o]=c),i),{})}n();a();s();function mt(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}n();a();s();function wn(e){return Object.keys(e)}n();a();s();function nm(e,t){let r=[],i=[];for(let o of e)t(o)?r.push(o):i.push(o);return[r,i]}n();a();s();n();a();s();var cy=Object.prototype.hasOwnProperty;function Ye(e){return{withParsedProperties:t=>Eu(e,t)}}function Eu(e,t){let r={parse:(i,o)=>{let c=e.parse(i,o);if(!c.ok)return c;let l={};for(let S in t)if(cy.call(t,S)){let w=t[S];l[S]=typeof w=="function"?w(c.value):w}return{ok:!0,value:{...c.value,...l}}},json:(i,o)=>{if(!mt(i))return{ok:!1,errors:[{path:o?.breadcrumbsPrefix??[],message:se(i,"object")}]};let c=new Set(Object.keys(t)),l=Sn(i,Object.keys(i).filter(S=>!c.has(S)));return e.json(l,o)},getType:()=>e.getType()};return{...r,...ae(r),...Ye(r)}}n();a();s();function sm(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function dt(e){return e.isProperty}var py=Object.prototype.hasOwnProperty;function ps(e){let t;function r(){if(t==null){t={};for(let[L,R]of Tu(e)){let j=dt(R)?R.rawKey:L,M=dt(R)?R.valueSchema:R;t[j]={rawKey:j,parsedKey:L,valueSchema:M}}}return t}let i,o,c,l;function S(){if(i==null){i=[],o=[];for(let[L,R]of Tu(e)){let j=dt(R)?R.rawKey:L,M=dt(R)?R.valueSchema:R;ly(M)&&(i.push(j),o.push(L))}c=new Set(i),l=new Set(o)}return i}function w(){return o==null&&S(),o}function I(){return c==null&&S(),c}function A(){return l==null&&S(),l}let P={_getRawProperties:()=>Object.entries(e).map(([L,R])=>dt(R)?R.rawKey:L),_getParsedProperties:()=>wn(e),parse:(L,R)=>{let j=R?.breadcrumbsPrefix??[];return am({value:L,requiredKeys:S(),requiredKeysSet:I(),getProperty:M=>{let D=r()[M];if(D!=null)return{transformedKey:D.parsedKey,transform:G=>{let K=[...j,M];return D.valueSchema.parse(G,{...R,breadcrumbsPrefix:K})}}},unrecognizedObjectKeys:R?.unrecognizedObjectKeys,skipValidation:R?.skipValidation,breadcrumbsPrefix:j,omitUndefined:R?.omitUndefined})},json:(L,R)=>{let j=R?.breadcrumbsPrefix??[];return am({value:L,requiredKeys:w(),requiredKeysSet:A(),getProperty:M=>{let D=e[M];if(D!=null)return dt(D)?{transformedKey:D.rawKey,transform:G=>{let K=[...j,M];return D.valueSchema.json(G,{...R,breadcrumbsPrefix:K})}}:{transformedKey:M,transform:G=>{let K=[...j,M];return D.json(G,{...R,breadcrumbsPrefix:K})}}},unrecognizedObjectKeys:R?.unrecognizedObjectKeys,skipValidation:R?.skipValidation,breadcrumbsPrefix:j,omitUndefined:R?.omitUndefined})},getType:()=>H.OBJECT};return{...Te(P),...ae(P),...Ye(P),...rr(P)}}function am({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:i,unrecognizedObjectKeys:o="fail",skipValidation:c=!1,breadcrumbsPrefix:l=[]}){if(!mt(e))return{ok:!1,errors:[{path:l,message:se(e,"object")}]};let S=t.length,w=[],I={};for(let A in e){if(!py.call(e,A))continue;let P=e[A],L=i(A);if(L!=null){S>0&&r.has(A)&&S--;let R=L.transform(P);R.ok?I[L.transformedKey]=R.value:(I[A]=P,w.push(...R.errors))}else switch(o){case"fail":w.push({path:[...l,A],message:`Unexpected key "${A}"`});break;case"strip":break;case"passthrough":I[A]=P;break}}if(S>0)for(let A of t)A in e||w.push({path:l,message:`Missing required key "${A}"`});return w.length===0||c?{ok:!0,value:I}:{ok:!1,errors:w}}function rr(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,o)=>om({extensionKeys:t._getRawProperties(),value:i,transformBase:c=>e.parse(c,o),transformExtension:c=>t.parse(c,o),breadcrumbsPrefix:o?.breadcrumbsPrefix}),json:(i,o)=>om({extensionKeys:t._getParsedProperties(),value:i,transformBase:c=>e.json(c,o),transformExtension:c=>t.json(c,o),breadcrumbsPrefix:o?.breadcrumbsPrefix}),getType:()=>H.OBJECT};return{...r,...ae(r),...Ye(r),...rr(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),i={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(o,c)=>{let l=e.parse(o,{...c,unrecognizedObjectKeys:"passthrough"});if(!l.ok)return l;let S={};if(typeof o=="object"&&o!=null)for(let[w,I]of Object.entries(o))t.has(w)||(S[w]=I);return{ok:!0,value:{...S,...l.value}}},json:(o,c)=>{let l=e.json(o,{...c,unrecognizedObjectKeys:"passthrough"});if(!l.ok)return l;let S={};if(typeof o=="object"&&o!=null)for(let[w,I]of Object.entries(o))r.has(w)||(S[w]=I);return{ok:!0,value:{...S,...l.value}}},getType:()=>H.OBJECT};return{...i,...ae(i),...Ye(i),...rr(i)}}}}function om({extensionKeys:e,value:t,transformBase:r,transformExtension:i,breadcrumbsPrefix:o=[]}){if(!mt(t))return{ok:!1,errors:[{path:o,message:se(t,"object")}]};let c=new Set(e),[l,S]=nm(wn(t),A=>c.has(A)),w=r(Sn(t,S)),I=i(Sn(t,l));return w.ok&&I.ok?{ok:!0,value:{...w.value,...I.value}}:{ok:!1,errors:[...w.ok?[]:w.errors,...I.ok?[]:I.errors]}}function ly(e){return!fy(e)}function fy(e){switch(e.getType()){case H.ANY:case H.UNKNOWN:case H.OPTIONAL:case H.OPTIONAL_NULLABLE:return!0;default:return!1}}n();a();s();function um(e){return ps(e)}function cm(e){let t={...wu(e),_getRawProperties:()=>Zr(e)._getRawProperties(),_getParsedProperties:()=>Zr(e)._getParsedProperties()};return{...t,...ae(t),...Ye(t),...rr(t)}}n();a();s();n();a();s();function ls(e){let t={parse:(r,i)=>pm(r,(o,c)=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${c}]`]})),json:(r,i)=>pm(r,(o,c)=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${c}]`]})),getType:()=>H.LIST};return{...Te(t),...ae(t)}}function pm(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:se(e,"list"),path:[]}]};let r=[],i=[];for(let o=0;o<e.length;o++){let c=t(e[o],o);c.ok?r.push(c.value):i.push(...c.errors)}return i.length===0?{ok:!0,value:r}:{ok:!1,errors:i}}n();a();s();n();a();s();function lm(e){return Ee(H.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:se(r,`${e.toString()}`)}]})()}n();a();s();function fm(e){return Ee(H.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:se(r,`"${e}"`)}]})()}n();a();s();n();a();s();var mm=Ee(H.ANY,e=>({ok:!0,value:e}));n();a();s();var dm=Ee(H.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:se(e,"boolean")}]});n();a();s();var hm=Ee(H.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}));n();a();s();var ym=Ee(H.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:se(e,"number")}]});n();a();s();var gm=Ee(H.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:se(e,"string")}]});n();a();s();var bm=Ee(H.UNKNOWN,e=>({ok:!0,value:e}));n();a();s();n();a();s();var my=Object.prototype.hasOwnProperty;function Sm(e,t){let r={parse:(i,o)=>xm({value:i,isKeyNumeric:e.getType()===H.NUMBER,transformKey:c=>e.parse(c,{...o,breadcrumbsPrefix:[...o?.breadcrumbsPrefix??[],`${c} (key)`]}),transformValue:(c,l)=>t.parse(c,{...o,breadcrumbsPrefix:[...o?.breadcrumbsPrefix??[],`${l}`]}),breadcrumbsPrefix:o?.breadcrumbsPrefix}),json:(i,o)=>xm({value:i,isKeyNumeric:e.getType()===H.NUMBER,transformKey:c=>e.json(c,{...o,breadcrumbsPrefix:[...o?.breadcrumbsPrefix??[],`${c} (key)`]}),transformValue:(c,l)=>t.json(c,{...o,breadcrumbsPrefix:[...o?.breadcrumbsPrefix??[],`${l}`]}),breadcrumbsPrefix:o?.breadcrumbsPrefix}),getType:()=>H.RECORD};return{...Te(r),...ae(r)}}function xm({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:o=[]}){if(!mt(e))return{ok:!1,errors:[{path:o,message:se(e,"object")}]};let c={},l=[];for(let S in e){if(!my.call(e,S))continue;let w=e[S];if(w===void 0)continue;let I=S;if(t){let L=S.length>0?Number(S):NaN;Number.isNaN(L)||(I=L)}let A=r(I),P=i(w,I);A.ok&&P.ok?c[A.value]=P.value:(A.ok||l.push(...A.errors),P.ok||l.push(...P.errors))}return l.length===0?{ok:!0,value:c}:{ok:!1,errors:l}}n();a();s();n();a();s();function wm(e){let t=ls(e),r={parse:(i,o)=>{let c=t.parse(i,o);return c.ok?{ok:!0,value:new Set(c.value)}:c},json:(i,o)=>i instanceof Set?t.json([...i],o):{ok:!1,errors:[{path:o?.breadcrumbsPrefix??[],message:se(i,"Set")}]},getType:()=>H.SET};return{...Te(r),...ae(r)}}n();a();s();n();a();s();function Em(e){let t={parse:(r,i)=>Tm((o,c)=>o.parse(r,c),e,i),json:(r,i)=>Tm((o,c)=>o.json(r,c),e,i),getType:()=>H.UNDISCRIMINATED_UNION};return{...Te(t),...ae(t)}}function Tm(e,t,r){let i=[];for(let[o,c]of t.entries()){let l=e(c,{...r,skipValidation:!1});if(l.ok)return l;for(let S of l.errors)i.push({path:S.path,message:`[Variant ${o}] ${S.message}`})}return{ok:!1,errors:i}}n();a();s();n();a();s();function Am(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}n();a();s();var dy=Object.prototype.hasOwnProperty;function Nm(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,o=cs(wn(t)),c={parse:(l,S)=>Im({value:l,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:w=>o.parse(w,{allowUnrecognizedEnumValues:S?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...S?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:w=>t[w],allowUnrecognizedUnionMembers:S?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(w,I)=>I.parse(w,S),breadcrumbsPrefix:S?.breadcrumbsPrefix}),json:(l,S)=>Im({value:l,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:w=>o.json(w,{allowUnrecognizedEnumValues:S?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...S?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:w=>t[w],allowUnrecognizedUnionMembers:S?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(w,I)=>I.json(w,S),breadcrumbsPrefix:S?.breadcrumbsPrefix}),getType:()=>H.UNION};return{...Te(c),...ae(c),...Ye(c)}}function Im({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:o,allowUnrecognizedUnionMembers:c=!1,transformAdditionalProperties:l,breadcrumbsPrefix:S=[]}){if(!mt(e))return{ok:!1,errors:[{path:S,message:se(e,"object")}]};let w=e[t],I={};for(let R in e)dy.call(e,R)&&R!==t&&(I[R]=e[R]);if(w==null)return{ok:!1,errors:[{path:S,message:`Missing discriminant ("${t}")`}]};let A=i(w);if(!A.ok)return{ok:!1,errors:A.errors};let P=o(A.value);if(P==null)return c?{ok:!0,value:{[r]:A.value,...I}}:{ok:!1,errors:[{path:[...S,t],message:"Unexpected discriminant value"}]};let L=l(I,P);return L.ok?{ok:!0,value:{[r]:w,...L.value}}:L}n();a();s();var fs=p.string();n();a();s();var ms=p.enum_(["openai","anthropic","bedrock"]);var ds=p.object({provider:ms,model:fs});var Lu={};z(Lu,{AnyAuthItem:()=>hs,AnyAuthSchemesSchema:()=>ys,ApiAuthSchema:()=>ti,AuthSchemeDeclarationSchema:()=>jt,AuthSchemeReferenceSchema:()=>ei,AuthScope:()=>Rs,AuthVariable:()=>ir,AvailabilitySchema:()=>js,AvailabilityStatusSchema:()=>ii,AvailabilityUnionSchema:()=>Bs,BaseTypeReferenceSchema:()=>Ks,BasicAuthSchemeSchema:()=>xs,BearerAuthSchemeSchema:()=>Is,EncodingSchema:()=>Ms,EndpointSecuritySchema:()=>bs,EndpointSecuritySchemaDetails:()=>gs,EnvironmentSchema:()=>zs,HeaderAuthSchemeSchema:()=>Ns,HttpHeaderSchema:()=>si,InferredAuthenticatedRequestHeader:()=>Ss,InferredBearerAuthSchema:()=>Es,InferredGetTokenEndpointSchema:()=>Ts,InferredGetTokenEndpointSchemaObject:()=>ws,ListValidationSchema:()=>Gs,MapValidationSchema:()=>Ws,MultipleBaseUrlsEnvironmentSchema:()=>Vs,NumberValidationSchema:()=>$s,OAuthAccessTokenRequestPropertiesSchema:()=>Os,OAuthAccessTokenResponsePropertiesSchema:()=>Ps,OAuthGetTokenEndpointSchema:()=>Cs,OAuthRefreshTokenEndpointSchema:()=>Fs,OAuthRefreshTokenRequestPropertiesSchema:()=>_s,OAuthRefreshTokenResponsePropertiesSchema:()=>ks,OAuthSchemeSchema:()=>Ls,ProtobufTypeSchema:()=>Us,ServerVariableSchema:()=>ni,SingleBaseUrlEnvironmentSchema:()=>vs,StringValidationSchema:()=>Hs,TokenBearerAuthSchema:()=>As,TypeReferenceDeclarationWithEnvOverride:()=>Xs,TypeReferenceDeclarationWithEnvOverrideSchema:()=>Ys,TypeReferenceDeclarationWithName:()=>Qs,ValidationSchema:()=>Js,WithAudiences:()=>Bt,WithAvailability:()=>Ds,WithDocsSchema:()=>me,WithEnvironmentVariable:()=>ri,WithEnvironmentsSchema:()=>qs,WithHeadersSchema:()=>Zs,WithName:()=>Lt,auth:()=>Iu,availability:()=>Nu,commons:()=>Ru,encoding:()=>Ou,environments:()=>Pu,file:()=>Cu,service:()=>_u,types:()=>ku,validation:()=>Fu});n();a();s();n();a();s();var Iu={};z(Iu,{AnyAuthItem:()=>hs,AnyAuthSchemesSchema:()=>ys,ApiAuthSchema:()=>ti,AuthSchemeDeclarationSchema:()=>jt,AuthSchemeReferenceSchema:()=>ei,AuthScope:()=>Rs,AuthVariable:()=>ir,BasicAuthSchemeSchema:()=>xs,BearerAuthSchemeSchema:()=>Is,EndpointSecuritySchema:()=>bs,EndpointSecuritySchemaDetails:()=>gs,HeaderAuthSchemeSchema:()=>Ns,InferredAuthenticatedRequestHeader:()=>Ss,InferredBearerAuthSchema:()=>Es,InferredGetTokenEndpointSchema:()=>Ts,InferredGetTokenEndpointSchemaObject:()=>ws,OAuthAccessTokenRequestPropertiesSchema:()=>Os,OAuthAccessTokenResponsePropertiesSchema:()=>Ps,OAuthGetTokenEndpointSchema:()=>Cs,OAuthRefreshTokenEndpointSchema:()=>Fs,OAuthRefreshTokenRequestPropertiesSchema:()=>_s,OAuthRefreshTokenResponsePropertiesSchema:()=>ks,OAuthSchemeSchema:()=>Ls,TokenBearerAuthSchema:()=>As,WithEnvironmentVariable:()=>ri});n();a();s();n();a();s();n();a();s();n();a();s();var me=p.object({docs:p.string().optional()});var ei=p.object({scheme:p.string()}).extend(me);var hs=p.undiscriminatedUnion([p.string(),ei]);n();a();s();var ys=p.object({any:p.list(hs)}).extend(me);n();a();s();n();a();s();n();a();s();var gs=p.object({});var bs=p.object({"endpoint-security":gs}).extend(me);var ti=p.undiscriminatedUnion([p.string(),ei,ys,bs]);n();a();s();n();a();s();n();a();s();n();a();s();var Lt=p.object({name:p.string().optional()});n();a();s();var ri=p.object({env:p.string().optional()});var ir=p.object({omit:p.boolean().optional()}).extend(ri).extend(Lt);var xs=p.object({scheme:p.stringLiteral("basic"),username:ir.optional(),password:ir.optional()}).extend(me);n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();var Ss=p.object({"response-property":p.string(),"header-name":p.string(),"value-prefix":p.string().optional()});var ws=p.object({endpoint:p.string(),"expiry-response-property":p.string().optional(),"authenticated-request-headers":p.list(Ss).optional()});var Ts=p.undiscriminatedUnion([p.string(),ws]);var Es=p.object({scheme:p.stringLiteral("bearer"),"get-token":Ts}).extend(me);n();a();s();var As=p.object({scheme:p.stringLiteral("bearer"),token:ir.optional()}).extend(me);var Is=p.undiscriminatedUnion([As,Es]);n();a();s();var Ns=p.object({header:p.string(),type:p.string().optional(),prefix:p.string().optional()}).extend(ri).extend(Lt).extend(me);n();a();s();n();a();s();var Rs=p.string();n();a();s();n();a();s();var Os=p.object({"client-id":p.string().optional(),"client-secret":p.string().optional(),scopes:p.string().optional()});n();a();s();var Ps=p.object({"access-token":p.string().optional(),"expires-in":p.string().optional(),"refresh-token":p.string().optional()});var Cs=p.object({endpoint:p.string(),"request-properties":Os.optional(),"response-properties":Ps.optional()});n();a();s();n();a();s();var _s=p.object({"refresh-token":p.string()});n();a();s();var ks=p.object({"access-token":p.string().optional(),"expires-in":p.string().optional(),"refresh-token":p.string().optional()});var Fs=p.object({endpoint:p.string(),"request-properties":_s.optional(),"response-properties":ks.optional()});var Ls=p.object({scheme:p.stringLiteral("oauth"),type:p.stringLiteral("client-credentials"),scopes:p.list(Rs).optional(),"client-id-env":p.string().optional(),"client-secret-env":p.string().optional(),"token-prefix":p.string().optional(),"token-header":p.string().optional(),"get-token":Cs,"refresh-token":Fs.optional()}).extend(me);var jt=p.undiscriminatedUnion([Ls,Ns,xs,Is]);var Nu={};z(Nu,{AvailabilitySchema:()=>js,AvailabilityStatusSchema:()=>ii,AvailabilityUnionSchema:()=>Bs});n();a();s();n();a();s();n();a();s();var ii=p.enum_(["in-development","pre-release","deprecated","generally-available"]);var js=p.object({status:ii,message:p.string().optional()});n();a();s();var Bs=p.undiscriminatedUnion([ii,js]);var Ru={};z(Ru,{WithAudiences:()=>Bt,WithAvailability:()=>Ds,WithDocsSchema:()=>me,WithName:()=>Lt});n();a();s();n();a();s();var Bt=p.object({audiences:p.list(p.string()).optional()});n();a();s();var Ds=p.object({availability:Bs.optional()});var Ou={};z(Ou,{EncodingSchema:()=>Ms,ProtobufTypeSchema:()=>Us});n();a();s();n();a();s();n();a();s();var Us=p.object({type:p.string()});var Ms=p.object({proto:Us.optional()});var Pu={};z(Pu,{EnvironmentSchema:()=>zs,MultipleBaseUrlsEnvironmentSchema:()=>Vs,ServerVariableSchema:()=>ni,SingleBaseUrlEnvironmentSchema:()=>vs,WithEnvironmentsSchema:()=>qs});n();a();s();n();a();s();n();a();s();n();a();s();var ni=p.object({id:p.string(),default:p.string().optional(),values:p.list(p.string()).optional()});var Vs=p.object({urls:p.record(p.string(),p.string()),"url-templates":p.record(p.string(),p.string()).optional(),"default-urls":p.record(p.string(),p.string()).optional(),variables:p.record(p.string(),p.list(ni)).optional()}).extend(Bt).extend(me);n();a();s();var vs=p.object({url:p.string(),"default-url":p.string().optional(),"url-template":p.string().optional(),variables:p.list(ni).optional()}).extend(Bt).extend(me);var zs=p.undiscriminatedUnion([p.string(),vs,Vs]);n();a();s();var qs=p.object({"default-url":p.string().optional(),"default-environment":p.string().optional(),environments:p.record(p.string(),zs).optional()});var Cu={};z(Cu,{WithHeadersSchema:()=>Zs});n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();var Gs=p.object({minItems:p.number().optional(),maxItems:p.number().optional()});n();a();s();var Ws=p.object({minProperties:p.number().optional(),maxProperties:p.number().optional()});n();a();s();var $s=p.object({min:p.number().optional(),max:p.number().optional(),exclusiveMin:p.boolean().optional(),exclusiveMax:p.boolean().optional(),multipleOf:p.number().optional()});n();a();s();var Hs=p.object({minLength:p.number().optional(),maxLength:p.number().optional(),pattern:p.string().optional(),format:p.string().optional()});var Js=p.undiscriminatedUnion([Hs,$s,Gs,Ws]);var Ks=p.object({default:p.unknown().optional(),encoding:Ms.optional(),validation:Js.optional()}).extend(me).extend(Ds);var Qs=p.object({type:p.string()}).extend(Ks).extend(Lt).extend(Bt);var Ys=p.object({env:p.string().optional()}).extend(Qs);var Xs=p.undiscriminatedUnion([p.string(),Ys]);var si=Xs;var Zs=p.object({headers:p.record(p.string(),si).optional()});var _u={};z(_u,{HttpHeaderSchema:()=>si,TypeReferenceDeclarationWithEnvOverride:()=>Xs,TypeReferenceDeclarationWithEnvOverrideSchema:()=>Ys});n();a();s();var ku={};z(ku,{BaseTypeReferenceSchema:()=>Ks,TypeReferenceDeclarationWithName:()=>Qs});n();a();s();var Fu={};z(Fu,{ListValidationSchema:()=>Gs,MapValidationSchema:()=>Ws,NumberValidationSchema:()=>$s,StringValidationSchema:()=>Hs,ValidationSchema:()=>Js});n();a();s();var ju={};z(ju,{ApiConfigurationSchema:()=>xa,ApiConfigurationSchemaInternal:()=>mi,ApiConfigurationV2Schema:()=>ga,ApiConfigurationV2SettingsSchema:()=>yi,ApiConfigurationV2SpecsSchema:()=>gi,ApiDefinitionList:()=>ra,ApiDefinitionPathSchema:()=>Dt,ApiDefinitionSchema:()=>ta,ApiDefinitionSettingsSchema:()=>ci,ApiDefinitionWithOverridesSchema:()=>pi,AsyncApiSettingsSchema:()=>hi,AsyncApiSpecSchema:()=>la,BaseApiSettingsSchema:()=>di,CoerceConstsTo:()=>ia,ConjureSchema:()=>pa,DefaultIntegerFormat:()=>na,ExampleStyle:()=>Sa,FormParameterEncoding:()=>sa,GeneratorImageObjectSchema:()=>wa,GeneratorsConfigurationSchema:()=>Rm,GeneratorsOpenApiObjectSchema:()=>Qa,GeneratorsOpenApiSchema:()=>Ya,GraphQlSpecSchema:()=>fa,Language:()=>Xa,MessageNamingSettingsSchema:()=>ai,NamespacedApiConfigurationSchema:()=>ba,OpenApiExampleGenerationSchema:()=>aa,OpenApiFilterSchema:()=>oa,OpenApiSettingsSchema:()=>Ut,OpenApiSpecSchema:()=>ma,OpenRpcSpecSchema:()=>da,OutputMetadataAuthor:()=>Ta,OutputMetadataSchema:()=>Mt,OverridesSchema:()=>Ge,PathParameterOrder:()=>oi,ProtobufApiDefinitionSchema:()=>fi,ProtobufDefinitionSchema:()=>li,ProtobufSpecSchema:()=>ha,ReadmeCustomSectionSchema:()=>Za,ReadmeEndpointObjectSchema:()=>eo,ReadmeEndpointSchema:()=>In,ReadmeSchema:()=>to,RemoveDiscriminantsFromSchemas:()=>ui,RequestOrResponseExampleGenerationSchema:()=>Tn,ResolveAliases:()=>ca,ResolveAliasesSchema:()=>ua,SpecSchema:()=>ya,UnionSettingsSchema:()=>ea,WhitelabelConfigurationSchema:()=>io,WhitelabelGithubConfigurationSchema:()=>ro});n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();var Dt=p.string();n();a();s();n();a();s();n();a();s();var ai=p.enum_(["v1","v2"]);n();a();s();var oi=p.enum_(["url-order","spec-order"]);n();a();s();var ui=p.enum_(["always","never"]);n();a();s();var ea=p.enum_(["v1"]);var ci=p.object({"use-title":p.boolean().optional(),unions:ea.optional(),"message-naming":ai.optional(),"respect-nullable-schemas":p.boolean().optional(),"only-include-referenced-schemas":p.boolean().optional(),"inline-path-parameters":p.boolean().optional(),"idiomatic-request-names":p.boolean().optional(),"wrap-references-to-nullable-in-optional":p.boolean().optional(),"coerce-optional-schemas-to-nullable":p.boolean().optional(),"group-environments-by-host":p.boolean().optional(),"remove-discriminants-from-schemas":ui.optional(),"path-parameter-order":oi.optional()});n();a();s();var Ge=p.undiscriminatedUnion([p.string(),p.list(p.string())]);var pi=p.object({path:Dt,origin:p.string().optional(),overrides:Ge.optional(),audiences:p.list(p.string()).optional(),settings:ci.optional()});n();a();s();n();a();s();var li=p.object({target:p.string().optional(),root:p.string(),overrides:Ge.optional(),"local-generation":p.boolean().optional(),"from-openapi":p.boolean().optional(),dependencies:p.list(p.string()).optional()});var fi=p.object({proto:li});var ta=p.undiscriminatedUnion([Dt,pi,fi]);var ra=p.list(ta);var mi=p.undiscriminatedUnion([Dt,pi,ra,fi]);n();a();s();n();a();s();n();a();s();n();a();s();n();a();s();var ia=p.enum_(["literals","enums","enums-coerceable-to-literals"]);var di=p.object({"respect-nullable-schemas":p.boolean().optional(),"title-as-schema-name":p.boolean().optional(),"optional-additional-properties":p.boolean().optional(),"coerce-enums-to-literals":p.boolean().optional(),"idiomatic-request-names":p.boolean().optional(),"wrap-references-to-nullable-in-optional":p.boolean().optional(),"coerce-optional-schemas-to-nullable":p.boolean().optional(),"group-environments-by-host":p.boolean().optional(),"remove-discriminants-from-schemas":ui.optional(),"path-parameter-order":oi.optional(),"resolve-schema-collisions":p.boolean().optional(),"infer-forward-compatible":p.boolean().optional(),"infer-default-environment":p.boolean().optional(),"coerce-consts-to":ia.optional()});var hi=p.object({"message-naming":ai.optional()}).extend(di);n();a();s();n();a();s();var na=p.enum_(["int32","int64","uint32","uint64"]);n();a();s();var sa=p.enum_(["form","json"]);n();a();s();n();a();s();var Tn=p.object({"max-depth":p.number().optional()});var aa=p.object({request:Tn.optional(),response:Tn.optional()});n();a();s();var oa=p.object({endpoints:p.list(p.string()).optional()});n();a();s();n();a();s();var ua=p.object({except:p.list(p.string()).optional()});var ca=p.undiscriminatedUnion([p.boolean(),ua]);var Ut=p.object({"only-include-referenced-schemas":p.boolean().optional(),"inline-path-parameters":p.boolean().optional(),"prefer-undiscriminated-unions-with-literals":p.boolean().optional(),"object-query-parameters":p.boolean().optional(),"respect-readonly-schemas":p.boolean().optional(),"respect-forward-compatible-enums":p.boolean().optional(),"use-bytes-for-binary-response":p.boolean().optional(),"default-form-parameter-encoding":sa.optional(),filter:oa.optional(),"example-generation":aa.optional(),"additional-properties-defaults-to":p.boolean().optional(),"type-dates-as-strings":p.boolean().optional(),"preserve-single-schema-oneof":p.boolean().optional(),"inline-all-of-schemas":p.boolean().optional(),"resolve-aliases":ca.optional(),"group-multi-api-environments":p.boolean().optional(),"default-integer-format":na.optional()}).extend(di);var yi=p.object({}).extend(Ut).extend(hi);n();a();s();n();a();s();var pa=p.object({conjure:p.string()});n();a();s();n();a();s();var la=p.object({asyncapi:p.string(),origin:p.string().optional(),overrides:Ge.optional(),namespace:p.string().optional(),settings:hi.optional()});n();a();s();var fa=p.object({graphql:p.string(),origin:p.string().optional(),overrides:p.string().optional(),name:p.string().optional()});n();a();s();var ma=p.object({openapi:p.string(),origin:p.string().optional(),overrides:Ge.optional(),overlays:p.string().optional(),namespace:p.string().optional(),settings:Ut.optional()});n();a();s();var da=p.object({openrpc:p.string(),overrides:Ge.optional(),namespace:p.string().optional()});n();a();s();var ha=p.object({proto:li});var ya=p.undiscriminatedUnion([ma,la,ha,da,fa]);var gi=p.undiscriminatedUnion([p.list(ya),pa]);var ga=p.object({auth:ti.optional(),"auth-schemes":p.record(p.string(),jt).optional(),specs:gi,settings:yi.optional()}).extend(Zs).extend(qs);n();a();s();var ba=p.object({namespaces:p.record(p.string(),mi)});var xa=p.undiscriminatedUnion([mi,ba,ga]);n();a();s();var Sa=p.enum_(["minimal","comprehensive"]);n();a();s();var wa=p.object({name:p.string(),registry:p.string()});n();a();s();n();a();s();n();a();s();n();a();s();var Ta=p.object({name:p.string(),email:p.string()});var Mt=p.object({description:p.string().optional(),authors:p.list(Ta).optional()});n();a();s();n();a();s();var En=p.object({name:p.string()});var Vt=p.object({teams:p.list(En).optional(),users:p.list(En).optional()});n();a();s();n();a();s();n();a();s();n();a();s();var Ea=p.object({auth:ti.optional(),"auth-schemes":p.record(p.string(),jt).optional(),headers:p.record(p.string(),si).optional(),settings:yi.optional(),specs:gi.optional()});n();a();s();n();a();s();var Aa=p.object({url:p.string().optional(),"package-name":p.string(),token:p.string().optional()});n();a();s();var Ia=p.object({path:p.string()});n();a();s();n();a();s();var Na=p.object({keyId:p.string(),password:p.string(),secretKey:p.string()});var Ra=p.object({url:p.string().optional(),coordinate:p.string(),username:p.string().optional(),password:p.string().optional(),signature:Na.optional()});n();a();s();var Oa=p.object({url:p.string().optional(),"package-name":p.string(),token:p.string().optional()});n();a();s();var Pa=p.object({url:p.string().optional(),"package-name":p.string(),"api-key":p.string().optional()});n();a();s();var Ca=p.object({"api-key":p.string(),"workspace-id":p.string(),"collection-id":p.string().optional()});n();a();s();n();a();s();var _a=p.object({keywords:p.list(p.string()).optional(),"documentation-link":p.string().optional(),"homepage-link":p.string().optional()}).extend(Mt);var ka=p.object({url:p.string().optional(),"package-name":p.string(),token:p.string().optional(),username:p.string().optional(),password:p.string().optional(),metadata:_a.optional()});n();a();s();var Fa=p.object({url:p.string().optional(),"package-name":p.string(),"api-key":p.string().optional()});var La=p.union("location",{npm:Oa,maven:Ra,pypi:ka,postman:Ca,"local-file-system":Ia,nuget:Pa,rubygems:Fa,crates:Aa}).transform({transform:e=>e,untransform:e=>e});n();a();s();n();a();s();n();a();s();var ja=p.object({custom:p.string()});n();a();s();var Ba=p.enum_(["MIT","Apache-2.0"]);var We=p.undiscriminatedUnion([Ba,ja]);var An=p.object({"package-description":p.string().optional(),email:p.string().optional(),"reference-url":p.string().optional(),author:p.string().optional(),license:We.optional()});n();a();s();var Da=p.object({path:p.string()});n();a();s();n();a();s();n();a();s();var Ua=p.enum_(["commit","release"]);var Ma=p.object({repository:p.string(),license:We.optional(),mode:Ua.optional()});n();a();s();var Va=p.object({repository:p.string(),branch:p.string().optional(),license:We.optional(),mode:p.stringLiteral("pull-request"),reviewers:Vt.optional()});n();a();s();var va=p.object({repository:p.string(),license:We.optional(),mode:p.stringLiteral("push"),branch:p.string().optional()});n();a();s();n();a();s();var za=p.enum_(["pull-request","push"]);var qa=p.object({uri:p.string(),token:p.string(),mode:za.optional(),branch:p.string().optional(),license:We.optional()});var Ga=p.undiscriminatedUnion([qa,Ma,Va,va]);var bi=p.object({version:p.string(),output:La.optional(),github:Ga.optional(),config:p.unknown().optional(),metadata:An.optional(),keywords:p.list(p.string()).optional(),snippets:Da.optional(),"ir-version":p.string().optional(),"smart-casing":p.boolean().optional(),api:Ea.optional(),"disable-examples":p.boolean().optional(),"publish-metadata":An.optional(),autorelease:p.boolean().optional()});var Wa=p.object({image:wa}).extend(bi);n();a();s();var $a=p.object({name:p.string()}).extend(bi);var Ha=p.undiscriminatedUnion([$a,Wa]);var Ja=p.object({audiences:p.list(p.string()).optional(),generators:p.list(Ha),metadata:Mt.optional(),reviewers:Vt.optional()});n();a();s();var Ka=p.object({enabled:p.boolean()});n();a();s();n();a();s();var Qa=p.object({path:p.string(),origin:p.string().optional(),overrides:p.string().optional(),"disable-examples":p.boolean().optional(),settings:Ut});var Ya=p.undiscriminatedUnion([Qa,p.string()]);n();a();s();n();a();s();n();a();s();var Xa=p.enum_(["java","python","go","ruby","csharp","typescript","php","rust","swift"]);var Za=p.object({title:p.string(),language:Xa,content:p.string()});n();a();s();n();a();s();var eo=p.object({method:p.string(),path:p.string(),stream:p.boolean().optional()});var In=p.undiscriminatedUnion([p.string(),eo]);var to=p.object({bannerLink:p.string().optional(),introduction:p.string().optional(),apiReferenceLink:p.string().optional(),apiName:p.string().optional(),disabledSections:p.list(p.string()).optional(),defaultEndpoint:In.optional(),features:p.record(p.string(),p.list(In)).optional(),customSections:p.list(Za).optional(),exampleStyle:Sa.optional()});n();a();s();n();a();s();var ro=p.object({username:p.string(),email:p.string(),token:p.string()});var io=p.object({github:ro.optional()});var Rm=p.object({"auth-schemes":p.record(p.string(),jt).optional(),api:xa.optional(),whitelabel:io.optional(),metadata:Mt.optional(),readme:to.optional(),"default-group":p.string().optional(),aliases:p.record(p.string(),p.list(p.string())).optional(),groups:p.record(p.string(),Ja).optional(),reviewers:Vt.optional(),replay:Ka.optional(),ai:ds.optional(),autorelease:p.boolean().optional(),openapi:Ya.optional(),"openapi-overrides":p.string().optional(),"spec-origin":p.string().optional(),"async-api":p.string().optional(),"api-settings":ci.optional()});var Bu={};z(Bu,{BaseGeneratorInvocationSchema:()=>bi,CratesOutputLocationSchema:()=>Aa,CustomGeneratorInvocationSchema:()=>Wa,DefaultGeneratorInvocationSchema:()=>$a,GeneratorApiSettingsSchema:()=>Ea,GeneratorGroupSchema:()=>Ja,GeneratorInvocationSchema:()=>Ha,GeneratorOutputSchema:()=>La,GeneratorPublishMetadataSchema:()=>An,GeneratorSnippetsSchema:()=>Da,GithubCommitAndReleaseMode:()=>Ua,GithubCommitAndReleaseSchema:()=>Ma,GithubConfigurationSchema:()=>Ga,GithubPullRequestSchema:()=>Va,GithubPushSchema:()=>va,GithubSelfhostedMode:()=>za,GithubSelfhostedSchema:()=>qa,LocalFileSystemOutputLocationSchema:()=>Ia,MavenOutputLocationSchema:()=>Ra,MavenOutputSignatureSchema:()=>Na,NpmOutputLocationSchema:()=>Oa,NugetOutputLocationSchema:()=>Pa,PostmanOutputLocationSchema:()=>Ca,PypiOutputLocationSchema:()=>ka,PypiOutputMetadataSchema:()=>_a,RubyGemsOutputLocationSchema:()=>Fa});n();a();s();var Du={};z(Du,{GithubLicenseCustomSchema:()=>ja,GithubLicenseSchema:()=>We,GithubLicenseType:()=>Ba});n();a();s();var Uu={};z(Uu,{ReplayConfigSchema:()=>Ka});n();a();s();var Mu={};z(Mu,{ReviewerSchema:()=>En,ReviewersSchema:()=>Vt});n();a();s();n();a();s();n();a();s();function Om(e){return e?.specs!=null}n();a();s();function Pm(e){return e?.asyncapi!=null}n();a();s();function Cm(e){return e?.conjure!=null}n();a();s();function _m(e){return e?.graphql!=null}n();a();s();function km(e){return e?.namespaces!=null}n();a();s();function Fm(e){return e?.openapi!=null}n();a();s();function Lm(e){return e?.openrpc!=null}n();a();s();function jm(e){return e?.proto!=null}var Bm={[$e.GenerationLanguage.PHP]:new Set(["abstract","and","as","break","callable","case","catch","class","clone","const","continue","declare","default","do","echo","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","extends","final","finally","fn","for","foreach","function","global","goto","list","if","implements","include","include_once","instanceof","insteadof","interface","match","namespace","new","or","parent","Parent","print","private","protected","public","readonly","require","require_once","return","static","switch","throw","trait","try","use","var","while","xor","yield"].flatMap(e=>[e,Le(e)])),[$e.GenerationLanguage.TYPESCRIPT]:new Set(["any","as","boolean","break","case","catch","class","const","constructor","continue","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","instanceof","interface","let","module","new","null","number","of","package","private","protected","public","require","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","var","void","while","with","yield","Date","Error","File","Object","Record"]),[$e.GenerationLanguage.JAVA]:new Set(["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","false","final","finally","float","for","goto","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","strictfp","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"]),[$e.GenerationLanguage.PYTHON]:new Set(["False","None","True","and","as","assert","async","","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","float","int","complex","bool","uuid","list","set","map","long","self","all","kwargs"]),[$e.GenerationLanguage.GO]:new Set(["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","internal","map","package","range","return","select","struct","switch","type","var","vendor","any","bool","byte","complex64","complex128","error","float32","float64","int","int8","int16","int32","int64","make","new","rune","string","uint","uint8","uint16","uint32","uint64","uintptr"]),[$e.GenerationLanguage.RUBY]:new Set(["__ENCODING__","__LINE__","__FILE__","alias","and","begin","break","case","class","def","defined","do","else","elsif","end","ensure","false","for","if","in","module","next","nil","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","Object","JSON","Date","DateTime","object_id","hash","eql?","equal?","method","send","respond_to?","respond_to_missing?","instance_of?","kind_of?","is_a?","extend","singleton_class","instance_variables","instance_variable_get","instance_variable_set","instance_variable_defined?","remove_instance_variable","public_methods","private_methods","protected_methods","singleton_methods"]),[$e.GenerationLanguage.CSHARP]:new Set(["abstract","as","base","bool","break","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","else","enum","event","explicit","extern","false","finally","fixed","float","for","foreach","goto","if","implicit","in","int","interface","internal","is","lock","long","namespace","new","null","object","operator","out","override","params","private","protected","public","readonly","ref","return","sbyte","sealed","short","sizeof","stackalloc","static","string","struct","switch","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","virtual","void","volatile","while","add","and","alias","ascending","args","async","","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","managed","nameof","nint","not","notnull","nuint","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value","var","when","where","with","yield"]),[$e.GenerationLanguage.RUST]:new Set(["as","async","await","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","union","unsafe","use","where","while","abstract","become","box","do","final","macro","override","priv","try","typeof","unsized","virtual","yield","bool","char","f32","f64","i8","i16","i32","i64","i128","isize","str","u8","u16","u32","u64","u128","usize","String","Vec","Option","Result","Box","Rc","Arc","Cell","RefCell","HashMap","HashSet","BTreeMap","BTreeSet"]),[$e.GenerationLanguage.SWIFT]:new Set([])};var hy=["go","ruby"];function no(e,t,r){let{generationLanguage:i,keywords:o,smartCasing:c}=r,l=Ay(e),S=D=>({unsafeName:D,safeName:yy({name:D,keywords:gy({generationLanguage:i,keywords:o})})}),w=t.preserveUnderscores===!0,I=w?(D,G)=>vu(D,G):(D,G)=>G(D),A=I(l,cr),P=w?vu(l,D=>Le(cr(D))):Le(A),L=I(l,Dn),{leading:R,trailing:j}=w?Um(l):{leading:"",trailing:""},M=Ri(A);if(c){!Sy(M)&&(i==null||hy.includes(i))&&(A=R+M.map((G,K)=>{if(K>0){let oe=so(G);if(oe!=null)return oe;if(ao(G))return G.toUpperCase()}return G}).join("")+j,P=Le(R+M.map((G,K)=>{let oe=so(G);return oe??(ao(G)?G.toUpperCase():K===0?Le(G):G)}).join("")+j));let D=G=>G.split(" ").map(K=>K.split(/(\d+)/).map(Dn).join("")).join("_");L=w?vu(l,D):D(l)}return{originalName:e,camelCase:S(t.casingOverrides?.camel??A),snakeCase:S(t.casingOverrides?.snake??L),screamingSnakeCase:S(t.casingOverrides?.["screaming-snake"]??L.toUpperCase()),pascalCase:S(t.casingOverrides?.pascal??P)}}function Dm({generationLanguage:e,keywords:t,smartCasing:r}){let i={generationLanguage:e,keywords:t,smartCasing:r};return{generateName:(o,c)=>{if(typeof o=="string")return no(o,c??{},i);if("wireValue"in o){let l=o.name;return typeof l=="string"?no(l,c??{},i):l}return o},generateNameAndWireValue:(o,c)=>{if(typeof o=="string")return{wireValue:o,name:no(o,c??{},i)};let{name:l,wireValue:S}=o,w=typeof l=="string"?no(l,c??{},i):l;return{wireValue:S,name:w}}}}function yy({name:e,keywords:t}){return t==null?e:t.has(e)?e+"_":xy(e)?"_"+e:e}function gy({generationLanguage:e,keywords:t}){if(t!=null)return new Set(t);if(e!=null)return Bm[e]}var by=/^[0-9]/;function xy(e){return by.test(e)}function Sy(e){return e.some((t,r)=>{if(r===0)return!1;let i=e[r-1];if(i==null)return!1;let o=so(i)!=null||ao(i),c=so(t)!=null||ao(t);return o&&c})}function so(e){return Ty.get(e.toUpperCase())}function ao(e){return wy.has(e.toUpperCase())}var wy=new Set(["ACL","API","ASCII","CPU","CSS","DNS","EOF","GUID","HTML","HTTP","HTTPS","ID","IP","JSON","LHS","QPS","RAM","RHS","RPC","SAML","SCIM","SLA","SMTP","SQL","SSH","SSO","TCP","TLS","TTL","UDP","UI","UID","UUID","URI","URL","UTF8","VM","XML","XMPP","XSRF","XSS"]),Ty=new Map([["ACLS","ACLs"],["APIS","APIs"],["CPUS","CPUs"],["GUIDS","GUIDs"],["IDS","IDs"],["UIDS","UIDs"],["UUIDS","UUIDs"],["URIS","URIs"],["URLS","URLs"]]),Ey=[[/\[\]/g,"Array"]];function Ay(e){return Ey.reduce((t,[r,i])=>t.replace(r,i),e)}function Um(e){let t=e.match(/^(_+)/),r=e.match(/(_+)$/),i=t?.[1]??"",o=r?.[1]??"";if(i.length+o.length>=e.length)return{leading:e,trailing:"",core:""};let c=e.slice(i.length,e.length-o.length||void 0);return{leading:i,trailing:o,core:c}}function vu(e,t){let{leading:r,trailing:i,core:o}=Um(e);return r===""&&i===""?t(e):`${r}${t(o)}${i}`}n();a();s();function Nn(e){return typeof e=="string"?e:e.wireValue}var Rn=class e{constructor(t){y(this,"casingsGenerator");this.casingsGenerator=Dm(t)}static fromLanguage(t,r){return new e({generationLanguage:t,keywords:void 0,smartCasing:r})}resolve(t){return this.casingsGenerator.generateName(t)}resolveNameOrString(t){return this.casingsGenerator.generateName(t)}resolveNameAndWireValue(t){return this.casingsGenerator.generateNameAndWireValue(t)}camel(t){return this.resolve(t).camelCase}camelSafe(t){return this.camel(t).safeName}camelUnsafe(t){return this.camel(t).unsafeName}pascal(t){return this.resolve(t).pascalCase}pascalSafe(t){return this.pascal(t).safeName}pascalUnsafe(t){return this.pascal(t).unsafeName}snake(t){return this.resolve(t).snakeCase}snakeSafe(t){return this.snake(t).safeName}snakeUnsafe(t){return this.snake(t).unsafeName}screamingSnake(t){return this.resolve(t).screamingSnakeCase}screamingSnakeSafe(t){return this.screamingSnake(t).safeName}screamingSnakeUnsafe(t){return this.screamingSnake(t).unsafeName}};var xi=class extends Be{constructor({name:r,namespace:i,access:o,annotations:c,origin:l},S){super(l,S);y(this,"access");y(this,"reference");y(this,"annotations");y(this,"fields",[]);y(this,"generateSerializer",!1);y(this,"serializerClassReference");this.reference=this.csharp.classReference({name:r,namespace:i,origin:l}),this.access=o,this.annotations=c??[]}get name(){return this.reference.name}get namespace(){return this.reference.namespace}getNamespace(){return this.namespace}addAnnotation(r){this.annotations.push(r)}addMember(r){this.fields.push({name:r.name,wireValue:r.value,value:this.csharp.annotation({reference:this.System.Runtime.Serialization.EnumMember,argument:this.csharp.codeblock(i=>{i.write("Value = "),i.writeNode(this.csharp.string_({string:r.value}))})})})}enableSerializerGeneration(){return this.generateSerializer=!0,this.serializerClassReference=this.csharp.classReference({name:`${this.name}Serializer`,namespace:this.namespace}),this.serializerClassReference}write(r){r.writeLine(`namespace ${this.namespace};`),r.newLine();for(let i of this.annotations)i.write(r);r.writeNewLineIfLastLineNot(),r.write(`${this.access} `),r.write("enum "),r.writeLine(`${this.name}`),r.pushScope(),this.fields.forEach((i,o)=>{i.value.write(r),r.write(i.name),o<this.fields.length-1&&(r.writeLine(","),r.newLine())}),r.writeNewLineIfLastLineNot(),r.popScope(),this.generateSerializer&&this.writeSerializerClass(r)}writeSerializerClass(r){r.newLine(),r.writeLine(`internal class ${this.name}Serializer : global::System.Text.Json.Serialization.JsonConverter<${this.name}>`),r.pushScope(),r.writeLine(`private static readonly global::System.Collections.Generic.Dictionary<string, ${this.name}> _stringToEnum = new()`),r.pushScope();for(let i of this.fields)r.writeLine(`{ ${JSON.stringify(Nn(i))}, ${this.name}.${i.name} },`);r.popScope(!1),r.writeLine(";"),r.newLine(),r.writeLine(`private static readonly global::System.Collections.Generic.Dictionary<${this.name}, string> _enumToString = new()`),r.pushScope();for(let i of this.fields)r.writeLine(`{ ${this.name}.${i.name}, ${JSON.stringify(Nn(i))} },`);r.popScope(!1),r.writeLine(";"),r.newLine(),r.writeLine(`public override ${this.name} Read(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)`),r.pushScope(),r.writeLine('var stringValue = reader.GetString() ?? throw new global::System.Exception("The JSON value could not be read as a string.");'),r.writeLine("return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default;"),r.popScope(),r.newLine(),r.writeLine(`public override void Write(global::System.Text.Json.Utf8JsonWriter writer, ${this.name} value, global::System.Text.Json.JsonSerializerOptions options)`),r.pushScope(),r.writeLine("writer.WriteStringValue(_enumToString.TryGetValue(value, out var stringValue) ? stringValue : null);"),r.popScope(),r.newLine(),r.writeLine(`public override ${this.name} ReadAsPropertyName(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)`),r.pushScope(),r.writeLine('var stringValue = reader.GetString() ?? throw new global::System.Exception("The JSON property name could not be read as a string.");'),r.writeLine("return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default;"),r.popScope(),r.newLine(),r.writeLine(`public override void WriteAsPropertyName(global::System.Text.Json.Utf8JsonWriter writer, ${this.name} value, global::System.Text.Json.JsonSerializerOptions options)`),r.pushScope(),r.writeLine("writer.WritePropertyName(_enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString());"),r.popScope(),r.popScope()}};n();a();s();var Si=class extends Kr{constructor({name:t,namespace:r,access:i,partial:o,interfaceReferences:c,enclosingType:l,origin:S},w){super({name:t,namespace:r,access:i,partial:o,interfaceReferences:c,enclosingType:l,origin:S},w)}write(t){this.isNested||(t.writeLine(`namespace ${this.namespace};`),t.newLine()),t.write(`${this.access} `),this.partial&&t.write("partial "),t.write("interface "),t.writeLine(`${this.name}`),this.interfaceReferences.length>0&&(t.write(" : "),this.interfaceReferences.forEach((r,i)=>{r.write(t),i<this.interfaceReferences.length-1&&t.write(", ")})),t.pushScope();for(let r of this.fields)r.write(t),t.writeLine("");t.dedent(),t.indent();for(let r of this.methods)r.write(t),t.writeLine("");t.popScope()}};n();a();s();var wi=class extends Be{constructor({name:r,namespace:i,parentClassReference:o,origin:c},l){super(c,l);y(this,"reference");y(this,"parentClassReference");y(this,"testMethods",[]);this.reference=this.csharp.classReference({name:r,namespace:i,origin:c}),this.parentClassReference=o}get name(){return this.reference.name}get namespace(){return this.reference.namespace}write(r){r.writeNode(this.getClass())}getClass(){let r=[this.NUnit.Framework.TestFixture,this.csharp.annotation({reference:this.NUnit.Framework.Parallelizable,argument:"ParallelScope.Self"})],i=new rt({access:ge.Public,name:this.name,namespace:this.namespace,annotations:r,parentClassReference:this.parentClassReference,origin:this.origin},this.generation);for(let o of this.testMethods)i.addMethod({access:ge.Public,isAsync:o.isAsync,name:o.name,parameters:[],body:o.body,annotations:[this.NUnit.Framework.Test]});return i}addTestMethod(r){this.testMethods.push(r)}};n();a();s();n();a();s();n();a();s();n();a();s();var zu={System:["AccessViolationException","Action","Activator","AggregateException","AppContext","AppDomain","AppDomainSetup","AppDomainUnloadedException","ApplicationException","ApplicationId","ArgIterator","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","ArithmeticException","Array","ArrayTypeMismatchException","AssemblyLoadEventArgs","AssemblyLoadEventHandler","AsyncCallback","Attribute","AttributeTargets","AttributeUsageAttribute","BadImageFormatException","Base64FormattingOptions","BitConverter","Boolean","Buffer","Byte","CannotUnloadAppDomainException","Char","CharEnumerator","CLSCompliantAttribute","Console","ConsoleCancelEventArgs","ConsoleCancelEventHandler","ConsoleColor","ConsoleKey","ConsoleKeyInfo","ConsoleModifiers","ConsoleSpecialKey","ContextBoundObject","ContextMarshalException","ContextStaticAttribute","Convert","CultureAwareComparer","DataMisalignedException","DateOnly","DateTime","DateTimeKind","DateTimeOffset","DayOfWeek","DBNull","Decimal","Delegate","DivideByZeroException","DllNotFoundException","Double","DuplicateWaitObjectException","EntryPointNotFoundException","Enum","Environment","EnvironmentVariableTarget","EventArgs","EventHandler","Exception","ExecutionEngineException","FieldAccessException","FlagsAttribute","FormatException","FormattableString","GC","GCCollectionMode","GCGenerationInfo","GCKind","GCMemoryInfo","GCNotificationStatus","Guid","Half","HashCode","IAsyncDisposable","IAsyncResult","ICloneable","IComparable","IConvertible","ICustomFormatter","IDisposable","IFormatProvider","IFormattable","Index","IndexOutOfRangeException","InsufficientExecutionStackException","InsufficientMemoryException","Int128","Int16","Int32","Int64","IntPtr","InvalidCastException","InvalidOperationException","InvalidProgramException","InvalidTimeZoneException","ISpanFormattable","IUtf8SpanFormattable","LoaderOptimization","LoaderOptimizationAttribute","LocalDataStoreSlot","MarshalByRefObject","Math","MathF","MemberAccessException","MemoryExtensions","MethodAccessException","MidpointRounding","MissingFieldException","MissingMemberException","MissingMethodException","ModuleHandle","MTAThreadAttribute","MulticastDelegate","MulticastNotSupportedException","NonSerializedAttribute","NotFiniteNumberException","NotImplementedException","NotSupportedException","Nullable","NullReferenceException","Object","ObjectDisposedException","ObsoleteAttribute","OperatingSystem","OperationCanceledException","OrdinalComparer","OutOfMemoryException","OverflowException","ParamArrayAttribute","PlatformID","PlatformNotSupportedException","Random","Range","RankException","ResolveEventArgs","ResolveEventHandler","RuntimeArgumentHandle","RuntimeFieldHandle","RuntimeMethodHandle","RuntimeTypeHandle","SByte","SerializableAttribute","Single","StackOverflowException","STAThreadAttribute","String","StringComparer","StringComparison","StringNormalizationExtensions","StringSplitOptions","SystemException","ThreadStaticAttribute","TimeOnly","TimeoutException","TimeProvider","TimeSpan","TimeZone","TimeZoneInfo","TimeZoneNotFoundException","Tuple","TupleExtensions","Type","TypeAccessException","TypeCode","TypedReference","TypeInitializationException","TypeLoadException","TypeUnloadedException","UInt128","UInt16","UInt32","UInt64","UIntPtr","UnauthorizedAccessException","UnhandledExceptionEventArgs","UnhandledExceptionEventHandler","UnitySerializationHolder","ValueTuple","ValueType","Version","Void","WeakReference","Buffers","Collections","ComponentModel","Diagnostics","Globalization","IO","Linq","Net","Numerics","Reflection","Resources","Runtime","Security","Text","Threading"],"System.Collections.Generic":["ByteEqualityComparer","CollectionExtensions","IEnumerable","KeyNotFoundException","KeyValuePair","NonRandomizedStringEqualityComparer","ReferenceEqualityComparer"],"System.IO":["BinaryReader","BinaryWriter","BufferedStream","Directory","DirectoryInfo","DirectoryNotFoundException","EndOfStreamException","EnumerationOptions","File","FileAccess","FileAttributes","FileInfo","FileLoadException","FileMode","FileNotFoundException","FileOptions","FileShare","FileStream","FileStreamOptions","FileSystemInfo","HandleInheritability","InvalidDataException","IOException","MatchCasing","MatchType","MemoryStream","Path","PathTooLongException","RandomAccess","SearchOption","SeekOrigin","Stream","StreamReader","StreamWriter","StringReader","StringWriter","TextReader","TextWriter","UnixFileMode","UnmanagedMemoryAccessor","UnmanagedMemoryStream","System.IO.Enumeration"],"System.Linq":["Enumerable"],"System.Net.Http":["HttpClient","HttpMethod"],"System.Threading":["AbandonedMutexException","ApartmentState","AsyncFlowControl","AutoResetEvent","CancellationToken","CancellationTokenRegistration","CancellationTokenSource","CompressedStack","ContextCallback","EventResetMode","EventWaitHandle","ExecutionContext","Interlocked","IOCompletionCallback","IThreadPoolWorkItem","ITimer","LazyInitializer","LazyThreadSafetyMode","Lock","LockRecursionException","LockRecursionPolicy","ManualResetEvent","ManualResetEventSlim","Monitor","Mutex","NativeOverlapped","Overlapped","ParameterizedThreadStart","PeriodicTimer","PreAllocatedOverlapped","ReaderWriterLockSlim","RegisteredWaitHandle","Semaphore","SemaphoreFullException","SemaphoreSlim","SendOrPostCallback","SpinLock","SpinWait","SynchronizationContext","SynchronizationLockException","Thread","ThreadAbortException","ThreadExceptionEventArgs","ThreadExceptionEventHandler","ThreadInterruptedException","ThreadPool","ThreadPoolBoundHandle","ThreadPriority","ThreadStart","ThreadStartException","ThreadState","ThreadStateException","Timeout","Timer","TimerCallback","Volatile","WaitCallback","WaitHandle","WaitHandleCannotBeOpenedException","WaitHandleExtensions","WaitOrTimerCallback","Tasks"],"System.Threading.Tasks":["ConcurrentExclusiveSchedulerPair","ConfigureAwaitOptions","Task","TaskAsyncEnumerableExtensions","TaskCanceledException","TaskCompletionSource","TaskContinuationOptions","TaskCreationOptions","TaskExtensions","TaskFactory","TaskScheduler","TaskSchedulerException","TaskStatus","TaskToAsyncResult","UnobservedTaskExceptionEventArgs","ValueTask","Sources"]};var Ny=new Set(["abstract","as","base","bool","break","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","else","enum","event","explicit","extern","false","finally","fixed","float","for","foreach","goto","if","implicit","in","int","interface","internal","is","lock","long","namespace","new","null","object","operator","out","override","params","private","protected","public","readonly","ref","return","sbyte","sealed","short","sizeof","stackalloc","static","string","struct","switch","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","virtual","void","volatile","while"]);var Ry=new Set(["from","where","select","orderby","groupby","into","let","join","on","equals"]),Oy=new Set(["async","await"]),Py=new Set(["yield"]),Cy=new Set(["var","dynamic"]),_y=new Set(["using","alias"]);var ky=new Set(["required","scoped","unmanaged","managed"]),Fy=new Set(["when","and","or","not"]),Ly=new Set(["Equals","GetHashCode","ToString","GetType","MemberwiseClone","Finalize"]),jy=new Set([...Ny,...Ry,...Oy,...Py,...Cy,..._y,...ky,...Fy]),oo=class{constructor(t,r,i){y(this,"registry");y(this,"name");y(this,"jsonPath");this.registry=t,this.name=r,this.jsonPath=i}};var uo=class{constructor(t){y(this,"scope");y(this,"byName",new Map);y(this,"byPath",new Map);y(this,"redirections",new Map);this.scope=t}[Symbol.iterator](){return this.byName.values()}has(t){return this.byName.has(t)}getByJsonPath(t){return this.byPath.get(t)}getByName(t){return this.byName.get(t)}getRedirectedName(t){return this.redirections.get(t)}set(t){this.byName.has(t.name)&&de(`set: ${t.name} in ${this.scope.fullyQualifiedName} already exists`),t.jsonPath&&this.byPath.has(t.jsonPath)&&de(`set: ${t.name} in ${this.scope.fullyQualifiedName} already exists by jsonPath`),this.byName.set(t.name,t),t.jsonPath&&this.byPath.set(t.jsonPath,t)}redirect(t,r){this.redirections.has(t)&&de(`redirect: ${t} in ${this.scope.fullyQualifiedName} already has a redirect`),this.redirections.set(t,r)}},qu=class extends oo{constructor(r,i,o,c){super(r,i);y(this,"namespace");y(this,"fullyQualifiedName");y(this,"fields");y(this,"methods");this.namespace=o,this.fullyQualifiedName=c,this.fields=new uo(this),this.methods=new uo(this)}isKeyword(r){return jy.has(r)}isBuiltinMemberName(r){return Ly.has(r)}isTypeName(r){return this.name===r}isField(r){return this.fields.has(r)}isMethod(r){return this.methods.has(r)}isMember(r){return this.isField(r)||this.isMethod(r)}nameBlocked(r){if(this.isKeyword(r))return"keyword";if(this.isBuiltinMemberName(r))return"builtin";if(this.isTypeName(r))return"typeName";if(this.isField(r))return"field";if(this.isMethod(r))return"method"}getAlternativeName(r){let i=`${r}_`,o=2;for(;this.nameBlocked(i);)i=`${r}_${o}`,o++;return i}getFieldByJsonPath(r){return r!==void 0?this.fields.getByJsonPath(r):void 0}getFieldByName(r){return this.fields.getByName(r)}getRedirectedFieldName(r){return this.fields.getRedirectedName(r)}registerField(r,i,o){let c=this.registry.model.jsonPath(i);if(c){let w=this.fields.getByJsonPath(c);if(w)return w.name}let l=this.fields.getByName(r);if(l&&c===l.jsonPath)return r;switch(this.nameBlocked(r)){case"field":i&&V.Provenance(i)&&i.explicit||de(`Field ${r} already exists - attempting to add a duplicate field with the same name that is not an explicitly named property`);break;case"keyword":case"builtin":case"typeName":case"method":break;default:return this.fields.set(new co(this.registry,r,this,c,o)),this.registry.setFieldNameShortcut(c,r),r}let S=this.getAlternativeName(r);return this.fields.set(new co(this.registry,S,this,c,o)),this.fields.redirect(r,S),this.registry.setFieldNameShortcut(c,S),S}getFieldName(r,i){let o=this.getFieldByJsonPath(this.registry.model.jsonPath(r))?.name;if(o)return o;if(V.Provenance(r)){let S=this.getRedirectedFieldName(i);if(S)return S;let w=this.getFieldByName(i);return w?this.registry.model.provenance(w.jsonPath)?.explicit?i:`${i}_`:i}let c=this.getFieldByName(i);if(c)return this.registry.model.provenance(c.jsonPath)?.explicit?i:c.name;let l=this.getRedirectedFieldName(i);if(l)return l;this.isMethod(i)}},Gu=class extends oo{constructor(r,i,o,c){super(r,i,c);y(this,"scope");this.scope=o}},co=class extends Gu{constructor(r,i,o,c,l){super(r,i,o,c);y(this,"field");this.field=l}};var Ei=class e{constructor(t){y(this,"generation");y(this,"classReferenceByJsonPath",new Map);y(this,"typeRegistry",new Map);y(this,"namespaceRegistry",new Map);y(this,"typeNames",new Map);y(this,"namespaceNames",new Map);y(this,"implicitNamespaces",new Set);y(this,"shortcuts",new Map);y(this,"knownBuiltInIdentifiers",new Set(["Text","Json","Xml","Security","Collections","Data","Diagnostics","Globalization","Math","Reflection","Runtime","Security","Serialization","Threading","Xml"]));this.generation=t,this.initializeBuiltIns()}get csharp(){return this.generation.csharp}get model(){return this.generation.model}initializeBuiltIns(){for(let[t,r]of Object.entries(zu))t.split(".").forEach(i=>this.knownBuiltInIdentifiers.add(i)),r.forEach(i=>this.knownBuiltInIdentifiers.add(i));for(let[t,r]of Object.entries(zu)){for(let o of r)this.typeNames.set(o,new Set([t]));let i=t.split(".")[0];i&&this.typeNames.set(i,new Set([t]))}this.typeNames.set("System",new Set(["System"])),this.typeNames.set("NUnit",new Set(["NUnit"])),this.typeNames.set("OneOf",new Set(["OneOf"])),this.knownBuiltInIdentifiers.add("NUnit"),this.knownBuiltInIdentifiers.add("OneOf")}setFieldNameShortcut(t,r){if(t){let i=this.shortcuts.get(t);i&&i!==r&&de(`BAD_BAD_BAD setFieldNameShortcut: ${t} already has a name: ${i} - while setting to ${r} - if this is happening, then you could be getting back the wrong name later!`),this.shortcuts.set(t,r)}}getFieldNameByOrigin(t){return this.shortcuts.get(this.model.jsonPath(t)??">ignore<")}isKnownBuiltInIdentifier(t){return!t||typeof t!="string"?!1:this.knownBuiltInIdentifiers.has(t)}isKnownNamespace(t){return!t||typeof t!="string"?!1:this.namespaceRegistry.has(t)}isRegisteredTypeName(t){return this.typeRegistry.has(t)}isAmbiguousTypeName(t){return t?(this.typeNames.get(t)?.size??0)>1:!1}isAmbiguousNamespaceName(t){return t?(this.namespaceNames.get(t)?.size??0)>1:!1}hasTypeNamespaceConflict(t){return!t||this.knownBuiltInIdentifiers.has(t)?!1:this.typeNames.has(t)&&(this.namespaceNames.get(t)?.has("")??!1)}static fullyQualifiedNameOf(t){return t.enclosingType?`${t.enclosingType.fullyQualifiedName??`${t.namespace}.${t.enclosingType.name}`}+${t.name}`:`${t.namespace}.${t.name}`}registerNamespace(t,r){this.namespaceRegistry.has(t)&&this.namespaceRegistry.get(t)!==r||this.namespaceRegistry.set(t,r)}trackType(t,r){let{name:i,namespace:o,enclosingType:c,fullyQualifiedName:l,origin:S}=t;if(S){let w=this.model.jsonPath(S)??de(`JsonPath not found for origin: ${JSON.stringify(S).substring(0,100)}`);this.classReferenceByJsonPath.set(w,t)}if(r&&r!==l&&!this.typeRegistry.has(r)&&this.typeRegistry.set(r,t),!this.typeRegistry.has(l)){this.typeRegistry.set(l,t);for(let w of this.allNamespacesOf(o))this.registerNamespace(w,w);c||this.trackTypeName(i,o);for(let w of[this.generation.namespaces.root,...this.implicitNamespaces])if(o.startsWith(w)){let I=o.split(".")[w.split(".").length];I&&this.trackTypeName(I,o)}}return t}addImplicitNamespace(t){this.implicitNamespaces.add(t)}isNamespaceImplicit(t){return this.implicitNamespaces.has(t)}get implicitlyImportedNamespaces(){return[...this.implicitNamespaces]}trackTypeName(t,r){this.typeNames.has(t)?this.typeNames.get(t)?.add(r):this.typeNames.set(t,new Set([r]));let i=r.split("."),o="";for(let c of i)this.namespaceNames.has(c)?this.namespaceNames.get(c)?.add(o):this.namespaceNames.set(c,new Set([o])),o=o?`${o}.${c}`:c}allNamespacesOf(t){if(!t||typeof t!="string")return new Set;let r="",i=new Set;for(let o of t.split("."))o.trim()&&(r=r?`${r}.${o}`:`${o}`,i.add(r));return i}registerClassReference(t,r){let{name:i,namespace:o,enclosingType:c,origin:l}=t,S=this.model.jsonPath(l),w=(S?this.classReferenceByJsonPath.get(S):void 0)??this.typeRegistry.get(r),I=this.model.jsonPath(w?.origin),A=I&&S?I===S?"match":"mismatch":"no origin";if(w&&A!=="mismatch")return new _e({name:w.name,namespace:w.namespace,enclosingType:w.enclosingType,fullyQualifiedName:w.fullyQualifiedName,namespaceAlias:t.namespaceAlias,fullyQualified:t.fullyQualified,generics:t.generics,global:t.global,origin:w.origin??l,isCollection:w.isCollection,isReferenceType:w.isReferenceType,multipartMethodName:w.multipartMethodName,multipartMethodNameForCollection:w.multipartMethodNameForCollection},w.scope,this.generation);let P=!1,L=this.resolveNamespace(o);L!==o&&(o=L,P=!0);let R;e:for(;;){R=e.fullyQualifiedNameOf({name:i,namespace:o,enclosingType:c});let j="",M=o.split(".");for(let D=0;D<M.length;D++)if(j=j?`${j}.${M[D]}`:`${M[D]}`,this.typeRegistry.has(j)){M[D]=`${M[D]}_`,o=M.join("."),P=!0;continue e}if(P&&this.registerNamespace(t.namespace,o),A==="mismatch"&&w?.name===i){i=`${i}_`,P=!0;continue e}if(this.namespaceRegistry.has(R)){i=`${i}_`,P=!0;continue e}if(this.typeRegistry.has(R)){i=`${i}_`,P=!0;continue e}if(c){let D=R.replaceAll("+",".");if(this.typeRegistry.has(D)){i=`${i}_`,P=!0;continue e}if(this.namespaceRegistry.has(D)){i=`${i}_`,P=!0;continue e}}else{let D=R.split(".");for(let G=1;G<D.length;G++){let K=D.slice(0,G).join(".")+"+"+D.slice(G).join("+");if(this.typeRegistry.has(K)){i=`${i}_`,P=!0;continue e}}}break}return this.trackType(new _e({name:i,namespace:o,enclosingType:c,namespaceAlias:t.namespaceAlias,fullyQualified:t.fullyQualified,generics:t.generics,global:t.global,fullyQualifiedName:R,origin:l,isCollection:t.isCollection,isReferenceType:t.isReferenceType,multipartMethodName:t.multipartMethodName,multipartMethodNameForCollection:t.multipartMethodNameForCollection},new qu(this,i,o,R),this.generation),r)}resolveNamespace(t){let r=this.namespaceRegistry.get(t);if(r!==void 0)return r;let i=t.split(".");for(let o=i.length-1;o>=0;o--){let c=i.slice(0,o).join(".");if(this.namespaceRegistry.has(c)){let l=this.namespaceRegistry.get(c);if(l!==void 0){let S=i.slice(o).join("."),w=`${l}.${S}`;return this.registerNamespace(t,w),w}}}return t}canonicalizeNamespace(t){let r=this.namespaceRegistry.get(t);if(r!==void 0)return r;let i=!1,o=t;e:for(;;){let c="",l=o.split(".");for(let S=0;S<l.length;S++)if(c=c?`${c}.${l[S]}`:`${l[S]}`,this.typeRegistry.has(c)){l[S]=`${l[S]}_`,o=l.join("."),i=!0;continue e}break}return i&&this.registerNamespace(t,o),o}};var po=class{constructor(t){y(this,"generation");y(this,"frozen",!1);y(this,"extraClassReferences",new Map);y(this,"InstantiatedPrimitive",{string:t=>new Ne({type:"string",value:t},this.generation),boolean:t=>new Ne({type:"boolean",value:t},this.generation),integer:t=>new Ne({type:"integer",value:t},this.generation),long:t=>new Ne({type:"long",value:t},this.generation),uint:t=>new Ne({type:"uint",value:t},this.generation),ulong:t=>new Ne({type:"ulong",value:t},this.generation),float:t=>new Ne({type:"float",value:t},this.generation),double:t=>new Ne({type:"double",value:t},this.generation),date:t=>new Ne({type:"date",value:t},this.generation),dateTime:(t,r=!0)=>new Ne({type:"dateTime",value:t,parse:r},this.generation),uuid:t=>new Ne({type:"uuid",value:t},this.generation),null:()=>new Ne({type:"null"},this.generation)});y(this,"Literal",{class_:({reference:t,fields:r})=>new J.Class_(t,r,this.generation),dictionary:({keyType:t,valueType:r,entries:i})=>new J.Dictionary(t,r,i,this.generation),list:({valueType:t,values:r})=>new J.List(t,r,this.generation),set:({valueType:t,values:r})=>new J.Set(t,r,this.generation),boolean:t=>new J.Boolean(t,this.generation),float:t=>new J.Float(t,this.generation),date:t=>new J.Date(t,this.generation),datetime:t=>new J.DateTime(t,this.generation),decimal:t=>new J.Decimal(t,this.generation),double:t=>new J.Double(t,this.generation),integer:t=>new J.Integer(t,this.generation),long:t=>new J.Long(t,this.generation),uint:t=>new J.Uint(t,this.generation),ulong:t=>new J.Ulong(t,this.generation),reference:t=>new J.Reference(t,this.generation),string:t=>new J.String(t,this.generation),null:()=>new J.Null(this.generation),nop:()=>new J.Nop(this.generation),unknown:t=>new J.Unknown(t,this.generation)});y(this,"VALID_READ_ONLY_MEMORY_TYPES",new Set(["int","long","uint","ulong","string","bool","float","double"]));this.generation=t}get model(){return this.generation.model}classReference(t){return this.classReferenceInternal(t)}classReferenceInternal(t){if(!t.name&&"origin"in t&&t.origin&&(t.name=this.model.getClassNameFor(t.origin)),t.enclosingType){if(t.namespace)throw new Error("ClassReference: Both enclosingType and namespace cannot be provided");t.namespace=t.enclosingType.namespace}let r=Ei.fullyQualifiedNameOf(t);if(this.frozen&&!this.generation.registry.isRegisteredTypeName(r)){let i=this.extraClassReferences.get(r);i||(i=new Set,this.extraClassReferences.set(r,i)),i.add(`${r} -
33
- ${_i()}`)}return this.generation.registry.registerClassReference(t,r)}freezeClassReferences(){this.frozen=!0}getPropertyName(t,r){let i=this.model.getPropertyNameFor(r),o=this.model.origin(r);if(o){let c=t.getFieldName(o,i);if(c)return c}return i}class_(t){let r=t;return"reference"in t&&(r={...t.reference,...t}),new rt(r,this.generation)}testClass(t){return new wi(t,this.generation)}annotation(t){return new ft(t,this.generation)}annotationGroup(t){return new qr(t,this.generation)}instantiateClass(t){return new Nr(t,this.generation)}invokeMethod(t){return new Cr(t,this.generation)}codeblock(t){return new Ot(t,this.generation)}code(){return new Pt({},this.generation)}anonymousFunction(t){return new Gr(t)}parameter(t){return new Ke(t,this.generation)}interface_(t){return new Si(t,this.generation)}enum_(t){return new xi(t,this.generation)}dictionary(t){return new Rr(t,this.generation)}list(t){return new Pr(t,this.generation)}readOnlyMemory(t){return new _r(t,this.generation)}set(t){return new kr(t,this.generation)}switch_(t){return new $r(t,this.generation)}ternary(t){return new Hr(t,this.generation)}and(t){return new zr(t,this.generation)}or(t){return new Wr(t,this.generation)}enumInstantiation(t){return new Or(t,this.generation)}string_(t){return new Fr(t,this.generation)}xmlDocBlock(t){return new kt(t,this.generation)}xmlDocBlockOf(t){return t instanceof kt?t:new kt(t,this.generation)}validateReadOnlyMemoryTypes(){for(let t of this.generation.settings.readOnlyMemoryTypes)if(!this.VALID_READ_ONLY_MEMORY_TYPES.has(t))throw new Error(`Type "${t}" is not a valid 'read-only-memory-types' custom config option; expected one of ${JSON.stringify(this.VALID_READ_ONLY_MEMORY_TYPES)}.`)}};n();a();s();function $(e){let t={},r={};for(let[i,o]of Object.entries(e))o.length===0?Object.defineProperty(r,i,{get(){return i in t||(t[i]=o()),t[i]},enumerable:!0,configurable:!0}):r[i]=o;return r}n();a();s();var lo=class{constructor(t){y(this,"generation");y(this,"System",$({Action:t=>this.csharp.classReference({name:"Action",namespace:"System",generics:t||void 0,multipartMethodName:null,multipartMethodNameForCollection:null,isReferenceType:!0}),Func:(t,r)=>this.csharp.classReference({name:"Func",namespace:"System",generics:t?r?[...t,r]:t:r?[r]:void 0,multipartMethodName:null,multipartMethodNameForCollection:null,isReferenceType:!0}),DateOnly:()=>this.csharp.classReference({name:"DateOnly",namespace:"System"}),DateTime:()=>this.csharp.classReference({name:"DateTime",namespace:"System"}),Enum:()=>this.csharp.classReference({name:"Enum",namespace:"System"}),Exception:()=>this.csharp.classReference({name:"Exception",namespace:"System"}),ReadOnlyMemory:t=>this.csharp.classReference({name:"ReadOnlyMemory",namespace:"System",generics:[t]}),Serializable:()=>this.csharp.classReference({name:"SerializableAttribute",namespace:"System"}),String:()=>this.csharp.classReference({name:"String",namespace:"System"}),Type:()=>this.csharp.classReference({name:"Type",namespace:"System",isReferenceType:!0,multipartMethodName:null,multipartMethodNameForCollection:null,fullyQualified:!0}),TimeSpan:()=>this.csharp.classReference({name:"TimeSpan",namespace:"System"}),Uri:()=>this.csharp.classReference({name:"Uri",namespace:"System"}),UriBuilder:()=>this.csharp.classReference({name:"UriBuilder",namespace:"System"}),Runtime:()=>$({Serialization:()=>$({EnumMember:()=>this.csharp.classReference({name:"EnumMemberAttribute",namespace:"System.Runtime.Serialization"})})}),Collections:()=>$({Generic:()=>$({IAsyncEnumerable:t=>this.csharp.classReference({name:"IAsyncEnumerable",namespace:"System.Collections.Generic",generics:t?[t]:void 0}),IEnumerable:t=>this.csharp.classReference({name:"IEnumerable",namespace:"System.Collections.Generic",generics:t?[t]:void 0}),KeyValuePair:(t,r)=>this.csharp.classReference({name:"KeyValuePair",namespace:"System.Collections.Generic",generics:t&&r?[t,r]:void 0}),List:t=>this.csharp.classReference({name:"List",namespace:"System.Collections.Generic",generics:t?[t]:void 0,isCollection:!0}),HashSet:t=>this.csharp.classReference({name:"HashSet",namespace:"System.Collections.Generic",generics:t?[t]:void 0,isCollection:!0}),Dictionary:(t,r)=>this.csharp.classReference({name:"Dictionary",namespace:"System.Collections.Generic",generics:t&&r?[t,r]:void 0,isCollection:!0}),IDictionary:(t,r)=>this.csharp.classReference({name:"IDictionary",namespace:"System.Collections.Generic",generics:[t,r]})}),Linq:()=>$({Enumerable:()=>this.csharp.classReference({name:"Enumerable",namespace:"System.Linq"})})}),Globalization:()=>$({DateTimeStyles:()=>this.csharp.classReference({name:"DateTimeStyles",namespace:"System.Globalization"})}),Linq:()=>$({Enumerable:()=>this.csharp.classReference({name:"Enumerable",namespace:"System.Linq"})}),Net:()=>$({Http:()=>$({HttpClient:()=>this.csharp.classReference({name:"HttpClient",namespace:"System.Net.Http"}),HttpMethod:()=>this.csharp.classReference({name:"HttpMethod",namespace:"System.Net.Http"}),HttpResponseHeaders:()=>this.csharp.classReference({name:"HttpResponseHeaders",namespace:"System.Net.Http.Headers"})}),ServerSentEvents:()=>$({SseEvent:()=>this.csharp.classReference({name:"SseEvent",namespace:"System.Net.ServerSentEvents"}),SseParser:()=>this.csharp.classReference({name:"SseParser",namespace:"System.Net.ServerSentEvents"})}),WebSockets:()=>$({ClientWebSocketOptions:()=>this.csharp.classReference({name:"ClientWebSocketOptions",namespace:"System.Net.WebSockets"})})}),IO:()=>$({MemoryStream:()=>this.csharp.classReference({name:"MemoryStream",namespace:"System.IO"}),Stream:()=>this.csharp.classReference({name:"Stream",namespace:"System.IO"}),StreamReader:()=>this.csharp.classReference({name:"StreamReader",namespace:"System.IO"})}),Text:()=>$({Encoding:()=>this.csharp.classReference({name:"Encoding",namespace:"System.Text"}),Encoding_UTF8:()=>this.csharp.classReference({name:"UTF8",enclosingType:this.csharp.classReference({name:"Encoding",namespace:"System.Text"})}),Json:()=>$({JsonElement:()=>this.csharp.classReference({name:"JsonElement",namespace:"System.Text.Json"}),JsonDocument:()=>this.csharp.classReference({name:"JsonDocument",namespace:"System.Text.Json"}),JsonException:()=>this.csharp.classReference({name:"JsonException",namespace:"System.Text.Json"}),Utf8JsonReader:()=>this.csharp.classReference({name:"Utf8JsonReader",namespace:"System.Text.Json"}),JsonSerializerOptions:()=>this.csharp.classReference({name:"JsonSerializerOptions",namespace:"System.Text.Json"}),JsonSerializer:()=>this.csharp.classReference({name:"JsonSerializer",namespace:"System.Text.Json"}),Utf8JsonWriter:()=>this.csharp.classReference({name:"Utf8JsonWriter",namespace:"System.Text.Json"}),Nodes:()=>$({JsonNode:()=>this.csharp.classReference({name:"JsonNode",namespace:"System.Text.Json.Nodes"}),JsonObject:()=>this.csharp.classReference({name:"JsonObject",namespace:"System.Text.Json.Nodes"})}),Serialization:()=>$({IJsonOnDeserialized:()=>this.csharp.classReference({name:"IJsonOnDeserialized",namespace:"System.Text.Json.Serialization"}),IJsonOnSerializing:()=>this.csharp.classReference({name:"IJsonOnSerializing",namespace:"System.Text.Json.Serialization"}),JsonOnDeserializedAttribute:()=>this.csharp.classReference({name:"JsonOnDeserializedAttribute",namespace:"System.Text.Json.Serialization"}),JsonExtensionData:()=>this.csharp.classReference({name:"JsonExtensionDataAttribute",namespace:"System.Text.Json.Serialization"}),JsonConverter:t=>this.csharp.classReference({name:"JsonConverter",namespace:"System.Text.Json.Serialization",generics:t?[t]:void 0}),JsonIgnore:()=>this.csharp.classReference({name:"JsonIgnoreAttribute",namespace:"System.Text.Json.Serialization"}),JsonPropertyName:()=>this.csharp.classReference({name:"JsonPropertyNameAttribute",namespace:"System.Text.Json.Serialization"})})})}),Threading:()=>$({CancellationToken:()=>this.csharp.classReference({name:"CancellationToken",namespace:"System.Threading"}),Tasks:()=>$({Task:t=>this.csharp.classReference({name:"Task",namespace:"System.Threading.Tasks",generics:t?[t]:void 0}),ValueTask:t=>this.csharp.classReference({name:"ValueTask",namespace:"System.Threading.Tasks",generics:t?[t]:void 0})})}),ComponentModel:()=>$({INotifyPropertyChanged:()=>this.csharp.classReference({name:"INotifyPropertyChanged",namespace:"System.ComponentModel"}),PropertyChangedEventHandler:()=>this.csharp.classReference({name:"PropertyChangedEventHandler",namespace:"System.ComponentModel"})}),IAsyncDisposable:()=>this.csharp.classReference({name:"IAsyncDisposable",namespace:"System"}),IDisposable:()=>this.csharp.classReference({name:"IDisposable",namespace:"System"})}));y(this,"NUnit",$({Framework:()=>$({TestFixture:()=>this.csharp.classReference({name:"TestFixture",namespace:"NUnit.Framework"}),Test:()=>this.csharp.classReference({name:"Test",namespace:"NUnit.Framework"}),OneTimeTearDown:()=>this.csharp.classReference({name:"OneTimeTearDown",namespace:"NUnit.Framework"}),OneTimeSetUp:()=>this.csharp.classReference({name:"OneTimeSetUp",namespace:"NUnit.Framework"}),SetUpFixture:()=>this.csharp.classReference({name:"SetUpFixture",namespace:"NUnit.Framework"}),Parallelizable:()=>this.csharp.classReference({name:"Parallelizable",namespace:"NUnit.Framework"})})}));y(this,"OneOf",$({OneOf:t=>this.csharp.classReference({name:"OneOf",namespace:"OneOf",generics:t}),OneOfBase:t=>this.csharp.classReference({name:"OneOfBase",namespace:"OneOf",generics:t})}));y(this,"Google",$({Protobuf:()=>$({ByteString:()=>this.csharp.classReference({name:"ByteString",namespace:"Google.Protobuf"}),WellKnownTypes:()=>$({Struct:()=>this.csharp.classReference({name:"Struct",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),Value:()=>this.csharp.classReference({name:"Value",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),ListValue:()=>this.csharp.classReference({name:"ListValue",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),Timestamp:()=>this.csharp.classReference({name:"Timestamp",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"})})})}));y(this,"WireMock",$({Server:()=>this.csharp.classReference({name:"WireMockServer",namespace:"WireMock.Server"}),WireMockServerSettings:()=>this.csharp.classReference({name:"WireMockServerSettings",namespace:"WireMock.Settings"}),WireMockConsoleLogger:()=>this.csharp.classReference({name:"WireMockConsoleLogger",namespace:"WireMock.Logging"})}));y(this,"Grpc",$({Core:()=>$({RpcException:()=>this.csharp.classReference({name:"RpcException",namespace:"Grpc.Core"})})}));this.generation=t}get csharp(){return this.generation.csharp}};n();a();s();var Wu=new Set(["name","camelCase","snakeCase","screamingSnakeCase","pascalCase"]);function By(e,t){return Wu.has(t)?e??"":e?`${e}.${t}`:t}var fo=class{constructor(t,r){y(this,"generation");y(this,"indexByObject",new Map);y(this,"indexByPath",new Map);y(this,"explicitByObject",new Map);y(this,"explicitByPath",new Map);y(this,"root");y(this,"ir");this.generation=r,this.root=this.createIndex(t),this.ir=t}get csharp(){return this.generation.csharp}get registry(){return this.generation.registry}createIndex(t,r="",i){let o=By(i?.jsonPath,r);if(this.indexByPath.has(o)){i||de(`Parent provenance not found for node: ${JSON.stringify(t).substring(0,100)}`),this.indexByObject.set(t,i);let l=Wu.has(r);for(let[S,w]of Object.entries(t))typeof w=="object"&&w!==null&&(l&&Wu.has(S)?this.indexByObject.set(w,i):this.createIndex(w,S,i));return i}let c={jsonPath:o,name:r,node:t,parent:i};this.indexByObject.set(t,c),this.indexByPath.set(o,c);for(let[l,S]of Object.entries(t))typeof S=="object"&&S!==null&&this.createIndex(S,l,c);return c}staticExplicit(t){return this.explicit(this.ir,t)}explicit(t,r){let i=this.provenance(t)??de(`Provenance not found for node: ${JSON.stringify(t).substring(0,100)}`),o={...i,jsonPath:`${i.jsonPath}+${r}`,name:r,node:i.node,parent:i,explicit:!0},c=this.explicitByObject.get(i.node);return c?c.add(o):this.explicitByObject.set(i.node,new Set([o])),this.explicitByPath.set(o.jsonPath,o),o}provenance(t){if(t!==void 0)return V.string(t)?this.explicitByPath.get(t)??this.indexByPath.get(t):V.Provenance(t)?this.explicitByPath.get(t.jsonPath)??this.indexByPath.get(t.jsonPath):this.indexByObject.get(t)}origin(t){let r=this.provenance(t);return r?.explicit?r:r?.node}irNode(t){return this.provenance(t)?.node}jsonPath(t){return this.provenance(t)?.jsonPath}getEnumValueName(t,r){let i=V.IR.ExampleEnumType(r)?r.value:r,o=t.values.find(c=>this.nameEquals(c.name,i));return o?this.getPropertyNameFor(o):de(`Unexpected - can't find enum value ${JSON.stringify(i)} in enum`)}getPropertyNameFor(t){let r=this.registry.getFieldNameByOrigin(t);if(r)return r;if(V.Provenance(t))return t.name;if("name"in t){if(V.IR.NameAndWireValue(t.name))return this.generation.case.pascalSafe(t.name);if(V.IR.Name(t.name))return this.generation.case.pascalSafe(t.name);if(typeof t.name=="string")return this.generation.case.pascalSafe(t.name)}if("pascalCase"in t)return this.generation.case.pascalSafe(t);throw new Error(`Unknown property type: ${this.jsonPath(t)}`)}getClassNameFor(t){if(V.Provenance(t))return t.name;if("name"in t){if(V.IR.TypeDeclaration(t))return this.generation.case.pascalSafe(t.name.name);if(V.IR.NameAndWireValue(t.name))return this.generation.case.pascalSafe(t.name);if(V.IR.Name(t.name))return this.generation.case.pascalSafe(t.name);if(typeof t.name=="string")return this.generation.case.pascalSafe(t.name)}if("pascalCase"in t)return this.generation.case.pascalSafe(t);throw new Error(`Unknown property type: ${JSON.stringify(t)}`)}nameEquals(t,r){return this.generation.case.camelSafe(t)===this.generation.case.camelSafe(r)}dereferenceType(t){let r=V.string(t)?t:V.IR.NamedType(t)||V.IR.DeclaredTypeName(t)?t.typeId:V.IR.ExampleNamedType(t)?t.typeName.typeId:t.name.typeId,i=this.irNode(this.ir.types[r]);if(V.IR.TypeDeclaration(i))return{typeId:r,typeDeclaration:i};de(`dereferenceType: typeId ${r} not resolved.`)}};function mo(...e){return e.filter(Boolean).join("/")}var On=class{constructor(t,r,i,o,c={makeRelativeFilePath:l=>l,makeAbsoluteFilePath:l=>l,getNamespaceForTypeId:l=>"",getDirectoryForTypeId:l=>"",getCoreAsIsFiles:()=>[],getCoreTestAsIsFiles:()=>[],getPublicCoreAsIsFiles:()=>[],getAsyncCoreAsIsFiles:()=>[],getChildNamespaceSegments:l=>[]}){y(this,"intermediateRepresentation");y(this,"apiName");y(this,"customConfig");y(this,"generatorConfig");y(this,"support");y(this,"ir");y(this,"dir");y(this,"csharp",new po(this));y(this,"registry",new Ei(this));y(this,"model");y(this,"case");y(this,"extern",new lo(this));y(this,"settings",$({namespace:()=>this.customConfig.namespace??Zn(es(`${this.generatorConfig.organization}_${this.apiName}`)),readOnlyMemoryTypes:()=>this.customConfig["read-only-memory-types"]??[],simplifyObjectDictionaries:()=>this.customConfig["simplify-object-dictionaries"]??!1,useFullyQualifiedNamespaces:()=>this.customConfig["experimental-fully-qualified-namespaces"]??!1,useDotnetFormat:()=>this.customConfig["experimental-dotnet-format"]??!1,enableWebsockets:()=>this.customConfig["experimental-enable-websockets"]??!1,enableReadonlyConstants:()=>this.customConfig["experimental-readonly-constants"]??!1,generateLiterals:()=>this.customConfig["generate-literals"]??this.customConfig["experimental-readonly-constants"]??!1,enableExplicitNullableOptional:()=>this.customConfig["experimental-explicit-nullable-optional"]??!1,useDefaultRequestParameterValues:()=>this.customConfig["use-default-request-parameter-values"]??!1,redactResponseBodyOnError:()=>this.customConfig["redact-response-body-on-error"]??!1,temporaryWebsocketEnvironments:()=>this.customConfig["temporary-websocket-environments"]??{},baseApiExceptionClassName:()=>this.customConfig["base-api-exception-class-name"]??"",baseExceptionClassName:()=>this.customConfig["base-exception-class-name"]??"",shouldGeneratedDiscriminatedUnions:()=>this.customConfig["use-discriminated-unions"]??!0,shouldGenerateUndiscriminatedUnions:()=>this.customConfig["use-undiscriminated-unions"]??!1,exportedClientClassName:()=>this.customConfig["exported-client-class-name"]??"",clientClassName:()=>this.customConfig["client-class-name"]??"",rootNamespaceForCoreClasses:()=>this.customConfig["root-namespace-for-core-classes"]??!0,packageId:()=>this.customConfig["package-id"]??"",isForwardCompatibleEnumsEnabled:()=>this.customConfig["enable-forward-compatible-enums"]??this.customConfig["experimental-enable-forward-compatible-enums"]??!0,websocketEnvironments:()=>this.customConfig["temporary-websocket-environments"]??{},customPagerName:()=>this.customConfig["custom-pager-name"]??"",environmentClassName:()=>this.customConfig["environment-class-name"]??"",generateErrorTypes:()=>this.customConfig["generate-error-types"]??!0,shouldInlinePathParameters:()=>this.customConfig["inline-path-parameters"]??!0,includeExceptionHandler:()=>this.customConfig["include-exception-handler"]??!1,exceptionInterceptorClassName:()=>this.customConfig["exception-interceptor-class-name"]??"",shouldGenerateMockServerTests:()=>this.customConfig["generate-mock-server-tests"]??this.customConfig["enable-wire-tests"]??!0,rootClientAccess:()=>this.customConfig["root-client-class-access"]=="internal"?ge.Internal:ge.Public,extraDependencies:()=>this.customConfig["extra-dependencies"]??{},omitFernHeaders:()=>this.customConfig["omit-fern-headers"]??!1,unifiedClientOptions:()=>this.customConfig["unified-client-options"]??!1,pascalCaseEnvironments:()=>this.customConfig["pascal-case-environments"]??!0,slnFormat:()=>this.customConfig["sln-format"]??"slnx",explicitNamespaces:()=>this.customConfig["explicit-namespaces"]===!0,maxRetries:()=>this.customConfig.maxRetries,outputPath:()=>{let t=this.customConfig["output-path"];return t==null?{library:"src",test:"src",solution:".",other:"."}:typeof t=="string"?{library:t,test:t,solution:".",other:"."}:{library:t.library??"src",test:t.test??"src",solution:t.solution??".",other:t.other??"."}}}));y(this,"constants",{folders:$({mockServerTests:()=>this.support.makeRelativeFilePath("Unit/MockServer"),types:()=>"Types",exceptions:()=>"Exceptions",src:()=>"src",protobuf:()=>"proto",serializationTests:()=>this.support.makeRelativeFilePath("Unit/Serialization"),project:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.sourceFiles,this.support.makeRelativeFilePath(this.names.files.project))),sourceFiles:()=>this.support.makeRelativeFilePath(this.constants.folders.src),coreFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.project,this.support.makeRelativeFilePath(this.constants.defaults.core))),publicCoreFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.project,this.support.makeRelativeFilePath(this.constants.defaults.core),this.support.makeRelativeFilePath(this.constants.defaults.publicCore))),testFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.sourceFiles,this.support.makeRelativeFilePath(this.names.files.testProject)))}),formatting:$({indent:()=>" "}),defaults:$({core:()=>"Core",publicCore:()=>"Public",version:()=>"0.0.0"})});y(this,"namespaces",$({root:()=>this.settings.namespace,core:()=>`${this.namespaces.root}.Core`,qualifiedRoot:()=>this.qualifyNamespace(this.namespaces.root),qualifiedCore:()=>this.qualifyNamespace(this.namespaces.core),test:()=>this.registry.canonicalizeNamespace(`${this.namespaces.root}.Test`),testUtils:()=>`${this.namespaces.test}.Utils`,mockServerTest:()=>`${this.namespaces.test}.Unit.MockServer`,publicCore:()=>this.namespaces.root,webSocketsCore:()=>`${this.namespaces.core}.WebSockets`,publicCoreTest:()=>`${this.namespaces.root}.Test.PublicCore`,asIsTestUtils:()=>`${this.namespaces.root}.Test.Utils`,publicCoreClasses:()=>this.settings.rootNamespaceForCoreClasses?this.namespaces.root:this.namespaces.core,implicit:()=>new Set(["System","System.Collections.Generic","System.IO","System.Linq","System.Threading","System.Threading.Tasks","System.Net.Http"])}));y(this,"names",{classes:$({baseApiException:()=>this.settings.baseApiExceptionClassName||`${this.names.project.clientPrefix}ApiException`,baseException:()=>this.settings.baseExceptionClassName||`${this.names.project.clientPrefix}Exception`,rootClient:()=>this.settings.clientClassName||`${this.names.project.clientPrefix}Client`,rootClientForSnippets:()=>this.settings.exportedClientClassName||this.names.classes.rootClient,customPager:()=>this.settings.customPagerName||`${this.names.project.packageId.replace(/[^a-zA-Z0-9]/g,"")}Pager`,environment:()=>this.settings.environmentClassName||`${this.names.project.clientPrefix}Environment`,exceptionInterceptor:()=>this.settings.exceptionInterceptorClassName||`${this.names.project.packageId.replace(/[^a-zA-Z0-9]/g,"")}ExceptionInterceptor`}),project:$({client:()=>Zn(es(`${this.generatorConfig.organization}_${this.generatorConfig.workspaceName}`)),clientPrefix:()=>this.settings.exportedClientClassName||this.settings.clientClassName||this.names.project.client,packageId:()=>this.settings.packageId||this.namespaces.root}),files:$({project:()=>this.namespaces.root,testProject:()=>`${this.namespaces.root}.Test`}),methods:$({mockOauth:()=>"MockOAuthEndpoint",mockInferredAuth:()=>"MockInferredAuthEndpoint",getAccessTokenAsync:()=>"GetAccessTokenAsync",getAuthHeadersAsync:()=>"GetAuthHeadersAsync"}),variables:$({client:()=>"client",response:()=>"response",httpRequest:()=>"httpRequest",sendRequest:()=>"sendRequest",responseBody:()=>"responseBody",query:()=>"_query",headers:()=>"_headers"}),parameters:$({cancellationToken:()=>"cancellationToken",requestOptions:()=>"options",idempotentOptions:()=>"options"})});y(this,"Types",$({Arbitrary:t=>new re.ArbitraryType(t,this),HttpMethodExtensions:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("HttpMethodExtensions")}),FormRequest:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("FormRequest")}),Optional:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("Optional")}),ClientOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("ClientOptions"),namespace:this.namespaces.publicCoreClasses}),RawClient:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("RawClient")}),RequestOptions:()=>this.csharp.classReference({namespace:this.namespaces.publicCoreClasses,origin:this.model.staticExplicit("RequestOptions")}),RequestOptionsInterface:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("IRequestOptions")}),JsonRequest:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("JsonRequest")}),Version:()=>this.csharp.classReference({namespace:this.namespaces.publicCore,origin:this.model.staticExplicit("Version")}),ValueConvert:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("ValueConvert")}),FileParameter:()=>this.csharp.classReference({namespace:this.namespaces.publicCore,origin:this.model.staticExplicit("FileParameter"),multipartMethodName:"AddFileParameterPart",multipartMethodNameForCollection:"AddFileParameterParts",isReferenceType:!0}),Headers:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("Headers")}),HeaderValue:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("HeaderValue")}),RootClient:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.rootClient),namespace:this.namespaces.root}),RootClientForSnippets:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.rootClientForSnippets),namespace:this.namespaces.root}),BaseApiException:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.baseApiException),namespace:this.namespaces.publicCoreClasses}),BaseException:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.baseException),namespace:this.namespaces.publicCoreClasses}),ExceptionInterceptor:()=>this.csharp.classReference({origin:this.model.staticExplicit("IExceptionInterceptor"),namespace:this.namespaces.core}),ExceptionHandler:()=>this.csharp.classReference({origin:this.model.staticExplicit("ExceptionHandler"),namespace:this.namespaces.core}),CustomExceptionInterceptor:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.exceptionInterceptor),namespace:this.namespaces.core}),ProtoAnyMapper:()=>this.csharp.classReference({origin:this.model.staticExplicit("ProtoAnyMapper"),namespace:this.namespaces.core}),Constants:()=>this.csharp.classReference({origin:this.model.staticExplicit("Constants"),namespace:this.namespaces.core}),DateTimeSerializer:()=>this.csharp.classReference({origin:this.model.staticExplicit("DateTimeSerializer"),namespace:this.namespaces.core}),JsonUtils:()=>this.csharp.classReference({origin:this.model.staticExplicit("JsonUtils"),namespace:this.namespaces.core}),JsonAssert:()=>this.csharp.classReference({origin:this.model.staticExplicit("JsonAssert"),namespace:this.namespaces.testUtils}),CustomPagerFactory:()=>this.csharp.classReference({origin:this.model.staticExplicit(`${this.names.classes.customPager}Factory`),namespace:this.namespaces.core}),CustomPagerContext:()=>this.csharp.classReference({origin:this.model.staticExplicit(`${this.names.classes.customPager}Context`),namespace:this.namespaces.core}),Environments:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.environment),namespace:this.namespaces.publicCoreClasses}),TestClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("TestClient"),namespace:this.namespaces.test}),BaseMockServerTest:()=>this.csharp.classReference({origin:this.model.staticExplicit("BaseMockServerTest"),namespace:this.namespaces.mockServerTest}),IdempotentRequestOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("IdempotentRequestOptions"),namespace:this.namespaces.publicCoreClasses}),IdempotentRequestOptionsInterface:()=>this.csharp.classReference({origin:this.model.staticExplicit("IIdempotentRequestOptions"),namespace:this.namespaces.core}),IStringEnum:()=>this.csharp.classReference({origin:this.model.staticExplicit("IStringEnum"),namespace:this.namespaces.core}),WebSocketClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("WebSocketClient"),namespace:this.namespaces.webSocketsCore}),QueryBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("Query"),namespace:this.namespaces.webSocketsCore}),QueryStringBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("QueryStringBuilder"),namespace:this.namespaces.core}),QueryStringBuilderBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("QueryStringBuilder.Builder"),namespace:this.namespaces.core}),OAuthTokenProvider:()=>this.csharp.classReference({origin:this.model.staticExplicit("OAuthTokenProvider"),namespace:this.namespaces.core}),InferredAuthTokenProvider:()=>this.csharp.classReference({origin:this.model.staticExplicit("InferredAuthTokenProvider"),namespace:this.namespaces.core}),ProtoConverter:()=>this.csharp.classReference({origin:this.model.staticExplicit("ProtoConverter"),namespace:this.namespaces.core}),RawGrpcClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("RawGrpcClient"),namespace:this.namespaces.core}),Extensions:()=>this.csharp.classReference({origin:this.model.staticExplicit("Extensions"),namespace:this.namespaces.core}),GrpcRequestOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("GrpcRequestOptions"),namespace:this.namespaces.root}),GrpcChannelOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("GrpcChannelOptions"),namespace:"Grpc.Net.Client"}),StringEnum:t=>this.csharp.classReference({origin:this.model.staticExplicit("StringEnum"),namespace:this.namespaces.core,generics:t?[t]:void 0}),WebSocketEvent:t=>this.csharp.classReference({origin:this.model.staticExplicit("Event"),namespace:this.namespaces.webSocketsCore,generics:[t]}),ConnectionStatus:()=>this.csharp.classReference({origin:this.model.staticExplicit("ConnectionStatus"),namespace:this.namespaces.webSocketsCore}),WebSocketConnected:()=>this.csharp.classReference({origin:this.model.staticExplicit("Connected"),namespace:this.namespaces.webSocketsCore}),WebSocketClosed:()=>this.csharp.classReference({origin:this.model.staticExplicit("Closed"),namespace:this.namespaces.webSocketsCore}),ReconnectionInfo:()=>this.csharp.classReference({origin:this.model.staticExplicit("ReconnectionInfo"),namespace:this.namespaces.webSocketsCore}),CustomPagerClass:t=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.customPager),namespace:this.namespaces.core,generics:[t]}),Pager:t=>this.csharp.classReference({origin:this.model.staticExplicit("Pager"),namespace:this.namespaces.core,generics:[t]}),OffsetPager:({requestType:t,requestOptionsType:r,responseType:i,offsetType:o,stepType:c,itemType:l})=>this.csharp.classReference({origin:this.model.staticExplicit("OffsetPager"),namespace:this.namespaces.core,generics:[t,r,i,o,c,l]}),CursorPager:({requestType:t,requestOptionsType:r,responseType:i,cursorType:o,itemType:c})=>this.csharp.classReference({origin:this.model.staticExplicit("CursorPager"),namespace:this.namespaces.core,generics:[t,r,i,o,c]}),CollectionItemSerializer:(t,r)=>this.csharp.classReference({origin:this.model.staticExplicit("CollectionItemSerializer"),namespace:this.namespaces.core,generics:[t,r]}),OneOfSerializer:t=>this.csharp.classReference({origin:this.model.staticExplicit("OneOfSerializer"),namespace:this.namespaces.core,generics:[t]}),AdditionalProperties:t=>this.csharp.classReference({origin:this.model.staticExplicit("AdditionalProperties"),namespace:this.namespaces.publicCore,generics:t?[t]:void 0}),ReadOnlyAdditionalProperties:t=>this.csharp.classReference({origin:this.model.staticExplicit("ReadOnlyAdditionalProperties"),namespace:this.namespaces.publicCore,generics:t?[t]:void 0})}));y(this,"Primitive",$({string:()=>new re.String(this),boolean:()=>new re.Boolean(this),integer:()=>new re.Integer(this),long:()=>new re.Long(this),uint:()=>new re.Uint(this),ulong:()=>new re.ULong(this),float:()=>new re.Float(this),double:()=>new re.Double(this),object:()=>new re.Object(this)}));y(this,"Value",$({binary:()=>new Ue.Binary(this),dateOnly:()=>new Ue.DateOnly(this),dateTime:()=>new Ue.DateTime(this),uuid:()=>new Ue.Uuid(this),stringEnum:t=>new Ue.StringEnum(t,this)}));y(this,"Collection",$({array:t=>new xe.Array(t,this),listType:t=>new xe.ListType(t,this),list:t=>new xe.List(t,this),set:t=>new xe.Set(t,this),map:(t,r,i)=>new xe.Map(t,r,this,i),idictionary:(t,r,i)=>new xe.IDictionary(t,r,this,i),keyValuePair:(t,r)=>new xe.KeyValuePair(t,r,this)}));y(this,"format",$({private:t=>`_${ts.camelCase(t)}`}));y(this,"initializers",$({implicitNamespaces:()=>{for(let t of this.namespaces.implicit)this.registry.addImplicitNamespace(t);return!0}}));this.intermediateRepresentation=t,this.apiName=r,this.customConfig=i,this.generatorConfig=o,this.support=c;let l=V.IR.IntermediateRepresentation(t)?t.casingsConfig:void 0;this.case=new Rn({generationLanguage:"csharp",keywords:l?.keywords,smartCasing:l?.smartCasing??!0}),this.model=new fo(t,this),this.ir=V.IR.IntermediateRepresentation(t)?t:{},this.dir=V.DynamicIR.DynamicIntermediateRepresentation(t)?t:{}}initialize(){return this.initializers.implicitNamespaces}get System(){return this.extern.System}get NUnit(){return this.extern.NUnit}get OneOf(){return this.extern.OneOf}get Google(){return this.extern.Google}get Grpc(){return this.extern.Grpc}get WireMock(){return this.extern.WireMock}qualifyNamespace(t){let r=t.split(".")[0];return r&&this.registry.hasTypeNamespaceConflict(r)?`global::${t}`:t}};n();a();s();var Xe=class{constructor(t){y(this,"generation");this.generation=t}get csharp(){return this.generation.csharp}get case(){return this.generation.case}get settings(){return this.generation.settings}get constants(){return this.generation.constants}get namespaces(){return this.generation.namespaces}get names(){return this.generation.names}get model(){return this.generation.model}get format(){return this.generation.format}get registry(){return this.generation.registry}get Types(){return this.generation.Types}get System(){return this.generation.extern.System}get NUnit(){return this.generation.extern.NUnit}get OneOf(){return this.generation.extern.OneOf}get Google(){return this.generation.extern.Google}get Grpc(){return this.generation.extern.Grpc}get WireMock(){return this.generation.extern.WireMock}get Primitive(){return this.generation.Primitive}get Value(){return this.generation.Value}get Collection(){return this.generation.Collection}};n();a();s();var ho=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}convert(r){if(r.value===null)return this.context.isNullable(r.typeReference)?this.csharp.Literal.null():(this.context.errors.add({severity:ee.Critical,message:"Expected non-null value, but got null"}),this.csharp.Literal.nop());if(r.value===void 0&&!r.fallbackToDefault)return this.csharp.Literal.nop();switch(r.typeReference.type){case"list":return this.convertList({list:r.typeReference.value,value:r.value,fallbackToDefault:r.fallbackToDefault});case"literal":return this.convertLiteral({literal:r.typeReference.value,value:r.value});case"map":return this.convertMap({map:r.typeReference,value:r.value,fallbackToDefault:r.fallbackToDefault});case"named":{let i=this.context.resolveNamedType({typeId:r.typeReference.value});return i==null?this.csharp.Literal.nop():this.convertNamed({named:i,value:r.value,as:r.as,fallbackToDefault:r.fallbackToDefault})}case"nullable":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"optional":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"primitive":return this.convertPrimitive({primitive:r.typeReference.value,value:r.value,as:r.as,fallbackToDefault:r.fallbackToDefault});case"set":return this.convertSet({set:r.typeReference.value,value:r.value,fallbackToDefault:r.fallbackToDefault});case"unknown":return this.convertUnknown({value:r.value,fallbackToDefault:r.fallbackToDefault});default:ce(r.typeReference)}}convertList({list:r,value:i,fallbackToDefault:o}){return Array.isArray(i)?this.csharp.Literal.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:r,unboxOptionals:!0}),values:i.map((c,l)=>{this.context.errors.scope({index:l});try{return this.convert({typeReference:r,value:c})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:ee.Critical,message:`Expected array but got: ${typeof i}`}),this.csharp.Literal.nop())}convertLiteral({literal:r,value:i,fallbackToDefault:o}){switch(r.type){case"boolean":{let c=this.context.getValueAsBoolean({value:i});return c==null?this.csharp.Literal.nop():this.csharp.Literal.boolean(c)}case"string":{let c=this.context.getValueAsString({value:i});return c==null?o?this.Primitive.string.getDeterminsticDefault(o):this.csharp.Literal.nop():this.csharp.Literal.string(c)}default:ce(r)}}convertSet({set:r,value:i,fallbackToDefault:o}){return Array.isArray(i)?this.csharp.Literal.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:r,unboxOptionals:!0}),values:i.map((c,l)=>{this.context.errors.scope({index:l});try{return this.convert({typeReference:r,value:c})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:ee.Critical,message:`Expected array but got: ${typeof i}`}),this.csharp.Literal.nop())}convertMap({map:r,value:i,fallbackToDefault:o}){return typeof i!="object"||i==null?(this.context.errors.add({severity:ee.Critical,message:`Expected object but got: ${i==null?"null":typeof i}`}),this.csharp.Literal.nop()):this.csharp.Literal.dictionary({keyType:this.context.dynamicTypeMapper.convert({typeReference:r.key}),valueType:r.value.type==="unknown"?this.context.dynamicTypeMapper.convert({typeReference:r.value}).asOptional():this.context.dynamicTypeMapper.convert({typeReference:r.value}),entries:Object.entries(i).map(([c,l])=>{this.context.errors.scope(c);try{return{key:this.convert({typeReference:r.key,value:c,as:"key"}),value:this.convert({typeReference:r.value,value:l})}}finally{this.context.errors.unscope()}})})}convertNamed({named:r,value:i,as:o,fallbackToDefault:c}){switch(r.type){case"alias":return this.convert({typeReference:r.typeReference,value:i,as:o,fallbackToDefault:c});case"discriminatedUnion":return this.settings.shouldGeneratedDiscriminatedUnions?this.convertDiscriminatedUnion({discriminatedUnion:r,value:i,fallbackToDefault:c}):this.convertUnknown({value:i,fallbackToDefault:c});case"enum":return this.getEnumValue(r,i);case"object":return this.convertObject({object_:r,value:i,fallbackToDefault:c});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:r,value:i,fallbackToDefault:c});default:ce(r)}}convertDiscriminatedUnion({discriminatedUnion:r,value:i,fallbackToDefault:o}){let c=this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),l=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:i});if(l==null)return this.csharp.Literal.nop();let S=l.singleDiscriminatedUnionType,w=this.getBaseProperties({discriminatedUnionTypeInstance:l,singleDiscriminatedUnionType:S});switch(S.type){case"samePropertiesAsObject":{let I=this.context.resolveNamedType({typeId:S.typeId});return I==null?this.csharp.Literal.nop():this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.convertNamed({named:I,value:l.value})]})}case"singleProperty":{if(this.context.getRecord(l.value)==null)return this.csharp.Literal.nop();try{let A=["Value","Type"].includes(S.discriminantValue.name.pascalCase.safeName)?`${S.discriminantValue.name.pascalCase.safeName}Inner`:S.discriminantValue.name.pascalCase.safeName;return this.context.errors.scope(S.discriminantValue.wireValue),this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.csharp.instantiateClass({classReference:this.csharp.classReference({name:A,enclosingType:c}),arguments_:[this.convert({typeReference:S.typeReference,value:S.discriminantValue.wireValue})]})]})}finally{this.context.errors.unscope()}}case"noProperties":return this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.csharp.instantiateClass({classReference:this.csharp.classReference({origin:l.discriminantValue,enclosingType:c}),arguments_:[]})]});default:ce(S)}}getBaseProperties({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:i}){return this.context.associateByWireValue({parameters:i.properties??[],values:this.context.getRecord(r.value)??{},ignoreMissingParameters:!0}).map(c=>{this.context.errors.scope(c.name.wireValue);try{return{name:this.context.getPropertyName(c.name.name),assignment:this.convert(c)}}finally{this.context.errors.unscope()}})}instantiateUnionWithBaseProperties({classReference:r,arguments_:i,baseProperties:o}){let c=this.csharp.instantiateClass({classReference:r,arguments_:i,multiline:!0});return o.length===0?this.csharp.Literal.reference(c):this.csharp.Literal.reference(this.csharp.codeblock(l=>{l.write(c," "),l.pushScope();for(let S of o)l.write(S.name," = ",S.assignment,",");l.popScope(!1)}))}getEnumValue(r,i){if(typeof i!="string")return this.context.errors.add({severity:ee.Critical,message:`Expected enum value string, got: ${typeof i}`}),this.csharp.Literal.nop();let o=r.values.find(S=>S.wireValue===i);if(o==null)return this.context.errors.add({severity:ee.Critical,message:`An enum value named "${i}" does not exist in this context`}),this.csharp.Literal.nop();let c=this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),l=c.registerField(this.model.getPropertyNameFor(o),o);return this.csharp.Literal.reference(this.csharp.enumInstantiation({reference:c,value:l}))}convertObject({object_:r,value:i,fallbackToDefault:o}){let c=this.context.associateByWireValue({parameters:r.properties,values:this.context.getRecord(i)??{}});return this.csharp.Literal.class_({reference:this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),fields:c.map(l=>{this.context.errors.scope(l.name.wireValue);try{return{name:this.context.getClassName(l.name.name),value:this.convert(l)}}finally{this.context.errors.unscope()}})})}convertUndiscriminatedUnion({undiscriminatedUnion:r,value:i,fallbackToDefault:o}){let c=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:i});return c==null?this.csharp.Literal.nop():c.typeLiteral}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:i}){for(let o of r.types)try{let c=this.convert({typeReference:o,value:i});return{valueTypeReference:o,typeLiteral:c}}catch{continue}this.context.errors.add({severity:ee.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof i}" value`})}convertUnknown({value:r,fallbackToDefault:i}){return this.csharp.Literal.unknown(r)}convertPrimitive({primitive:r,value:i,as:o,fallbackToDefault:c}){switch(r){case"INTEGER":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.integer.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.integer(l)}case"LONG":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.long.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.long(l)}case"UINT":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.uint.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.uint(l)}case"UINT_64":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.ulong.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.ulong(l)}case"FLOAT":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.float.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.float(l)}case"DOUBLE":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.double.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.double(l)}case"BOOLEAN":{let l=this.getValueAsBoolean({value:i,as:o});return l==null?c?this.Primitive.boolean.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.boolean(l)}case"STRING":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"DATE":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Value.dateOnly.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.date(l)}case"DATE_TIME":case"DATE_TIME_RFC_2822":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Value.dateTime.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.datetime(l)}case"UUID":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"BASE_64":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"BIG_INTEGER":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}default:ce(r)}}getValueAsNumber({value:r,as:i}){let o=i==="key"&&typeof r=="string"?Number(r):r;return this.context.getValueAsNumber({value:o})}getValueAsBoolean({value:r,as:i}){let o=i==="key"?typeof r=="string"?r==="true":r==="false"?!1:r:r;return this.context.getValueAsBoolean({value:o})}};n();a();s();var yo=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}convert(r){switch(r.typeReference.type){case"list":return this.Collection.list(this.convert({typeReference:r.typeReference.value,unboxOptionals:!0}));case"literal":return this.convertLiteral({literal:r.typeReference.value});case"map":return this.Collection.map(this.convert({typeReference:r.typeReference.key}),this.convert({typeReference:r.typeReference.value}));case"named":{let i=this.context.resolveNamedType({typeId:r.typeReference.value});return i==null?this.convertUnknown():this.convertNamed({named:i})}case"optional":case"nullable":{let i=this.convert({typeReference:r.typeReference.value});return r.unboxOptionals?i.asNonOptional():i.asOptional()}case"primitive":return this.convertPrimitive({primitive:r.typeReference.value});case"set":return this.Collection.set(this.convert({typeReference:r.typeReference.value,unboxOptionals:!0}));case"unknown":return this.convertUnknown();default:ce(r.typeReference)}}convertToClassReference(r){return this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)})}convertNamed({named:r}){switch(r.type){case"alias":return this.convert({typeReference:r.typeReference});case"enum":case"object":return this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)});case"discriminatedUnion":return this.settings.shouldGeneratedDiscriminatedUnions?this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}):this.Primitive.object;case"undiscriminatedUnion":return this.settings.shouldGenerateUndiscriminatedUnions?this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}):this.OneOf.OneOf(r.types.map(i=>this.convert({typeReference:i})));default:ce(r)}}convertLiteral({literal:r}){switch(r.type){case"boolean":return this.Primitive.boolean;case"string":return this.Primitive.string}}convertUnknown(){return this.Primitive.object}convertPrimitive({primitive:r}){switch(r){case"INTEGER":return this.Primitive.integer;case"UINT":return this.Primitive.uint;case"LONG":return this.Primitive.long;case"UINT_64":return this.Primitive.ulong;case"FLOAT":return this.Primitive.float;case"DOUBLE":return this.Primitive.double;case"BOOLEAN":return this.Primitive.boolean;case"STRING":return this.Primitive.string;case"DATE":return this.Value.dateOnly;case"DATE_TIME":case"DATE_TIME_RFC_2822":return this.Value.dateTime;case"UUID":return this.Primitive.string;case"BASE_64":return this.Primitive.string;case"BIG_INTEGER":return this.Primitive.string;default:ce(r)}}};n();a();s();var go=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}getFilePropertyInfo({body:r,value:i}){let o={fileFields:[],bodyPropertyFields:[]},c=this.context.getRecord(i)??{};for(let l of r.properties)switch(l.type){case"file":V.Record.missingKey(c,l.wireValue)&&(c[l.wireValue]="[bytes]"),o.fileFields.push({name:this.context.getPropertyName(l.name),value:this.getSingleFileProperty({property:l,record:c})});break;case"fileArray":V.Record.missingKey(c,l.wireValue)&&(c[l.wireValue]=["[bytes]"]),o.fileFields.push({name:this.context.getPropertyName(l.name),value:this.getArrayFileProperty({property:l,record:c})});break;case"bodyProperty":if(V.Record.missingKey(c,l.name.wireValue))switch(l.typeReference.type){case"optional":break;case"primitive":{switch(l.typeReference.value.toLowerCase()){case"integer":{c[l.name.wireValue]=123;break}case"string":{c[l.name.wireValue]="[string]";break}case"boolean":{c[l.name.wireValue]=!0;break}case"double":{c[l.name.wireValue]=123.456;break}case"float":{c[l.name.wireValue]=123.456;break}case"long":{c[l.name.wireValue]=123456789;break}case"uint":{c[l.name.wireValue]=123;break}case"uint64":{c[l.name.wireValue]=12345;break}case"date":{c[l.name.wireValue]=new Date(2021,1,1);break}case"datetime":{c[l.name.wireValue]=new Date(2021,1,1,12,0,0);break}case"uuid":{c[l.name.wireValue]="123e4567-e89b-12d3-a456-426614174000";break}case"base64":{c[l.name.wireValue]="SGVsbG8gd29ybGQh";break}case"biginteger":{c[l.name.wireValue]="12345678901234567890";break}}break}default:break}o.bodyPropertyFields.push({name:this.context.getPropertyName(l.name.name),value:this.getBodyProperty({property:l,record:c})});break;default:ce(l)}return o}getSingleFileProperty({property:r,record:i}){let o=this.context.getSingleFileValue({property:r,record:i});return o==null?this.csharp.Literal.nop():this.context.getFileParameterForString(o)}getArrayFileProperty({property:r,record:i}){let o=this.context.getFileArrayValues({property:r,record:i});return o==null?this.csharp.Literal.nop():this.csharp.Literal.list({valueType:this.Types.FileParameter,values:o.map(c=>this.context.getFileParameterForString(c))})}getBodyProperty({property:r,record:i}){let o=i[r.name.wireValue];return o==null?this.csharp.Literal.nop():this.context.dynamicLiteralMapper.convert({typeReference:r.typeReference,value:o})}};var bo=class e extends Mi{constructor({ir:r,config:i,options:o,generation:c}){super({ir:r,config:i,options:o});y(this,"ir");y(this,"dynamicTypeMapper");y(this,"dynamicLiteralMapper");y(this,"filePropertyMapper");y(this,"generation");this.ir=r,this.generation=c??new On(r,i.workspaceName,i.customConfig!=null?i.customConfig:{},i),this.dynamicTypeMapper=new yo({context:this}),this.dynamicLiteralMapper=new ho({context:this}),this.filePropertyMapper=new go({context:this})}get namespaces(){return this.generation.namespaces}get registry(){return this.generation.registry}get settings(){return this.generation.settings}get constants(){return this.generation.constants}get names(){return this.generation.names}get model(){return this.generation.model}get format(){return this.generation.format}get csharp(){return this.generation.csharp}get Types(){return this.generation.Types}get System(){return this.generation.extern.System}get NUnit(){return this.generation.extern.NUnit}get OneOf(){return this.generation.extern.OneOf}get Google(){return this.generation.extern.Google}get WireMock(){return this.generation.extern.WireMock}get Primitive(){return this.generation.Primitive}get Value(){return this.generation.Value}get Collection(){return this.generation.Collection}clone(){return new e({ir:this.ir,config:this.config,options:this.options,generation:this.generation})}getFileParameterForString(r){return this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.FileParameter,arguments_:[],properties:[{name:"Stream",value:this.getMemoryStreamForString(r)}],multiline:!0}))}getMemoryStreamForString(r){return this.System.IO.MemoryStream.new({arguments_:[this.csharp.invokeMethod({on:this.System.Text.Encoding_UTF8,method:"GetBytes",arguments_:[this.csharp.Literal.string(r)]})]})}getClassName(r){return r.pascalCase.safeName}getParameterName(r){return r.camelCase.safeName}getPropertyName(r){return r.pascalCase.safeName}getMethodName(r){return`${r.pascalCase.safeName}Async`}getNamespace(r,i){let o=this.getNamespaceSegments(r);return o=i!=null?[...o,i]:o,[this.namespaces.root,...o].join(".")}getEnvironmentTypeReferenceFromID(r){let i=this.resolveEnvironmentName(r);if(i!=null)return this.getEnvironmentClassReferenceForEnumName(i)}getEnvironmentClassReferenceForEnumName(r){return this.csharp.classReference({name:`${this.generation.Types.Environments.name}.${this.getClassName(r)}`,namespace:this.namespaces.root})}getNamespaceSegments(r){return(this.settings.explicitNamespaces?r.allParts:r.packagePath).map(o=>o.pascalCase.safeName)}precalculate(r){this.generation.initialize(),this.System.Collections.Generic.KeyValuePair(),this.System.Collections.Generic.IEnumerable(),this.System.Collections.Generic.IAsyncEnumerable(),this.System.Collections.Generic.HashSet(),this.System.Collections.Generic.List(),this.System.Collections.Generic.Dictionary(),this.System.Threading.Tasks.Task(),Object.entries(this.ir.types).sort((i,o)=>i[0].length-o[0].length).forEach(([i,o])=>{this.dynamicTypeMapper.convertToClassReference(o)});for(let[i,o]of r.entries())if(this.csharp.classReference({origin:this.model.staticExplicit(`Example${i}`),namespace:"Usage"}),o.endpoint){let c=this.resolveEndpointLocation(o.endpoint);for(let l of c)switch(l.request.type){case"inlined":this.csharp.classReference({origin:l.request.declaration.name,namespace:this.getNamespace(l.request.declaration.fernFilepath)});break;case"body":break}}this.generation.Types.ClientOptions,this.generation.Types.RootClientForSnippets,this.csharp.freezeClassReferences()}};n();a();s();var xo=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}async generateSnippet({endpoint:r,request:i,options:o}){return this.buildCodeBlock({endpoint:r,snippet:i,options:o}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map,skipGlobalQualifier:!0})}generateSnippetSync({endpoint:r,request:i,options:o}){return this.buildCodeBlock({endpoint:r,snippet:i,options:o}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map,skipGlobalQualifier:!0})}async generateSnippetAst({endpoint:r,request:i,options:o}){throw new Error("Unsupported")}buildCodeBlock({endpoint:r,snippet:i,options:o}){if(r.examples&&!r.examples?.find(S=>V.DynamicIR.EndpointExample(i)&&S.id===i.id))throw new Error("Endpoint does not have an example that matches the snippet");let c=this.csharp.codeblock(S=>{S.writeNodeStatement(this.constructClient({endpoint:r,snippet:i})),S.newLine(),S.writeNodeStatement(this.callMethod({endpoint:r,snippet:i}))}),l=this.getStyle(o);switch(l){case $t.Concise:return c;case $t.Full:return this.buildFullCodeBlock({body:c,options:o});default:ce(l)}}buildFullCodeBlock({body:r,options:i}){let o=this.getConfig(i),c=this.csharp.class_({name:o.fullStyleClassName??"Example",namespace:"Usage",access:Ti.Access.Public});return c.addNamespaceReference(this.Types.RootClientForSnippets.namespace),c.addMethod({name:"Do",access:Ti.Access.Public,isAsync:!0,parameters:[],body:r}),c}constructClient({endpoint:r,snippet:i}){return this.csharp.codeblock(o=>{o.write("var client = "),o.writeNode(this.getRootClientConstructorInvocation(this.getConstructorArgs({endpoint:r,snippet:i})))})}callMethod({endpoint:r,snippet:i}){let o=r.response?.type==="streaming"||r.response?.type==="streamParameter",c=this.csharp.invokeMethod({on:this.csharp.codeblock("client"),method:this.getMethod({endpoint:r}),arguments_:this.getMethodArgs({endpoint:r,snippet:i}),async:!0,configureAwait:!0,multiline:!0,isAsyncEnumerable:o});return o?this.csharp.codeblock(l=>{l.write("await foreach (var item in "),l.writeNode(c),l.writeLine(")"),l.pushScope(),l.writeLine("/* consume each item */"),l.popScope()}):c}getConstructorArgs({endpoint:r,snippet:i}){let o=[];r.auth!=null&&(i.auth!=null?o.push(...this.getConstructorAuthArgs({auth:r.auth,values:i.auth})):this.context.errors.add({severity:ee.Warning,message:`Auth with ${r.auth.type} configuration is required for this endpoint`}));let c=[],l=this.getConstructorBaseUrlArgs({baseUrl:i.baseURL,environment:i.environment});l.length>0&&c.push(...l),this.context.errors.scope(et.Headers);let S=[];if(this.context.ir.headers!=null&&i.headers!=null&&S.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:i.headers})),this.context.errors.unscope(),this.settings.unifiedClientOptions){let w=[...o.map(I=>({name:Le(I.name),assignment:I.assignment})),...S.map(I=>({name:Le(I.name),assignment:I.assignment})),...c.map(I=>({name:I.name,assignment:I.assignment}))];return w.length===0?[]:[{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:w,multiline:!0})}]}return c.length===0?[...o,...S]:[...o,...S,{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:c.map(w=>({name:w.name,assignment:w.assignment})),multiline:!0})}]}getConstructorBaseUrlArgs({baseUrl:r,environment:i}){let o=this.getBaseUrlArg({baseUrl:r,environment:i});return V.Literal.nop(o)?[]:[{name:this.getBaseUrlOptionName(),assignment:o}]}getBaseUrlArg({baseUrl:r,environment:i}){if(r!=null&&i!=null)return this.context.errors.add({severity:ee.Critical,message:"Cannot specify both baseUrl and environment options"}),this.csharp.Literal.nop();if(r!=null)return this.context.ir.environments?.environments.type==="multipleBaseUrls"?(this.context.errors.add({severity:ee.Critical,message:"The C# SDK doesn't support a baseUrl when multiple URL environments are configured"}),this.csharp.Literal.nop()):this.csharp.Literal.string(r);if(i!=null){if(this.context.isSingleEnvironmentID(i)){let o=this.context.getEnvironmentTypeReferenceFromID(i);return o==null?(this.context.errors.add({severity:ee.Warning,message:`Environment ${JSON.stringify(i)} was not found`}),this.csharp.Literal.nop()):this.csharp.Literal.reference(o)}if(this.context.isMultiEnvironmentValues(i))return this.context.validateMultiEnvironmentUrlValues(i)?this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.Environments,arguments_:Object.entries(i).map(([o,c])=>({name:Le(cr(o)),assignment:this.context.dynamicLiteralMapper.convert({typeReference:{type:"primitive",value:"STRING"},value:c})})),multiline:!0})):this.csharp.Literal.nop()}return this.csharp.Literal.nop()}getConstructorAuthArgs({auth:r,values:i}){if(i.type!==r.type)return this.addError(this.context.newAuthMismatchError({auth:r,values:i}).message),[];switch(r.type){case"basic":return i.type==="basic"?this.getConstructorBasicAuthArg({auth:r,values:i}):[];case"bearer":return i.type==="bearer"?this.getConstructorBearerAuthArgs({auth:r,values:i}):[];case"header":return i.type==="header"?this.getConstructorHeaderAuthArgs({auth:r,values:i}):[];case"oauth":return i.type==="oauth"?this.getConstructorOAuthArgs({auth:r,values:i}):[];case"inferred":return i.type==="inferred"?this.getConstructorInferredAuthArgs({auth:r,values:i}):[];default:ce(r)}}addError(r){this.context.errors.add({severity:ee.Critical,message:r})}addWarning(r){this.context.errors.add({severity:ee.Warning,message:r})}getConstructorBasicAuthArg({auth:r,values:i}){return[{name:this.context.getParameterName(r.username),assignment:this.csharp.Literal.string(i.username)},{name:this.context.getParameterName(r.password),assignment:this.csharp.Literal.string(i.password)}]}getConstructorBearerAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.token),assignment:this.csharp.Literal.string(i.token)}]}getConstructorHeaderAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.header.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:r.header.typeReference,value:i.value,fallbackToDefault:r.header.name.wireValue})}]}getConstructorOAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.clientId),assignment:this.csharp.Literal.string(i.clientId)},{name:this.context.getParameterName(r.clientSecret),assignment:this.csharp.Literal.string(i.clientSecret)}]}getConstructorInferredAuthArgs({auth:r,values:i}){let o=[];if(r.parameters!=null)for(let c of r.parameters){let l=c.name.wireValue,S=i.values?.[l];o.push({name:this.context.getParameterName(c.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:c.typeReference,value:S,fallbackToDefault:l})})}else this.context.errors.add({severity:ee.Critical,message:"Inferred auth parameters are not defined in the IR. Please ensure you're using IR version 62.3.0 or later."});return o}getConstructorHeaderArgs({headers:r,values:i}){let o=[];for(let c of r){let l=i[c.name.wireValue],S=this.getConstructorHeaderArg({header:c,value:l});S!=null&&o.push({name:this.context.getParameterName(c.name.name),assignment:S})}return o}getConstructorHeaderArg({header:r,value:i}){let o=this.context.dynamicLiteralMapper.convert({typeReference:r.typeReference,value:i,fallbackToDefault:r.name.wireValue});if(!V.Literal.nop(o))return o}getMethodArgs({endpoint:r,snippet:i}){switch(r.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:r.request,snippet:i});case"body":return this.getMethodArgsForBodyRequest({request:r.request,snippet:i});default:ce(r.request)}}getMethodArgsForInlinedRequest({request:r,snippet:i}){let o=[];this.context.errors.scope(et.PathParameters);let c=[],l=[...this.context.ir.pathParameters??[],...r.pathParameters??[]];l.length>0&&c.push(...this.getPathParameters({namedParameters:l,snippet:i})),this.context.errors.unscope(),this.context.errors.scope(et.RequestBody);let S=this.getFilePropertyInfo({request:r,snippet:i});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:this.settings.shouldInlinePathParameters})||o.push(...c.map(w=>w.value)),o.push(this.getInlinedRequestArg({request:r,snippet:i,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:this.settings.shouldInlinePathParameters})?c:[],filePropertyInfo:S})),o}getFilePropertyInfo({request:r,snippet:i}){return r.body==null||!this.context.isFileUploadRequestBody(r.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:r.body,value:i.requestBody})}getInlinedRequestArg({request:r,snippet:i,pathParameterFields:o,filePropertyInfo:c}){this.context.errors.scope(et.QueryParameters);let S=this.context.associateQueryParametersByWireValue({parameters:r.queryParameters??[],values:i.queryParameters??{}}).map(P=>({name:this.context.getPropertyName(P.name.name),value:this.context.dynamicLiteralMapper.convert(P)}));this.context.errors.unscope(),this.context.errors.scope(et.Headers);let I=this.context.associateByWireValue({parameters:r.headers??[],values:i.headers??{}}).map(P=>({name:this.context.getPropertyName(P.name.name),value:this.context.dynamicLiteralMapper.convert({...P,fallbackToDefault:P.name.wireValue})}));this.context.errors.unscope(),this.context.errors.scope(et.RequestBody);let A=r.body!=null?this.getInlinedRequestBodyConstructorFields({body:r.body,value:i.requestBody,filePropertyInfo:c}):[];return this.context.errors.unscope(),this.csharp.Literal.class_({reference:this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),fields:[...o,...S,...I,...A]})}getInlinedRequestBodyConstructorFields({body:r,value:i,filePropertyInfo:o}){switch(r.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:r.value,value:i});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:r,value:i})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:o});default:ce(r)}}getInlinedRequestBodyPropertyConstructorFields({parameters:r,value:i}){let o=[],c=this.context.associateByWireValue({parameters:r,values:this.context.getRecord(i)??{}});for(let l of c)o.push({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicLiteralMapper.convert({...l,fallbackToDefault:l.name.wireValue})});return o}getFileUploadRequestBodyConstructorFields({filePropertyInfo:r}){return[...r.fileFields,...r.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:r,value:i}){return{name:this.context.getPropertyName(r.bodyKey),value:this.getReferencedRequestBodyPropertyLiteral({body:r.bodyType,value:i})}}getReferencedRequestBodyPropertyLiteral({body:r,value:i}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:i});case"typeReference":return this.context.dynamicLiteralMapper.convert({typeReference:r.value,value:i,fallbackToDefault:JSON.stringify(r.value)});default:ce(r)}}getMethodArgsForBodyRequest({request:r,snippet:i}){let o=[];this.context.errors.scope(et.PathParameters);let c=[...this.context.ir.pathParameters??[],...r.pathParameters??[]];return c.length>0&&o.push(...this.getPathParameters({namedParameters:c,snippet:i}).map(l=>l.value)),this.context.errors.unscope(),this.context.errors.scope(et.RequestBody),r.body!=null&&o.push(this.getBodyRequestArg({body:r.body,value:i.requestBody})),this.context.errors.unscope(),o}getBodyRequestArg({body:r,value:i}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:i});case"typeReference":return r.value.type==="optional"&&i==null?this.csharp.Literal.null():this.context.dynamicLiteralMapper.convert({typeReference:r.value,value:i,fallbackToDefault:JSON.stringify(r.value)});default:ce(r)}}getBytesBodyRequestArg({value:r}){let i=this.context.getValueAsString({value:r});return i==null&&(this.context.errors.add({severity:ee.Critical,message:"The bytes request body must be provided in string format"}),i="[bytes]"),this.csharp.Literal.reference(this.context.getMemoryStreamForString(i))}getRootClientConstructorInvocation(r){return this.csharp.instantiateClass({classReference:this.Types.RootClientForSnippets,arguments_:r,forceUseConstructor:!0,multiline:!0})}getPathParameters({namedParameters:r,snippet:i}){let o=[],c=this.context.associateByWireValueOrDefault({parameters:r,values:i.pathParameters??{}});for(let l of c)o.push({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicLiteralMapper.convert({...l,fallbackToDefault:l.name.wireValue})});return o}getMethod({endpoint:r}){return r.declaration.fernFilepath.allParts.length>0?`${r.declaration.fernFilepath.allParts.map(i=>this.context.getClassName(i)).join(".")}.${this.context.getMethodName(r.declaration.name)}`:this.context.getMethodName(r.declaration.name)}getBaseUrlOptionName(){return this.context.ir.environments?.environments.type==="multipleBaseUrls"?"Environment":"BaseUrl"}getStyle(r){return r.style??this.context.options.style??$t.Full}getConfig(r){return r.config??this.context.options.config??{}}};var So=class extends Bi{constructor({ir:t,config:r,options:i={}}){super(new bo({ir:t,config:r,options:i}))}precalculate(t){this.context.precalculate(t)}async generate(t,r={}){return super.generate(t,r)}generateSync(t,r={}){return super.generateSync(t,r)}async generateSnippetAst(t){return super.generateSnippetAst(t)}createSnippetGenerator(t){return new xo({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
33
+ ${_i()}`)}return this.generation.registry.registerClassReference(t,r)}freezeClassReferences(){this.frozen=!0}getPropertyName(t,r){let i=this.model.getPropertyNameFor(r),o=this.model.origin(r);if(o){let c=t.getFieldName(o,i);if(c)return c}return i}class_(t){let r=t;return"reference"in t&&(r={...t.reference,...t}),new rt(r,this.generation)}testClass(t){return new wi(t,this.generation)}annotation(t){return new ft(t,this.generation)}annotationGroup(t){return new qr(t,this.generation)}instantiateClass(t){return new Nr(t,this.generation)}invokeMethod(t){return new Cr(t,this.generation)}codeblock(t){return new Ot(t,this.generation)}code(){return new Pt({},this.generation)}anonymousFunction(t){return new Gr(t)}parameter(t){return new Ke(t,this.generation)}interface_(t){return new Si(t,this.generation)}enum_(t){return new xi(t,this.generation)}dictionary(t){return new Rr(t,this.generation)}list(t){return new Pr(t,this.generation)}readOnlyMemory(t){return new _r(t,this.generation)}set(t){return new kr(t,this.generation)}switch_(t){return new $r(t,this.generation)}ternary(t){return new Hr(t,this.generation)}and(t){return new zr(t,this.generation)}or(t){return new Wr(t,this.generation)}enumInstantiation(t){return new Or(t,this.generation)}string_(t){return new Fr(t,this.generation)}xmlDocBlock(t){return new kt(t,this.generation)}xmlDocBlockOf(t){return t instanceof kt?t:new kt(t,this.generation)}validateReadOnlyMemoryTypes(){for(let t of this.generation.settings.readOnlyMemoryTypes)if(!this.VALID_READ_ONLY_MEMORY_TYPES.has(t))throw new Error(`Type "${t}" is not a valid 'read-only-memory-types' custom config option; expected one of ${JSON.stringify(this.VALID_READ_ONLY_MEMORY_TYPES)}.`)}};n();a();s();function $(e){let t={},r={};for(let[i,o]of Object.entries(e))o.length===0?Object.defineProperty(r,i,{get(){return i in t||(t[i]=o()),t[i]},enumerable:!0,configurable:!0}):r[i]=o;return r}n();a();s();var lo=class{constructor(t){y(this,"generation");y(this,"System",$({Action:t=>this.csharp.classReference({name:"Action",namespace:"System",generics:t||void 0,multipartMethodName:null,multipartMethodNameForCollection:null,isReferenceType:!0}),Func:(t,r)=>this.csharp.classReference({name:"Func",namespace:"System",generics:t?r?[...t,r]:t:r?[r]:void 0,multipartMethodName:null,multipartMethodNameForCollection:null,isReferenceType:!0}),DateOnly:()=>this.csharp.classReference({name:"DateOnly",namespace:"System"}),DateTime:()=>this.csharp.classReference({name:"DateTime",namespace:"System"}),Enum:()=>this.csharp.classReference({name:"Enum",namespace:"System"}),Exception:()=>this.csharp.classReference({name:"Exception",namespace:"System"}),ReadOnlyMemory:t=>this.csharp.classReference({name:"ReadOnlyMemory",namespace:"System",generics:[t]}),Serializable:()=>this.csharp.classReference({name:"SerializableAttribute",namespace:"System"}),String:()=>this.csharp.classReference({name:"String",namespace:"System"}),Type:()=>this.csharp.classReference({name:"Type",namespace:"System",isReferenceType:!0,multipartMethodName:null,multipartMethodNameForCollection:null,fullyQualified:!0}),TimeSpan:()=>this.csharp.classReference({name:"TimeSpan",namespace:"System"}),Uri:()=>this.csharp.classReference({name:"Uri",namespace:"System"}),UriBuilder:()=>this.csharp.classReference({name:"UriBuilder",namespace:"System"}),Runtime:()=>$({Serialization:()=>$({EnumMember:()=>this.csharp.classReference({name:"EnumMemberAttribute",namespace:"System.Runtime.Serialization"})})}),Collections:()=>$({Generic:()=>$({IAsyncEnumerable:t=>this.csharp.classReference({name:"IAsyncEnumerable",namespace:"System.Collections.Generic",generics:t?[t]:void 0}),IEnumerable:t=>this.csharp.classReference({name:"IEnumerable",namespace:"System.Collections.Generic",generics:t?[t]:void 0}),KeyValuePair:(t,r)=>this.csharp.classReference({name:"KeyValuePair",namespace:"System.Collections.Generic",generics:t&&r?[t,r]:void 0}),List:t=>this.csharp.classReference({name:"List",namespace:"System.Collections.Generic",generics:t?[t]:void 0,isCollection:!0}),HashSet:t=>this.csharp.classReference({name:"HashSet",namespace:"System.Collections.Generic",generics:t?[t]:void 0,isCollection:!0}),Dictionary:(t,r)=>this.csharp.classReference({name:"Dictionary",namespace:"System.Collections.Generic",generics:t&&r?[t,r]:void 0,isCollection:!0}),IDictionary:(t,r)=>this.csharp.classReference({name:"IDictionary",namespace:"System.Collections.Generic",generics:[t,r]})}),Linq:()=>$({Enumerable:()=>this.csharp.classReference({name:"Enumerable",namespace:"System.Linq"})})}),Globalization:()=>$({DateTimeStyles:()=>this.csharp.classReference({name:"DateTimeStyles",namespace:"System.Globalization"})}),Linq:()=>$({Enumerable:()=>this.csharp.classReference({name:"Enumerable",namespace:"System.Linq"})}),Net:()=>$({Http:()=>$({HttpClient:()=>this.csharp.classReference({name:"HttpClient",namespace:"System.Net.Http"}),HttpMethod:()=>this.csharp.classReference({name:"HttpMethod",namespace:"System.Net.Http"}),HttpResponseHeaders:()=>this.csharp.classReference({name:"HttpResponseHeaders",namespace:"System.Net.Http.Headers"})}),ServerSentEvents:()=>$({SseEvent:()=>this.csharp.classReference({name:"SseEvent",namespace:"System.Net.ServerSentEvents"}),SseParser:()=>this.csharp.classReference({name:"SseParser",namespace:"System.Net.ServerSentEvents"})}),WebSockets:()=>$({ClientWebSocketOptions:()=>this.csharp.classReference({name:"ClientWebSocketOptions",namespace:"System.Net.WebSockets"})})}),IO:()=>$({MemoryStream:()=>this.csharp.classReference({name:"MemoryStream",namespace:"System.IO"}),Stream:()=>this.csharp.classReference({name:"Stream",namespace:"System.IO"}),StreamReader:()=>this.csharp.classReference({name:"StreamReader",namespace:"System.IO"})}),Text:()=>$({Encoding:()=>this.csharp.classReference({name:"Encoding",namespace:"System.Text"}),Encoding_UTF8:()=>this.csharp.classReference({name:"UTF8",enclosingType:this.csharp.classReference({name:"Encoding",namespace:"System.Text"})}),Json:()=>$({JsonElement:()=>this.csharp.classReference({name:"JsonElement",namespace:"System.Text.Json"}),JsonDocument:()=>this.csharp.classReference({name:"JsonDocument",namespace:"System.Text.Json"}),JsonException:()=>this.csharp.classReference({name:"JsonException",namespace:"System.Text.Json"}),Utf8JsonReader:()=>this.csharp.classReference({name:"Utf8JsonReader",namespace:"System.Text.Json"}),JsonSerializerOptions:()=>this.csharp.classReference({name:"JsonSerializerOptions",namespace:"System.Text.Json"}),JsonSerializer:()=>this.csharp.classReference({name:"JsonSerializer",namespace:"System.Text.Json"}),Utf8JsonWriter:()=>this.csharp.classReference({name:"Utf8JsonWriter",namespace:"System.Text.Json"}),Nodes:()=>$({JsonNode:()=>this.csharp.classReference({name:"JsonNode",namespace:"System.Text.Json.Nodes"}),JsonObject:()=>this.csharp.classReference({name:"JsonObject",namespace:"System.Text.Json.Nodes"})}),Serialization:()=>$({IJsonOnDeserialized:()=>this.csharp.classReference({name:"IJsonOnDeserialized",namespace:"System.Text.Json.Serialization"}),IJsonOnSerializing:()=>this.csharp.classReference({name:"IJsonOnSerializing",namespace:"System.Text.Json.Serialization"}),JsonOnDeserializedAttribute:()=>this.csharp.classReference({name:"JsonOnDeserializedAttribute",namespace:"System.Text.Json.Serialization"}),JsonExtensionData:()=>this.csharp.classReference({name:"JsonExtensionDataAttribute",namespace:"System.Text.Json.Serialization"}),JsonConverter:t=>this.csharp.classReference({name:"JsonConverter",namespace:"System.Text.Json.Serialization",generics:t?[t]:void 0}),JsonIgnore:()=>this.csharp.classReference({name:"JsonIgnoreAttribute",namespace:"System.Text.Json.Serialization"}),JsonPropertyName:()=>this.csharp.classReference({name:"JsonPropertyNameAttribute",namespace:"System.Text.Json.Serialization"})})})}),Threading:()=>$({CancellationToken:()=>this.csharp.classReference({name:"CancellationToken",namespace:"System.Threading"}),Tasks:()=>$({Task:t=>this.csharp.classReference({name:"Task",namespace:"System.Threading.Tasks",generics:t?[t]:void 0}),ValueTask:t=>this.csharp.classReference({name:"ValueTask",namespace:"System.Threading.Tasks",generics:t?[t]:void 0})})}),ComponentModel:()=>$({INotifyPropertyChanged:()=>this.csharp.classReference({name:"INotifyPropertyChanged",namespace:"System.ComponentModel"}),PropertyChangedEventHandler:()=>this.csharp.classReference({name:"PropertyChangedEventHandler",namespace:"System.ComponentModel"})}),IAsyncDisposable:()=>this.csharp.classReference({name:"IAsyncDisposable",namespace:"System"}),IDisposable:()=>this.csharp.classReference({name:"IDisposable",namespace:"System"})}));y(this,"NUnit",$({Framework:()=>$({TestFixture:()=>this.csharp.classReference({name:"TestFixture",namespace:"NUnit.Framework"}),Test:()=>this.csharp.classReference({name:"Test",namespace:"NUnit.Framework"}),OneTimeTearDown:()=>this.csharp.classReference({name:"OneTimeTearDown",namespace:"NUnit.Framework"}),OneTimeSetUp:()=>this.csharp.classReference({name:"OneTimeSetUp",namespace:"NUnit.Framework"}),SetUpFixture:()=>this.csharp.classReference({name:"SetUpFixture",namespace:"NUnit.Framework"}),Parallelizable:()=>this.csharp.classReference({name:"Parallelizable",namespace:"NUnit.Framework"})})}));y(this,"OneOf",$({OneOf:t=>this.csharp.classReference({name:"OneOf",namespace:"OneOf",generics:t}),OneOfBase:t=>this.csharp.classReference({name:"OneOfBase",namespace:"OneOf",generics:t})}));y(this,"Google",$({Protobuf:()=>$({ByteString:()=>this.csharp.classReference({name:"ByteString",namespace:"Google.Protobuf"}),WellKnownTypes:()=>$({Struct:()=>this.csharp.classReference({name:"Struct",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),Value:()=>this.csharp.classReference({name:"Value",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),ListValue:()=>this.csharp.classReference({name:"ListValue",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"}),Timestamp:()=>this.csharp.classReference({name:"Timestamp",namespace:"Google.Protobuf.WellKnownTypes",namespaceAlias:"WellKnownProto"})})})}));y(this,"WireMock",$({Server:()=>this.csharp.classReference({name:"WireMockServer",namespace:"WireMock.Server"}),WireMockServerSettings:()=>this.csharp.classReference({name:"WireMockServerSettings",namespace:"WireMock.Settings"}),WireMockConsoleLogger:()=>this.csharp.classReference({name:"WireMockConsoleLogger",namespace:"WireMock.Logging"})}));y(this,"Grpc",$({Core:()=>$({RpcException:()=>this.csharp.classReference({name:"RpcException",namespace:"Grpc.Core"})})}));this.generation=t}get csharp(){return this.generation.csharp}};n();a();s();var Wu=new Set(["name","camelCase","snakeCase","screamingSnakeCase","pascalCase"]);function By(e,t){return Wu.has(t)?e??"":e?`${e}.${t}`:t}var fo=class{constructor(t,r){y(this,"generation");y(this,"indexByObject",new Map);y(this,"indexByPath",new Map);y(this,"explicitByObject",new Map);y(this,"explicitByPath",new Map);y(this,"root");y(this,"ir");this.generation=r,this.root=this.createIndex(t),this.ir=t}get csharp(){return this.generation.csharp}get registry(){return this.generation.registry}createIndex(t,r="",i){let o=By(i?.jsonPath,r);if(this.indexByPath.has(o)){i||de(`Parent provenance not found for node: ${JSON.stringify(t).substring(0,100)}`),this.indexByObject.set(t,i);let l=Wu.has(r);for(let[S,w]of Object.entries(t))typeof w=="object"&&w!==null&&(l&&Wu.has(S)?this.indexByObject.set(w,i):this.createIndex(w,S,i));return i}let c={jsonPath:o,name:r,node:t,parent:i};this.indexByObject.set(t,c),this.indexByPath.set(o,c);for(let[l,S]of Object.entries(t))typeof S=="object"&&S!==null&&this.createIndex(S,l,c);return c}staticExplicit(t){return this.explicit(this.ir,t)}explicit(t,r){let i=this.provenance(t)??de(`Provenance not found for node: ${JSON.stringify(t).substring(0,100)}`),o={...i,jsonPath:`${i.jsonPath}+${r}`,name:r,node:i.node,parent:i,explicit:!0},c=this.explicitByObject.get(i.node);return c?c.add(o):this.explicitByObject.set(i.node,new Set([o])),this.explicitByPath.set(o.jsonPath,o),o}provenance(t){if(t!==void 0)return V.string(t)?this.explicitByPath.get(t)??this.indexByPath.get(t):V.Provenance(t)?this.explicitByPath.get(t.jsonPath)??this.indexByPath.get(t.jsonPath):this.indexByObject.get(t)}origin(t){let r=this.provenance(t);return r?.explicit?r:r?.node}irNode(t){return this.provenance(t)?.node}jsonPath(t){return this.provenance(t)?.jsonPath}getEnumValueName(t,r){let i=V.IR.ExampleEnumType(r)?r.value:r,o=t.values.find(c=>this.nameEquals(c.name,i));return o?this.getPropertyNameFor(o):de(`Unexpected - can't find enum value ${JSON.stringify(i)} in enum`)}getPropertyNameFor(t){let r=this.registry.getFieldNameByOrigin(t);if(r)return r;if(V.Provenance(t))return t.name;if("name"in t){if(V.IR.NameAndWireValue(t.name))return this.generation.case.pascalSafe(t.name);if(V.IR.Name(t.name))return this.generation.case.pascalSafe(t.name);if(typeof t.name=="string")return this.generation.case.pascalSafe(t.name)}if("pascalCase"in t)return this.generation.case.pascalSafe(t);throw new Error(`Unknown property type: ${this.jsonPath(t)}`)}getClassNameFor(t){if(V.Provenance(t))return t.name;if("name"in t){if(V.IR.TypeDeclaration(t))return this.generation.case.pascalSafe(t.name.name);if(V.IR.NameAndWireValue(t.name))return this.generation.case.pascalSafe(t.name);if(V.IR.Name(t.name))return this.generation.case.pascalSafe(t.name);if(typeof t.name=="string")return this.generation.case.pascalSafe(t.name)}if("pascalCase"in t)return this.generation.case.pascalSafe(t);throw new Error(`Unknown property type: ${JSON.stringify(t)}`)}nameEquals(t,r){return this.generation.case.camelSafe(t)===this.generation.case.camelSafe(r)}dereferenceType(t){let r=V.string(t)?t:V.IR.NamedType(t)||V.IR.DeclaredTypeName(t)?t.typeId:V.IR.ExampleNamedType(t)?t.typeName.typeId:t.name.typeId,i=this.irNode(this.ir.types[r]);if(V.IR.TypeDeclaration(i))return{typeId:r,typeDeclaration:i};de(`dereferenceType: typeId ${r} not resolved.`)}};function mo(...e){return e.filter(Boolean).join("/")}var On=class{constructor(t,r,i,o,c={makeRelativeFilePath:l=>l,makeAbsoluteFilePath:l=>l,getNamespaceForTypeId:l=>"",getDirectoryForTypeId:l=>"",getCoreAsIsFiles:()=>[],getCoreTestAsIsFiles:()=>[],getPublicCoreAsIsFiles:()=>[],getAsyncCoreAsIsFiles:()=>[],getChildNamespaceSegments:l=>[]}){y(this,"intermediateRepresentation");y(this,"apiName");y(this,"customConfig");y(this,"generatorConfig");y(this,"support");y(this,"ir");y(this,"dir");y(this,"csharp",new po(this));y(this,"registry",new Ei(this));y(this,"model");y(this,"case");y(this,"extern",new lo(this));y(this,"settings",$({namespace:()=>this.customConfig.namespace??Zn(es(`${this.generatorConfig.organization}_${this.apiName}`)),readOnlyMemoryTypes:()=>this.customConfig["read-only-memory-types"]??[],simplifyObjectDictionaries:()=>this.customConfig["simplify-object-dictionaries"]??!1,useFullyQualifiedNamespaces:()=>this.customConfig["experimental-fully-qualified-namespaces"]??!1,useDotnetFormat:()=>this.customConfig["experimental-dotnet-format"]??!1,enableWebsockets:()=>this.customConfig["experimental-enable-websockets"]??!1,enableReadonlyConstants:()=>this.customConfig["experimental-readonly-constants"]??!1,generateLiterals:()=>this.customConfig["generate-literals"]??this.customConfig["experimental-readonly-constants"]??!1,enableExplicitNullableOptional:()=>this.customConfig["experimental-explicit-nullable-optional"]??!1,useDefaultRequestParameterValues:()=>this.customConfig["use-default-request-parameter-values"]??!1,redactResponseBodyOnError:()=>this.customConfig["redact-response-body-on-error"]??!1,temporaryWebsocketEnvironments:()=>this.customConfig["temporary-websocket-environments"]??{},baseApiExceptionClassName:()=>this.customConfig["base-api-exception-class-name"]??"",baseExceptionClassName:()=>this.customConfig["base-exception-class-name"]??"",shouldGeneratedDiscriminatedUnions:()=>this.customConfig["use-discriminated-unions"]??!0,shouldGenerateUndiscriminatedUnions:()=>this.customConfig["use-undiscriminated-unions"]??!1,exportedClientClassName:()=>this.customConfig["exported-client-class-name"]??"",clientClassName:()=>this.customConfig["client-class-name"]??"",rootNamespaceForCoreClasses:()=>this.customConfig["root-namespace-for-core-classes"]??!0,packageId:()=>this.customConfig["package-id"]??"",isForwardCompatibleEnumsEnabled:()=>this.customConfig["enable-forward-compatible-enums"]??this.customConfig["experimental-enable-forward-compatible-enums"]??!0,websocketEnvironments:()=>this.customConfig["temporary-websocket-environments"]??{},customPagerName:()=>this.customConfig["custom-pager-name"]??"",environmentClassName:()=>this.customConfig["environment-class-name"]??"",generateErrorTypes:()=>this.customConfig["generate-error-types"]??!0,shouldInlinePathParameters:()=>this.customConfig["inline-path-parameters"]??!0,includeExceptionHandler:()=>this.customConfig["include-exception-handler"]??!1,exceptionInterceptorClassName:()=>this.customConfig["exception-interceptor-class-name"]??"",shouldGenerateMockServerTests:()=>this.customConfig["generate-mock-server-tests"]??this.customConfig["enable-wire-tests"]??!0,rootClientAccess:()=>this.customConfig["root-client-class-access"]=="internal"?ge.Internal:ge.Public,extraDependencies:()=>this.customConfig["extra-dependencies"]??{},omitFernHeaders:()=>this.customConfig["omit-fern-headers"]??!1,unifiedClientOptions:()=>this.customConfig["unified-client-options"]??!1,pascalCaseEnvironments:()=>this.customConfig["pascal-case-environments"]??!0,slnFormat:()=>this.customConfig["sln-format"]??"slnx",explicitNamespaces:()=>this.customConfig["explicit-namespaces"]===!0,maxRetries:()=>this.customConfig.maxRetries,outputPath:()=>{let t=this.customConfig["output-path"];return t==null?{library:"src",test:"src",solution:".",other:"."}:typeof t=="string"?{library:t,test:t,solution:".",other:"."}:{library:t.library??"src",test:t.test??"src",solution:t.solution??".",other:t.other??"."}}}));y(this,"constants",{folders:$({mockServerTests:()=>this.support.makeRelativeFilePath("Unit/MockServer"),types:()=>"Types",exceptions:()=>"Exceptions",src:()=>"src",protobuf:()=>"proto",serializationTests:()=>this.support.makeRelativeFilePath("Unit/Serialization"),project:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.sourceFiles,this.support.makeRelativeFilePath(this.names.files.project))),sourceFiles:()=>this.support.makeRelativeFilePath(this.constants.folders.src),coreFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.project,this.support.makeRelativeFilePath(this.constants.defaults.core))),publicCoreFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.project,this.support.makeRelativeFilePath(this.constants.defaults.core),this.support.makeRelativeFilePath(this.constants.defaults.publicCore))),testFiles:()=>this.support.makeRelativeFilePath(mo(this.constants.folders.sourceFiles,this.support.makeRelativeFilePath(this.names.files.testProject)))}),formatting:$({indent:()=>" "}),defaults:$({core:()=>"Core",publicCore:()=>"Public",version:()=>"0.0.0"})});y(this,"namespaces",$({root:()=>this.settings.namespace,core:()=>`${this.namespaces.root}.Core`,qualifiedRoot:()=>this.qualifyNamespace(this.namespaces.root),qualifiedCore:()=>this.qualifyNamespace(this.namespaces.core),test:()=>this.registry.canonicalizeNamespace(`${this.namespaces.root}.Test`),testUtils:()=>`${this.namespaces.test}.Utils`,mockServerTest:()=>`${this.namespaces.test}.Unit.MockServer`,publicCore:()=>this.namespaces.root,webSocketsCore:()=>`${this.namespaces.core}.WebSockets`,publicCoreTest:()=>`${this.namespaces.root}.Test.PublicCore`,asIsTestUtils:()=>`${this.namespaces.root}.Test.Utils`,publicCoreClasses:()=>this.settings.rootNamespaceForCoreClasses?this.namespaces.root:this.namespaces.core,implicit:()=>new Set(["System","System.Collections.Generic","System.IO","System.Linq","System.Threading","System.Threading.Tasks","System.Net.Http"])}));y(this,"names",{classes:$({baseApiException:()=>this.settings.baseApiExceptionClassName||`${this.names.project.clientPrefix}ApiException`,baseException:()=>this.settings.baseExceptionClassName||`${this.names.project.clientPrefix}Exception`,rootClient:()=>this.settings.clientClassName||`${this.names.project.clientPrefix}Client`,rootClientForSnippets:()=>this.settings.exportedClientClassName||this.names.classes.rootClient,customPager:()=>this.settings.customPagerName||`${this.names.project.packageId.replace(/[^a-zA-Z0-9]/g,"")}Pager`,environment:()=>this.settings.environmentClassName||`${this.names.project.clientPrefix}Environment`,exceptionInterceptor:()=>this.settings.exceptionInterceptorClassName||`${this.names.project.packageId.replace(/[^a-zA-Z0-9]/g,"")}ExceptionInterceptor`}),project:$({client:()=>Zn(es(`${this.generatorConfig.organization}_${this.generatorConfig.workspaceName}`)),clientPrefix:()=>this.settings.exportedClientClassName||this.settings.clientClassName||this.names.project.client,packageId:()=>this.settings.packageId||this.namespaces.root}),files:$({project:()=>this.namespaces.root,testProject:()=>`${this.namespaces.root}.Test`}),methods:$({mockOauth:()=>"MockOAuthEndpoint",mockInferredAuth:()=>"MockInferredAuthEndpoint",getAccessTokenAsync:()=>"GetAccessTokenAsync",getAuthHeadersAsync:()=>"GetAuthHeadersAsync"}),variables:$({client:()=>"client",response:()=>"response",httpRequest:()=>"httpRequest",sendRequest:()=>"sendRequest",responseBody:()=>"responseBody",query:()=>"_query",headers:()=>"_headers"}),parameters:$({cancellationToken:()=>"cancellationToken",requestOptions:()=>"options",idempotentOptions:()=>"options"})});y(this,"Types",$({Arbitrary:t=>new re.ArbitraryType(t,this),HttpMethodExtensions:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("HttpMethodExtensions")}),FormRequest:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("FormRequest")}),Optional:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("Optional")}),ClientOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("ClientOptions"),namespace:this.namespaces.publicCoreClasses}),RawClient:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("RawClient")}),RequestOptions:()=>this.csharp.classReference({namespace:this.namespaces.publicCoreClasses,origin:this.model.staticExplicit("RequestOptions")}),RequestOptionsInterface:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("IRequestOptions")}),JsonRequest:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("JsonRequest")}),Version:()=>this.csharp.classReference({namespace:this.namespaces.publicCore,origin:this.model.staticExplicit("Version")}),ValueConvert:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("ValueConvert")}),FileParameter:()=>this.csharp.classReference({namespace:this.namespaces.publicCore,origin:this.model.staticExplicit("FileParameter"),multipartMethodName:"AddFileParameterPart",multipartMethodNameForCollection:"AddFileParameterParts",isReferenceType:!0}),Headers:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("Headers")}),HeaderValue:()=>this.csharp.classReference({namespace:this.namespaces.core,origin:this.model.staticExplicit("HeaderValue")}),RootClient:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.rootClient),namespace:this.namespaces.root}),RootClientForSnippets:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.rootClientForSnippets),namespace:this.namespaces.root}),BaseApiException:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.baseApiException),namespace:this.namespaces.publicCoreClasses}),BaseException:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.baseException),namespace:this.namespaces.publicCoreClasses}),ExceptionInterceptor:()=>this.csharp.classReference({origin:this.model.staticExplicit("IExceptionInterceptor"),namespace:this.namespaces.core}),ExceptionHandler:()=>this.csharp.classReference({origin:this.model.staticExplicit("ExceptionHandler"),namespace:this.namespaces.core}),CustomExceptionInterceptor:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.exceptionInterceptor),namespace:this.namespaces.core}),ProtoAnyMapper:()=>this.csharp.classReference({origin:this.model.staticExplicit("ProtoAnyMapper"),namespace:this.namespaces.core}),Constants:()=>this.csharp.classReference({origin:this.model.staticExplicit("Constants"),namespace:this.namespaces.core}),DateTimeSerializer:()=>this.csharp.classReference({origin:this.model.staticExplicit("DateTimeSerializer"),namespace:this.namespaces.core}),JsonUtils:()=>this.csharp.classReference({origin:this.model.staticExplicit("JsonUtils"),namespace:this.namespaces.core}),JsonAssert:()=>this.csharp.classReference({origin:this.model.staticExplicit("JsonAssert"),namespace:this.namespaces.testUtils}),CustomPagerFactory:()=>this.csharp.classReference({origin:this.model.staticExplicit(`${this.names.classes.customPager}Factory`),namespace:this.namespaces.core}),CustomPagerContext:()=>this.csharp.classReference({origin:this.model.staticExplicit(`${this.names.classes.customPager}Context`),namespace:this.namespaces.core}),Environments:()=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.environment),namespace:this.namespaces.publicCoreClasses}),TestClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("TestClient"),namespace:this.namespaces.test}),BaseMockServerTest:()=>this.csharp.classReference({origin:this.model.staticExplicit("BaseMockServerTest"),namespace:this.namespaces.mockServerTest}),IdempotentRequestOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("IdempotentRequestOptions"),namespace:this.namespaces.publicCoreClasses}),IdempotentRequestOptionsInterface:()=>this.csharp.classReference({origin:this.model.staticExplicit("IIdempotentRequestOptions"),namespace:this.namespaces.core}),IStringEnum:()=>this.csharp.classReference({origin:this.model.staticExplicit("IStringEnum"),namespace:this.namespaces.core}),WebSocketClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("WebSocketClient"),namespace:this.namespaces.webSocketsCore}),QueryBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("Query"),namespace:this.namespaces.webSocketsCore}),QueryStringBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("QueryStringBuilder"),namespace:this.namespaces.core}),QueryStringBuilderBuilder:()=>this.csharp.classReference({origin:this.model.staticExplicit("QueryStringBuilder.Builder"),namespace:this.namespaces.core}),OAuthTokenProvider:()=>this.csharp.classReference({origin:this.model.staticExplicit("OAuthTokenProvider"),namespace:this.namespaces.core}),InferredAuthTokenProvider:()=>this.csharp.classReference({origin:this.model.staticExplicit("InferredAuthTokenProvider"),namespace:this.namespaces.core}),ProtoConverter:()=>this.csharp.classReference({origin:this.model.staticExplicit("ProtoConverter"),namespace:this.namespaces.core}),RawGrpcClient:()=>this.csharp.classReference({origin:this.model.staticExplicit("RawGrpcClient"),namespace:this.namespaces.core}),Extensions:()=>this.csharp.classReference({origin:this.model.staticExplicit("Extensions"),namespace:this.namespaces.core}),GrpcRequestOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("GrpcRequestOptions"),namespace:this.namespaces.root}),GrpcChannelOptions:()=>this.csharp.classReference({origin:this.model.staticExplicit("GrpcChannelOptions"),namespace:"Grpc.Net.Client"}),StringEnum:t=>this.csharp.classReference({origin:this.model.staticExplicit("StringEnum"),namespace:this.namespaces.core,generics:t?[t]:void 0}),WebSocketEvent:t=>this.csharp.classReference({origin:this.model.staticExplicit("Event"),namespace:this.namespaces.webSocketsCore,generics:[t]}),ConnectionStatus:()=>this.csharp.classReference({origin:this.model.staticExplicit("ConnectionStatus"),namespace:this.namespaces.webSocketsCore}),WebSocketConnected:()=>this.csharp.classReference({origin:this.model.staticExplicit("Connected"),namespace:this.namespaces.webSocketsCore}),WebSocketClosed:()=>this.csharp.classReference({origin:this.model.staticExplicit("Closed"),namespace:this.namespaces.webSocketsCore}),ReconnectionInfo:()=>this.csharp.classReference({origin:this.model.staticExplicit("ReconnectionInfo"),namespace:this.namespaces.webSocketsCore}),CustomPagerClass:t=>this.csharp.classReference({origin:this.model.staticExplicit(this.names.classes.customPager),namespace:this.namespaces.core,generics:[t]}),Pager:t=>this.csharp.classReference({origin:this.model.staticExplicit("Pager"),namespace:this.namespaces.core,generics:[t]}),OffsetPager:({requestType:t,requestOptionsType:r,responseType:i,offsetType:o,stepType:c,itemType:l})=>this.csharp.classReference({origin:this.model.staticExplicit("OffsetPager"),namespace:this.namespaces.core,generics:[t,r,i,o,c,l]}),CursorPager:({requestType:t,requestOptionsType:r,responseType:i,cursorType:o,itemType:c})=>this.csharp.classReference({origin:this.model.staticExplicit("CursorPager"),namespace:this.namespaces.core,generics:[t,r,i,o,c]}),CollectionItemSerializer:(t,r)=>this.csharp.classReference({origin:this.model.staticExplicit("CollectionItemSerializer"),namespace:this.namespaces.core,generics:[t,r]}),OneOfSerializer:t=>this.csharp.classReference({origin:this.model.staticExplicit("OneOfSerializer"),namespace:this.namespaces.core,generics:[t]}),AdditionalProperties:t=>this.csharp.classReference({origin:this.model.staticExplicit("AdditionalProperties"),namespace:this.namespaces.publicCore,generics:t?[t]:void 0}),ReadOnlyAdditionalProperties:t=>this.csharp.classReference({origin:this.model.staticExplicit("ReadOnlyAdditionalProperties"),namespace:this.namespaces.publicCore,generics:t?[t]:void 0})}));y(this,"Primitive",$({string:()=>new re.String(this),boolean:()=>new re.Boolean(this),integer:()=>new re.Integer(this),long:()=>new re.Long(this),uint:()=>new re.Uint(this),ulong:()=>new re.ULong(this),float:()=>new re.Float(this),double:()=>new re.Double(this),object:()=>new re.Object(this)}));y(this,"Value",$({binary:()=>new Ue.Binary(this),dateOnly:()=>new Ue.DateOnly(this),dateTime:()=>new Ue.DateTime(this),uuid:()=>new Ue.Uuid(this),stringEnum:t=>new Ue.StringEnum(t,this)}));y(this,"Collection",$({array:t=>new xe.Array(t,this),listType:t=>new xe.ListType(t,this),list:t=>new xe.List(t,this),set:t=>new xe.Set(t,this),map:(t,r,i)=>new xe.Map(t,r,this,i),idictionary:(t,r,i)=>new xe.IDictionary(t,r,this,i),keyValuePair:(t,r)=>new xe.KeyValuePair(t,r,this)}));y(this,"format",$({private:t=>`_${ts.camelCase(t)}`}));y(this,"initializers",$({implicitNamespaces:()=>{for(let t of this.namespaces.implicit)this.registry.addImplicitNamespace(t);return!0}}));this.intermediateRepresentation=t,this.apiName=r,this.customConfig=i,this.generatorConfig=o,this.support=c;let l=V.IR.IntermediateRepresentation(t)?t.casingsConfig:void 0;this.case=new Rn({generationLanguage:"csharp",keywords:l?.keywords,smartCasing:l?.smartCasing??!0}),this.model=new fo(t,this),this.ir=V.IR.IntermediateRepresentation(t)?t:{},this.dir=V.DynamicIR.DynamicIntermediateRepresentation(t)?t:{}}initialize(){return this.initializers.implicitNamespaces}get System(){return this.extern.System}get NUnit(){return this.extern.NUnit}get OneOf(){return this.extern.OneOf}get Google(){return this.extern.Google}get Grpc(){return this.extern.Grpc}get WireMock(){return this.extern.WireMock}qualifyNamespace(t){let r=t.split(".")[0];return r&&this.registry.hasTypeNamespaceConflict(r)?`global::${t}`:t}};n();a();s();var Xe=class{constructor(t){y(this,"generation");this.generation=t}get csharp(){return this.generation.csharp}get case(){return this.generation.case}get settings(){return this.generation.settings}get constants(){return this.generation.constants}get namespaces(){return this.generation.namespaces}get names(){return this.generation.names}get model(){return this.generation.model}get format(){return this.generation.format}get registry(){return this.generation.registry}get Types(){return this.generation.Types}get System(){return this.generation.extern.System}get NUnit(){return this.generation.extern.NUnit}get OneOf(){return this.generation.extern.OneOf}get Google(){return this.generation.extern.Google}get Grpc(){return this.generation.extern.Grpc}get WireMock(){return this.generation.extern.WireMock}get Primitive(){return this.generation.Primitive}get Value(){return this.generation.Value}get Collection(){return this.generation.Collection}};n();a();s();var ho=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}convert(r){if(r.value===null)return this.context.isNullable(r.typeReference)?this.csharp.Literal.null():(this.context.errors.add({severity:ee.Critical,message:"Expected non-null value, but got null"}),this.csharp.Literal.nop());if(r.value===void 0&&!r.fallbackToDefault)return this.csharp.Literal.nop();switch(r.typeReference.type){case"list":return this.convertList({list:r.typeReference.value,value:r.value,fallbackToDefault:r.fallbackToDefault});case"literal":return this.convertLiteral({literal:r.typeReference.value,value:r.value});case"map":return this.convertMap({map:r.typeReference,value:r.value,fallbackToDefault:r.fallbackToDefault});case"named":{let i=this.context.resolveNamedType({typeId:r.typeReference.value});return i==null?this.csharp.Literal.nop():this.convertNamed({named:i,value:r.value,as:r.as,fallbackToDefault:r.fallbackToDefault})}case"nullable":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"optional":return this.convert({typeReference:r.typeReference.value,value:r.value,as:r.as});case"primitive":return this.convertPrimitive({primitive:r.typeReference.value,value:r.value,as:r.as,fallbackToDefault:r.fallbackToDefault});case"set":return this.convertSet({set:r.typeReference.value,value:r.value,fallbackToDefault:r.fallbackToDefault});case"unknown":return this.convertUnknown({value:r.value,fallbackToDefault:r.fallbackToDefault});default:ce(r.typeReference)}}convertList({list:r,value:i,fallbackToDefault:o}){return Array.isArray(i)?this.csharp.Literal.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:r,unboxOptionals:!0}),values:i.map((c,l)=>{this.context.errors.scope({index:l});try{return this.convert({typeReference:r,value:c})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:ee.Critical,message:`Expected array but got: ${typeof i}`}),this.csharp.Literal.nop())}convertLiteral({literal:r,value:i,fallbackToDefault:o}){switch(r.type){case"boolean":{let c=this.context.getValueAsBoolean({value:i});return c==null?this.csharp.Literal.nop():this.csharp.Literal.boolean(c)}case"string":{let c=this.context.getValueAsString({value:i});return c==null?o?this.Primitive.string.getDeterminsticDefault(o):this.csharp.Literal.nop():this.csharp.Literal.string(c)}default:ce(r)}}convertSet({set:r,value:i,fallbackToDefault:o}){return Array.isArray(i)?this.csharp.Literal.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:r,unboxOptionals:!0}),values:i.map((c,l)=>{this.context.errors.scope({index:l});try{return this.convert({typeReference:r,value:c})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:ee.Critical,message:`Expected array but got: ${typeof i}`}),this.csharp.Literal.nop())}convertMap({map:r,value:i,fallbackToDefault:o}){return typeof i!="object"||i==null?(this.context.errors.add({severity:ee.Critical,message:`Expected object but got: ${i==null?"null":typeof i}`}),this.csharp.Literal.nop()):this.csharp.Literal.dictionary({keyType:this.context.dynamicTypeMapper.convert({typeReference:r.key}),valueType:r.value.type==="unknown"?this.context.dynamicTypeMapper.convert({typeReference:r.value}).asOptional():this.context.dynamicTypeMapper.convert({typeReference:r.value}),entries:Object.entries(i).map(([c,l])=>{this.context.errors.scope(c);try{return{key:this.convert({typeReference:r.key,value:c,as:"key"}),value:this.convert({typeReference:r.value,value:l})}}finally{this.context.errors.unscope()}})})}convertNamed({named:r,value:i,as:o,fallbackToDefault:c}){switch(r.type){case"alias":return this.convert({typeReference:r.typeReference,value:i,as:o,fallbackToDefault:c});case"discriminatedUnion":return this.settings.shouldGeneratedDiscriminatedUnions?this.convertDiscriminatedUnion({discriminatedUnion:r,value:i,fallbackToDefault:c}):this.convertUnknown({value:i,fallbackToDefault:c});case"enum":return this.getEnumValue(r,i);case"object":return this.convertObject({object_:r,value:i,fallbackToDefault:c});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:r,value:i,fallbackToDefault:c});default:ce(r)}}convertDiscriminatedUnion({discriminatedUnion:r,value:i,fallbackToDefault:o}){let c=this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),l=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:r,value:i});if(l==null)return this.csharp.Literal.nop();let S=l.singleDiscriminatedUnionType,w=this.getBaseProperties({discriminatedUnionTypeInstance:l,singleDiscriminatedUnionType:S});switch(S.type){case"samePropertiesAsObject":{let I=this.context.resolveNamedType({typeId:S.typeId});return I==null?this.csharp.Literal.nop():this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.convertNamed({named:I,value:l.value})]})}case"singleProperty":{if(this.context.getRecord(l.value)==null)return this.csharp.Literal.nop();try{let A=["Value","Type"].includes(S.discriminantValue.name.pascalCase.safeName)?`${S.discriminantValue.name.pascalCase.safeName}Inner`:S.discriminantValue.name.pascalCase.safeName;return this.context.errors.scope(S.discriminantValue.wireValue),this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.csharp.instantiateClass({classReference:this.csharp.classReference({name:A,enclosingType:c}),arguments_:[this.convert({typeReference:S.typeReference,value:S.discriminantValue.wireValue})]})]})}finally{this.context.errors.unscope()}}case"noProperties":return this.instantiateUnionWithBaseProperties({classReference:c,baseProperties:w,arguments_:[this.csharp.instantiateClass({classReference:this.csharp.classReference({origin:l.discriminantValue,enclosingType:c}),arguments_:[]})]});default:ce(S)}}getBaseProperties({discriminatedUnionTypeInstance:r,singleDiscriminatedUnionType:i}){return this.context.associateByWireValue({parameters:i.properties??[],values:this.context.getRecord(r.value)??{},ignoreMissingParameters:!0}).map(c=>{this.context.errors.scope(c.name.wireValue);try{return{name:this.context.getPropertyName(c.name.name),assignment:this.convert(c)}}finally{this.context.errors.unscope()}})}instantiateUnionWithBaseProperties({classReference:r,arguments_:i,baseProperties:o}){let c=this.csharp.instantiateClass({classReference:r,arguments_:i,multiline:!0});return o.length===0?this.csharp.Literal.reference(c):this.csharp.Literal.reference(this.csharp.codeblock(l=>{l.write(c," "),l.pushScope();for(let S of o)l.write(S.name," = ",S.assignment,",");l.popScope(!1)}))}getEnumValue(r,i){if(typeof i!="string")return this.context.errors.add({severity:ee.Critical,message:`Expected enum value string, got: ${typeof i}`}),this.csharp.Literal.nop();let o=r.values.find(S=>S.wireValue===i);if(o==null)return this.context.errors.add({severity:ee.Critical,message:`An enum value named "${i}" does not exist in this context`}),this.csharp.Literal.nop();let c=this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),l=c.registerField(this.model.getPropertyNameFor(o),o);return this.csharp.Literal.reference(this.csharp.enumInstantiation({reference:c,value:l}))}convertObject({object_:r,value:i,fallbackToDefault:o}){let c=this.context.associateByWireValue({parameters:r.properties,values:this.context.getRecord(i)??{}});return this.csharp.Literal.class_({reference:this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),fields:c.map(l=>{this.context.errors.scope(l.name.wireValue);try{return{name:this.context.getClassName(l.name.name),value:this.convert(l)}}finally{this.context.errors.unscope()}})})}convertUndiscriminatedUnion({undiscriminatedUnion:r,value:i,fallbackToDefault:o}){let c=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:i});return c==null?this.csharp.Literal.nop():c.typeLiteral}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:r,value:i}){for(let o of r.types)try{let c=this.convert({typeReference:o,value:i});return{valueTypeReference:o,typeLiteral:c}}catch{continue}this.context.errors.add({severity:ee.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof i}" value`})}convertUnknown({value:r,fallbackToDefault:i}){return this.csharp.Literal.unknown(r)}convertPrimitive({primitive:r,value:i,as:o,fallbackToDefault:c}){switch(r){case"INTEGER":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.integer.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.integer(l)}case"LONG":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.long.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.long(l)}case"UINT":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.uint.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.uint(l)}case"UINT_64":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.ulong.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.ulong(l)}case"FLOAT":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.float.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.float(l)}case"DOUBLE":{let l=this.getValueAsNumber({value:i,as:o});return l==null?c?this.Primitive.double.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.double(l)}case"BOOLEAN":{let l=this.getValueAsBoolean({value:i,as:o});return l==null?c?this.Primitive.boolean.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.boolean(l)}case"STRING":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"DATE":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Value.dateOnly.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.date(l)}case"DATE_TIME":case"DATE_TIME_RFC_2822":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Value.dateTime.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.datetime(l)}case"UUID":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"BASE_64":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}case"BIG_INTEGER":{let l=this.context.getValueAsString({value:i});return l==null?c?this.Primitive.string.getDeterminsticDefault(c):this.csharp.Literal.nop():this.csharp.Literal.string(l)}default:ce(r)}}getValueAsNumber({value:r,as:i}){let o=i==="key"&&typeof r=="string"?Number(r):r;return this.context.getValueAsNumber({value:o})}getValueAsBoolean({value:r,as:i}){let o=i==="key"?typeof r=="string"?r==="true":r==="false"?!1:r:r;return this.context.getValueAsBoolean({value:o})}};n();a();s();var yo=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}convert(r){switch(r.typeReference.type){case"list":return this.Collection.list(this.convert({typeReference:r.typeReference.value,unboxOptionals:!0}));case"literal":return this.convertLiteral({literal:r.typeReference.value});case"map":return this.Collection.map(this.convert({typeReference:r.typeReference.key}),this.convert({typeReference:r.typeReference.value}));case"named":{let i=this.context.resolveNamedType({typeId:r.typeReference.value});return i==null?this.convertUnknown():this.convertNamed({named:i})}case"optional":case"nullable":{let i=this.convert({typeReference:r.typeReference.value});return r.unboxOptionals?i.asNonOptional():i.asOptional()}case"primitive":return this.convertPrimitive({primitive:r.typeReference.value});case"set":return this.Collection.set(this.convert({typeReference:r.typeReference.value,unboxOptionals:!0}));case"unknown":return this.convertUnknown();default:ce(r.typeReference)}}convertToClassReference(r){return this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)})}convertNamed({named:r}){switch(r.type){case"alias":return this.convert({typeReference:r.typeReference});case"enum":case"object":return this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)});case"discriminatedUnion":return this.settings.shouldGeneratedDiscriminatedUnions?this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}):this.Primitive.object;case"undiscriminatedUnion":return this.settings.shouldGenerateUndiscriminatedUnions?this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}):this.OneOf.OneOf(r.types.map(i=>this.convert({typeReference:i})));default:ce(r)}}convertLiteral({literal:r}){switch(r.type){case"boolean":return this.Primitive.boolean;case"string":return this.Primitive.string}}convertUnknown(){return this.Primitive.object}convertPrimitive({primitive:r}){switch(r){case"INTEGER":return this.Primitive.integer;case"UINT":return this.Primitive.uint;case"LONG":return this.Primitive.long;case"UINT_64":return this.Primitive.ulong;case"FLOAT":return this.Primitive.float;case"DOUBLE":return this.Primitive.double;case"BOOLEAN":return this.Primitive.boolean;case"STRING":return this.Primitive.string;case"DATE":return this.Value.dateOnly;case"DATE_TIME":case"DATE_TIME_RFC_2822":return this.Value.dateTime;case"UUID":return this.Primitive.string;case"BASE_64":return this.Primitive.string;case"BIG_INTEGER":return this.Primitive.string;default:ce(r)}}};n();a();s();var go=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}getFilePropertyInfo({body:r,value:i}){let o={fileFields:[],bodyPropertyFields:[]},c=this.context.getRecord(i)??{};for(let l of r.properties)switch(l.type){case"file":V.Record.missingKey(c,l.wireValue)&&(c[l.wireValue]="[bytes]"),o.fileFields.push({name:this.context.getPropertyName(l.name),value:this.getSingleFileProperty({property:l,record:c})});break;case"fileArray":V.Record.missingKey(c,l.wireValue)&&(c[l.wireValue]=["[bytes]"]),o.fileFields.push({name:this.context.getPropertyName(l.name),value:this.getArrayFileProperty({property:l,record:c})});break;case"bodyProperty":if(V.Record.missingKey(c,l.name.wireValue))switch(l.typeReference.type){case"optional":break;case"primitive":{switch(l.typeReference.value.toLowerCase()){case"integer":{c[l.name.wireValue]=123;break}case"string":{c[l.name.wireValue]="[string]";break}case"boolean":{c[l.name.wireValue]=!0;break}case"double":{c[l.name.wireValue]=123.456;break}case"float":{c[l.name.wireValue]=123.456;break}case"long":{c[l.name.wireValue]=123456789;break}case"uint":{c[l.name.wireValue]=123;break}case"uint64":{c[l.name.wireValue]=12345;break}case"date":{c[l.name.wireValue]=new Date(2021,1,1);break}case"datetime":{c[l.name.wireValue]=new Date(2021,1,1,12,0,0);break}case"uuid":{c[l.name.wireValue]="123e4567-e89b-12d3-a456-426614174000";break}case"base64":{c[l.name.wireValue]="SGVsbG8gd29ybGQh";break}case"biginteger":{c[l.name.wireValue]="12345678901234567890";break}}break}default:break}o.bodyPropertyFields.push({name:this.context.getPropertyName(l.name.name),value:this.getBodyProperty({property:l,record:c})});break;default:ce(l)}return o}getSingleFileProperty({property:r,record:i}){let o=this.context.getSingleFileValue({property:r,record:i});return o==null?this.csharp.Literal.nop():this.context.getFileParameterForString(o)}getArrayFileProperty({property:r,record:i}){let o=this.context.getFileArrayValues({property:r,record:i});return o==null?this.csharp.Literal.nop():this.csharp.Literal.list({valueType:this.Types.FileParameter,values:o.map(c=>this.context.getFileParameterForString(c))})}getBodyProperty({property:r,record:i}){let o=i[r.name.wireValue];return o==null?this.csharp.Literal.nop():this.context.dynamicLiteralMapper.convert({typeReference:r.typeReference,value:o})}};var bo=class e extends Mi{constructor({ir:r,config:i,options:o,generation:c}){super({ir:r,config:i,options:o});y(this,"ir");y(this,"dynamicTypeMapper");y(this,"dynamicLiteralMapper");y(this,"filePropertyMapper");y(this,"generation");this.ir=r,this.generation=c??new On(r,i.workspaceName,i.customConfig!=null?i.customConfig:{},i),this.dynamicTypeMapper=new yo({context:this}),this.dynamicLiteralMapper=new ho({context:this}),this.filePropertyMapper=new go({context:this})}get namespaces(){return this.generation.namespaces}get registry(){return this.generation.registry}get settings(){return this.generation.settings}get constants(){return this.generation.constants}get names(){return this.generation.names}get model(){return this.generation.model}get format(){return this.generation.format}get csharp(){return this.generation.csharp}get Types(){return this.generation.Types}get System(){return this.generation.extern.System}get NUnit(){return this.generation.extern.NUnit}get OneOf(){return this.generation.extern.OneOf}get Google(){return this.generation.extern.Google}get WireMock(){return this.generation.extern.WireMock}get Primitive(){return this.generation.Primitive}get Value(){return this.generation.Value}get Collection(){return this.generation.Collection}clone(){return new e({ir:this.ir,config:this.config,options:this.options,generation:this.generation})}getFileParameterForString(r){return this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.FileParameter,arguments_:[],properties:[{name:"Stream",value:this.getMemoryStreamForString(r)}],multiline:!0}))}getMemoryStreamForString(r){return this.System.IO.MemoryStream.new({arguments_:[this.csharp.invokeMethod({on:this.System.Text.Encoding_UTF8,method:"GetBytes",arguments_:[this.csharp.Literal.string(r)]})]})}getClassName(r){return r.pascalCase.safeName}getParameterName(r){return r.camelCase.safeName}getPropertyName(r){return r.pascalCase.safeName}getMethodName(r){return`${r.pascalCase.safeName}Async`}getNamespace(r,i){let o=this.getNamespaceSegments(r);return o=i!=null?[...o,i]:o,[this.namespaces.root,...o].join(".")}getEnvironmentTypeReferenceFromID(r){let i=this.resolveEnvironmentName(r);if(i!=null)return this.getEnvironmentClassReferenceForEnumName(i)}getEnvironmentClassReferenceForEnumName(r){return this.csharp.classReference({name:`${this.generation.Types.Environments.name}.${this.getClassName(r)}`,namespace:this.namespaces.root})}getNamespaceSegments(r){return(this.settings.explicitNamespaces?r.allParts:r.packagePath).map(o=>o.pascalCase.safeName)}precalculate(r){this.generation.initialize(),this.System.Collections.Generic.KeyValuePair(),this.System.Collections.Generic.IEnumerable(),this.System.Collections.Generic.IAsyncEnumerable(),this.System.Collections.Generic.HashSet(),this.System.Collections.Generic.List(),this.System.Collections.Generic.Dictionary(),this.System.Threading.Tasks.Task(),Object.entries(this.ir.types).sort((i,o)=>i[0].length-o[0].length).forEach(([i,o])=>{this.dynamicTypeMapper.convertToClassReference(o)});for(let[i,o]of r.entries())if(this.csharp.classReference({origin:this.model.staticExplicit(`Example${i}`),namespace:"Usage"}),o.endpoint){let c=this.resolveEndpointLocation(o.endpoint);for(let l of c)switch(l.request.type){case"inlined":this.csharp.classReference({origin:l.request.declaration.name,namespace:this.getNamespace(l.request.declaration.fernFilepath)});break;case"body":break}}this.generation.Types.ClientOptions,this.generation.Types.RootClientForSnippets,this.csharp.freezeClassReferences()}};n();a();s();var xo=class extends Xe{constructor({context:r}){super(r.generation);y(this,"context");this.context=r}async generateSnippet({endpoint:r,request:i,options:o}){return this.buildCodeBlock({endpoint:r,snippet:i,options:o}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map,skipGlobalQualifier:!0})}generateSnippetSync({endpoint:r,request:i,options:o}){return this.buildCodeBlock({endpoint:r,snippet:i,options:o}).toString({namespace:"Usage",generation:this.generation,allNamespaceSegments:new Set,allTypeClassReferences:new Map,skipGlobalQualifier:!0})}async generateSnippetAst({endpoint:r,request:i,options:o}){throw new Error("Unsupported")}buildCodeBlock({endpoint:r,snippet:i,options:o}){if(r.examples&&!r.examples?.find(S=>V.DynamicIR.EndpointExample(i)&&S.id===i.id))throw new Error("Endpoint does not have an example that matches the snippet");let c=this.csharp.codeblock(S=>{S.writeNodeStatement(this.constructClient({endpoint:r,snippet:i})),S.newLine(),S.writeNodeStatement(this.callMethod({endpoint:r,snippet:i}))}),l=this.getStyle(o);switch(l){case $t.Concise:return c;case $t.Full:return this.buildFullCodeBlock({body:c,options:o});default:ce(l)}}buildFullCodeBlock({body:r,options:i}){let o=this.getConfig(i),c=this.csharp.class_({name:o.fullStyleClassName??"Example",namespace:"Usage",access:Ti.Access.Public});return c.addNamespaceReference(this.Types.RootClientForSnippets.namespace),c.addMethod({name:"Do",access:Ti.Access.Public,isAsync:!0,parameters:[],body:r}),c}constructClient({endpoint:r,snippet:i}){return this.csharp.codeblock(o=>{o.write("var client = "),o.writeNode(this.getRootClientConstructorInvocation(this.getConstructorArgs({endpoint:r,snippet:i})))})}callMethod({endpoint:r,snippet:i}){let o=r.response?.type==="streaming"||r.response?.type==="streamParameter",c=this.csharp.invokeMethod({on:this.csharp.codeblock("client"),method:this.getMethod({endpoint:r}),arguments_:this.getMethodArgs({endpoint:r,snippet:i}),async:!0,configureAwait:!0,multiline:!0,isAsyncEnumerable:o});return o?this.csharp.codeblock(l=>{l.write("await foreach (var item in "),l.writeNode(c),l.writeLine(")"),l.pushScope(),l.writeLine("/* consume each item */"),l.popScope()}):c}getConstructorArgs({endpoint:r,snippet:i}){let o=[];r.auth!=null&&(i.auth!=null?o.push(...this.getConstructorAuthArgs({auth:r.auth,values:i.auth})):this.context.errors.add({severity:ee.Warning,message:`Auth with ${r.auth.type} configuration is required for this endpoint`}));let c=[],l=this.getConstructorBaseUrlArgs({baseUrl:i.baseURL,environment:i.environment});l.length>0&&c.push(...l),this.context.errors.scope(et.Headers);let S=[];if(this.context.ir.headers!=null&&i.headers!=null&&S.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:i.headers})),this.context.errors.unscope(),this.settings.unifiedClientOptions){let w=[...o.map(I=>({name:Le(I.name),assignment:I.assignment})),...S.map(I=>({name:Le(I.name),assignment:I.assignment})),...c.map(I=>({name:I.name,assignment:I.assignment}))];return w.length===0?[]:[{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:w,multiline:!0})}]}return c.length===0?[...o,...S]:[...o,...S,{name:"clientOptions",assignment:this.csharp.instantiateClass({classReference:this.Types.ClientOptions,arguments_:c.map(w=>({name:w.name,assignment:w.assignment})),multiline:!0})}]}getConstructorBaseUrlArgs({baseUrl:r,environment:i}){let o=this.getBaseUrlArg({baseUrl:r,environment:i});return V.Literal.nop(o)?[]:[{name:this.getBaseUrlOptionName(),assignment:o}]}getBaseUrlArg({baseUrl:r,environment:i}){if(r!=null&&i!=null)return this.context.errors.add({severity:ee.Critical,message:"Cannot specify both baseUrl and environment options"}),this.csharp.Literal.nop();if(r!=null)return this.context.ir.environments?.environments.type==="multipleBaseUrls"?(this.context.errors.add({severity:ee.Critical,message:"The C# SDK doesn't support a baseUrl when multiple URL environments are configured"}),this.csharp.Literal.nop()):this.csharp.Literal.string(r);if(i!=null){if(this.context.isSingleEnvironmentID(i)){let o=this.context.getEnvironmentTypeReferenceFromID(i);return o==null?(this.context.errors.add({severity:ee.Warning,message:`Environment ${JSON.stringify(i)} was not found`}),this.csharp.Literal.nop()):this.csharp.Literal.reference(o)}if(this.context.isMultiEnvironmentValues(i))return this.context.validateMultiEnvironmentUrlValues(i)?this.csharp.Literal.reference(this.csharp.instantiateClass({classReference:this.Types.Environments,arguments_:Object.entries(i).map(([o,c])=>({name:Le(cr(o)),assignment:this.context.dynamicLiteralMapper.convert({typeReference:{type:"primitive",value:"STRING"},value:c})})),multiline:!0})):this.csharp.Literal.nop()}return this.csharp.Literal.nop()}getConstructorAuthArgs({auth:r,values:i}){if(i.type!==r.type)return this.addError(this.context.newAuthMismatchError({auth:r,values:i}).message),[];switch(r.type){case"basic":return i.type==="basic"?this.getConstructorBasicAuthArg({auth:r,values:i}):[];case"bearer":return i.type==="bearer"?this.getConstructorBearerAuthArgs({auth:r,values:i}):[];case"header":return i.type==="header"?this.getConstructorHeaderAuthArgs({auth:r,values:i}):[];case"oauth":return i.type==="oauth"?this.getConstructorOAuthArgs({auth:r,values:i}):[];case"inferred":return i.type==="inferred"?this.getConstructorInferredAuthArgs({auth:r,values:i}):[];default:ce(r)}}addError(r){this.context.errors.add({severity:ee.Critical,message:r})}addWarning(r){this.context.errors.add({severity:ee.Warning,message:r})}getConstructorBasicAuthArg({auth:r,values:i}){let o=r,c=!!o.usernameOmit,l=!!o.passwordOmit,S=[];return c||S.push({name:this.context.getParameterName(r.username),assignment:this.csharp.Literal.string(i.username)}),l||S.push({name:this.context.getParameterName(r.password),assignment:this.csharp.Literal.string(i.password)}),S}getConstructorBearerAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.token),assignment:this.csharp.Literal.string(i.token)}]}getConstructorHeaderAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.header.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:r.header.typeReference,value:i.value,fallbackToDefault:r.header.name.wireValue})}]}getConstructorOAuthArgs({auth:r,values:i}){return[{name:this.context.getParameterName(r.clientId),assignment:this.csharp.Literal.string(i.clientId)},{name:this.context.getParameterName(r.clientSecret),assignment:this.csharp.Literal.string(i.clientSecret)}]}getConstructorInferredAuthArgs({auth:r,values:i}){let o=[];if(r.parameters!=null)for(let c of r.parameters){let l=c.name.wireValue,S=i.values?.[l];o.push({name:this.context.getParameterName(c.name.name),assignment:this.context.dynamicLiteralMapper.convert({typeReference:c.typeReference,value:S,fallbackToDefault:l})})}else this.context.errors.add({severity:ee.Critical,message:"Inferred auth parameters are not defined in the IR. Please ensure you're using IR version 62.3.0 or later."});return o}getConstructorHeaderArgs({headers:r,values:i}){let o=[];for(let c of r){let l=i[c.name.wireValue],S=this.getConstructorHeaderArg({header:c,value:l});S!=null&&o.push({name:this.context.getParameterName(c.name.name),assignment:S})}return o}getConstructorHeaderArg({header:r,value:i}){let o=this.context.dynamicLiteralMapper.convert({typeReference:r.typeReference,value:i,fallbackToDefault:r.name.wireValue});if(!V.Literal.nop(o))return o}getMethodArgs({endpoint:r,snippet:i}){switch(r.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:r.request,snippet:i});case"body":return this.getMethodArgsForBodyRequest({request:r.request,snippet:i});default:ce(r.request)}}getMethodArgsForInlinedRequest({request:r,snippet:i}){let o=[];this.context.errors.scope(et.PathParameters);let c=[],l=[...this.context.ir.pathParameters??[],...r.pathParameters??[]];l.length>0&&c.push(...this.getPathParameters({namedParameters:l,snippet:i})),this.context.errors.unscope(),this.context.errors.scope(et.RequestBody);let S=this.getFilePropertyInfo({request:r,snippet:i});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:this.settings.shouldInlinePathParameters})||o.push(...c.map(w=>w.value)),o.push(this.getInlinedRequestArg({request:r,snippet:i,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:r,inlinePathParameters:this.settings.shouldInlinePathParameters})?c:[],filePropertyInfo:S})),o}getFilePropertyInfo({request:r,snippet:i}){return r.body==null||!this.context.isFileUploadRequestBody(r.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:r.body,value:i.requestBody})}getInlinedRequestArg({request:r,snippet:i,pathParameterFields:o,filePropertyInfo:c}){this.context.errors.scope(et.QueryParameters);let S=this.context.associateQueryParametersByWireValue({parameters:r.queryParameters??[],values:i.queryParameters??{}}).map(P=>({name:this.context.getPropertyName(P.name.name),value:this.context.dynamicLiteralMapper.convert(P)}));this.context.errors.unscope(),this.context.errors.scope(et.Headers);let I=this.context.associateByWireValue({parameters:r.headers??[],values:i.headers??{}}).map(P=>({name:this.context.getPropertyName(P.name.name),value:this.context.dynamicLiteralMapper.convert({...P,fallbackToDefault:P.name.wireValue})}));this.context.errors.unscope(),this.context.errors.scope(et.RequestBody);let A=r.body!=null?this.getInlinedRequestBodyConstructorFields({body:r.body,value:i.requestBody,filePropertyInfo:c}):[];return this.context.errors.unscope(),this.csharp.Literal.class_({reference:this.csharp.classReference({origin:r.declaration,namespace:this.context.getNamespace(r.declaration.fernFilepath)}),fields:[...o,...S,...I,...A]})}getInlinedRequestBodyConstructorFields({body:r,value:i,filePropertyInfo:o}){switch(r.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:r.value,value:i});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:r,value:i})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:o});default:ce(r)}}getInlinedRequestBodyPropertyConstructorFields({parameters:r,value:i}){let o=[],c=this.context.associateByWireValue({parameters:r,values:this.context.getRecord(i)??{}});for(let l of c)o.push({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicLiteralMapper.convert({...l,fallbackToDefault:l.name.wireValue})});return o}getFileUploadRequestBodyConstructorFields({filePropertyInfo:r}){return[...r.fileFields,...r.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:r,value:i}){return{name:this.context.getPropertyName(r.bodyKey),value:this.getReferencedRequestBodyPropertyLiteral({body:r.bodyType,value:i})}}getReferencedRequestBodyPropertyLiteral({body:r,value:i}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:i});case"typeReference":return this.context.dynamicLiteralMapper.convert({typeReference:r.value,value:i,fallbackToDefault:JSON.stringify(r.value)});default:ce(r)}}getMethodArgsForBodyRequest({request:r,snippet:i}){let o=[];this.context.errors.scope(et.PathParameters);let c=[...this.context.ir.pathParameters??[],...r.pathParameters??[]];return c.length>0&&o.push(...this.getPathParameters({namedParameters:c,snippet:i}).map(l=>l.value)),this.context.errors.unscope(),this.context.errors.scope(et.RequestBody),r.body!=null&&o.push(this.getBodyRequestArg({body:r.body,value:i.requestBody})),this.context.errors.unscope(),o}getBodyRequestArg({body:r,value:i}){switch(r.type){case"bytes":return this.getBytesBodyRequestArg({value:i});case"typeReference":return r.value.type==="optional"&&i==null?this.csharp.Literal.null():this.context.dynamicLiteralMapper.convert({typeReference:r.value,value:i,fallbackToDefault:JSON.stringify(r.value)});default:ce(r)}}getBytesBodyRequestArg({value:r}){let i=this.context.getValueAsString({value:r});return i==null&&(this.context.errors.add({severity:ee.Critical,message:"The bytes request body must be provided in string format"}),i="[bytes]"),this.csharp.Literal.reference(this.context.getMemoryStreamForString(i))}getRootClientConstructorInvocation(r){return this.csharp.instantiateClass({classReference:this.Types.RootClientForSnippets,arguments_:r,forceUseConstructor:!0,multiline:!0})}getPathParameters({namedParameters:r,snippet:i}){let o=[],c=this.context.associateByWireValueOrDefault({parameters:r,values:i.pathParameters??{}});for(let l of c)o.push({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicLiteralMapper.convert({...l,fallbackToDefault:l.name.wireValue})});return o}getMethod({endpoint:r}){return r.declaration.fernFilepath.allParts.length>0?`${r.declaration.fernFilepath.allParts.map(i=>this.context.getClassName(i)).join(".")}.${this.context.getMethodName(r.declaration.name)}`:this.context.getMethodName(r.declaration.name)}getBaseUrlOptionName(){return this.context.ir.environments?.environments.type==="multipleBaseUrls"?"Environment":"BaseUrl"}getStyle(r){return r.style??this.context.options.style??$t.Full}getConfig(r){return r.config??this.context.options.config??{}}};var So=class extends Bi{constructor({ir:t,config:r,options:i={}}){super(new bo({ir:t,config:r,options:i}))}precalculate(t){this.context.precalculate(t)}async generate(t,r={}){return super.generate(t,r)}generateSync(t,r={}){return super.generateSync(t,r)}async generateSnippetAst(t){return super.generateSnippetAst(t)}createSnippetGenerator(t){return new xo({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
34
34
  /*! Bundled license information:
35
35
 
36
36
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: