MCPcopy Index your code
hub / github.com/github/copilot-sdk / emitSessionEventEnvelopeProperty

Function emitSessionEventEnvelopeProperty

scripts/codegen/csharp.ts:1290–1319  ·  view source on GitHub ↗
(
    property: SessionEventEnvelopeProperty,
    knownTypes: Map<string, string>,
    nestedClasses: Map<string, string>,
    enumOutput: string[]
)

Source from the content-addressed store, hash-verified

1288}
1289
1290function emitSessionEventEnvelopeProperty(
1291 property: SessionEventEnvelopeProperty,
1292 knownTypes: Map<string, string>,
1293 nestedClasses: Map<string, string>,
1294 enumOutput: string[]
1295): string[] {
1296 const csharpName = toCSharpPropertyName(property.name, property.schema);
1297 const csharpType = resolveSessionPropertyType(
1298 property.schema,
1299 "SessionEvent",
1300 csharpName,
1301 property.required,
1302 knownTypes,
1303 nestedClasses,
1304 enumOutput
1305 );
1306 const lines: string[] = [];
1307
1308 lines.push(...xmlDocPropertyComment(property.schema.description, property.name, " "));
1309 lines.push(...emitDataAnnotations(property.schema, " ", csharpType));
1310 if (isSchemaDeprecated(property.schema)) pushObsoleteAttributes(lines, " ");
1311 if (isSchemaExperimental(property.schema)) pushExperimentalAttribute(lines, " ");
1312 if (isMillisecondsDurationProperty(property.name, property.schema)) lines.push(` [JsonConverter(typeof(MillisecondsTimeSpanConverter))]`);
1313 if (!property.required) lines.push(` [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]`);
1314 const propVisibility = pushCSharpInternalAttribute(lines, property.schema);
1315 lines.push(` [JsonPropertyName("${property.name}")]`);
1316 lines.push(` ${propVisibility} ${csharpType} ${csharpName} { get; set; }`, "");
1317
1318 return lines;
1319}
1320
1321export function generateSessionEventsCode(schema: JSONSchema7): string {
1322 generatedEnums.clear();

Callers 1

Calls 11

toCSharpPropertyNameFunction · 0.85
xmlDocPropertyCommentFunction · 0.85
emitDataAnnotationsFunction · 0.85
isSchemaDeprecatedFunction · 0.85
pushObsoleteAttributesFunction · 0.85
isSchemaExperimentalFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…