Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore Onvif limit extension and update limit values #145

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion dotnet/src/DTDLParser/generated/ContextCollection.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ static ContextCollection()
EndogenousAffiliateContextHistories["dtmi:dtdl:extension:overriding"] = GetAffiliate3ContextHistory();
EndogenousAffiliateContextHistories["dtmi:dtdl:extension:quantitativeTypes"] = GetAffiliate4ContextHistory();
EndogenousAffiliateContextHistories["dtmi:dtdl:extension:requirement"] = GetAffiliate5ContextHistory();
EndogenousAffiliateContextHistories["dtmi:iotcentral:context"] = GetAffiliate6ContextHistory();
EndogenousAffiliateContextHistories["dtmi:dtdl:limits:onvif"] = GetAffiliate6ContextHistory();
EndogenousAffiliateContextHistories["dtmi:iotcentral:context"] = GetAffiliate7ContextHistory();
}

private static ContextHistory GetAffiliate0ContextHistory()
Expand Down Expand Up @@ -911,6 +912,16 @@ private static ContextHistory GetAffiliate6ContextHistory()
{
List<VersionedContext> versionedContexts = new List<VersionedContext>();

VersionedContext context1_0 = new VersionedContext("dtmi:dtdl:limits:onvif;1", 1, 0, 4, "onvif_1", mergeDefinitions: false);
versionedContexts.Add(context1_0);

return new ContextHistory(versionedContexts);
}

private static ContextHistory GetAffiliate7ContextHistory()
{
List<VersionedContext> versionedContexts = new List<VersionedContext>();

VersionedContext context2_0 = new VersionedContext("dtmi:iotcentral:context;2", 2, 0, 0, null, mergeDefinitions: false);
context2_0.ReserveIdDefinitionPrefix("dtmi:iotcentral:");
context2_0.AddTermDefinition("AccelerationVector", new Dtmi("dtmi:iotcentral:class:AccelerationVector;2"), isMergeableType: false);
Expand Down
32 changes: 28 additions & 4 deletions dotnet/src/DTDLParser/generated/DTArrayInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2842,7 +2842,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -2903,7 +2909,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -2950,7 +2962,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down Expand Up @@ -3362,7 +3380,13 @@ private void CheckRestrictionsV4(ParsingErrorCollection parsingErrorCollection)
}
}

int maxDepthOfElementSchemaOrSchema = 8;
int maxDepthOfElementSchemaOrSchema = this.LimitSpecifier switch
{
"" => 8,
"onvif_1" => 24,
_ => 0,
};

List<Dtmi> tooDeepElementSchemaOrSchemaElementIds = new List<Dtmi>();
if (!this.CheckDepthOfElementSchemaOrSchema(0, maxDepthOfElementSchemaOrSchema, true, tooDeepElementSchemaOrSchemaElementIds, out Dictionary<string, JsonLdElement> tooDeepElementSchemaOrSchemaElts, parsingErrorCollection) && tooDeepElementSchemaOrSchemaElementIds != null)
{
Expand Down
24 changes: 21 additions & 3 deletions dotnet/src/DTDLParser/generated/DTBooleanInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2595,7 +2595,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -2656,7 +2662,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -2703,7 +2715,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down
24 changes: 21 additions & 3 deletions dotnet/src/DTDLParser/generated/DTByteInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -1609,7 +1615,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -1656,7 +1668,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down
24 changes: 21 additions & 3 deletions dotnet/src/DTDLParser/generated/DTBytesInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -1598,7 +1604,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -1645,7 +1657,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down
24 changes: 21 additions & 3 deletions dotnet/src/DTDLParser/generated/DTCommandInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3234,7 +3234,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -3295,7 +3301,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -3342,7 +3354,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down
24 changes: 21 additions & 3 deletions dotnet/src/DTDLParser/generated/DTCommandPayloadInfo.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2979,7 +2979,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
commentProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

string newComment = ValueParser.ParseSingularStringValueCollection(aggregateContext, this.Id, "comment", prop.Values, maxLength, null, layer, parsingErrorCollection, isOptional: true);
if (this.commentPropertyLayer != null)
{
Expand Down Expand Up @@ -3040,7 +3046,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
descriptionProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 4096,
_ => null,
};

Dictionary<string, string> newDescription = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "description", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> descriptionCodes = Helpers.GetKeysWithDifferingLiteralValues(this.Description, newDescription);
if (descriptionCodes.Any())
Expand Down Expand Up @@ -3087,7 +3099,13 @@ internal override void ParsePropertiesV4(Model model, List<ParsedObjectPropertyI
else
{
displayNameProperty = prop;
int? maxLength = 512;
int? maxLength = aggregateContext.LimitSpecifier switch
{
"" => 512,
"onvif_1" => 512,
_ => null,
};

Dictionary<string, string> newDisplayName = ValueParser.ParseLangStringValueCollection(aggregateContext, this.Id, "displayName", prop.Values, "en", maxLength, null, layer, parsingErrorCollection);
List<string> displayNameCodes = Helpers.GetKeysWithDifferingLiteralValues(this.DisplayName, newDisplayName);
if (displayNameCodes.Any())
Expand Down
Loading
Loading