From 0e3f82aec4ded74b6e841947f348ed0a26adfe8c Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 13 Jan 2022 09:43:43 +0100 Subject: [PATCH 01/53] Initial Commit for REST API ASP.NET --- src/AasxServer.sln | 16 +++++++++++++++- .../Properties/launchSettings.json | 3 ++- src/AasxServerStandardBib/AasxRestServer.cs | 2 +- src/AasxServerStandardBib/AdminShell.cs | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/AasxServer.sln b/src/AasxServer.sln index af858d897..891b05f48 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29306.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerCore", "AasxServerCore\AasxServerCore.csproj", "{7C0704A8-85C7-4FC9-B12D-C7B9E63EF7B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AasxServerWindows", "AasxServerWindows\AasxServerWindows.csproj", "{2315B8C5-B648-4730-8C2E-1346E4C4BADD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerWindows", "AasxServerWindows\AasxServerWindows.csproj", "{2315B8C5-B648-4730-8C2E-1346E4C4BADD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerStandardBib", "AasxServerStandardBib\AasxServerStandardBib.csproj", "{6D8FAFA1-0BA5-4E52-87D2-E4E37FC6D95F}" EndProject @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxServerBlazor\AasxServerBlazor.csproj", "{53165247-64F7-4151-A1DA-347780E0A538}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "..\..\aspnetcore-server-generated\src\IO.Swagger\IO.Swagger.csproj", "{51CE9584-07E9-4340-A7C0-29BD4E48653D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,6 +77,18 @@ Global {53165247-64F7-4151-A1DA-347780E0A538}.Release|x64.Build.0 = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.ActiveCfg = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index 202d1bfc8..c6019dc41 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -18,7 +18,8 @@ }, "AasxServerBlazor": { "commandName": "Project", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\Modbus\" --edit", + //"commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\Modbus\" --edit", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/src/AasxServerStandardBib/AasxRestServer.cs b/src/AasxServerStandardBib/AasxRestServer.cs index bcceddd95..d5170ad4d 100644 --- a/src/AasxServerStandardBib/AasxRestServer.cs +++ b/src/AasxServerStandardBib/AasxRestServer.cs @@ -910,7 +910,7 @@ public IHttpContext GetAuthserver(IHttpContext context) } // Basic AAS + Asset - + //TODO:Imp [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))(|/core|/complete|/thumbnail|/aasenv)(/|)$")] public IHttpContext GetAasAndAsset(IHttpContext context) diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 941a6fde6..9ea00ec60 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -4855,6 +4855,7 @@ public override string ToString() // ReSharper enable RedundantArgumentDefaultValue } + [JsonConverter(typeof(AdminShellConverters.JsonAasxConverter))] public class SubmodelElement : Referable, System.IDisposable, IGetReference, IGetSemanticId { // constants From a236372c6601e0de2cf59f381b00e886735b6b78 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 13 Jan 2022 10:07:36 +0100 Subject: [PATCH 02/53] Add Generated Swagger Code for Asp.Net core Rest APIs --- src/AasxServer.sln | 26 +- src/IO.Swagger/.gitignore | 208 + .../Attributes/ValidateModelStateAttribute.cs | 61 + .../AssetAdministrationShellRepositoryApi.cs | 1481 ++++++++ src/IO.Swagger/Dockerfile | 19 + src/IO.Swagger/Filters/BasePathFilter.cs | 51 + .../GeneratePathParamsValidationFilter.cs | 96 + src/IO.Swagger/Helpers/AASHelper.cs | 729 ++++ .../Helpers/IdentifierKeyValuePair_V2.cs | 127 + .../Helpers/OutputModifierContractResolver.cs | 65 + src/IO.Swagger/IO.Swagger.csproj | 24 + src/IO.Swagger/Models/AccessControl.cs | 222 ++ .../Models/AccessControlPolicyPoints.cs | 178 + src/IO.Swagger/Models/AccessPermissionRule.cs | 151 + .../Models/AdministrativeInformation.cs | 135 + .../Models/AnnotatedRelationshipElement.cs | 120 + .../Models/AssetAdministrationShell.cs | 196 + .../AssetAdministrationShellEnvironment.cs | 150 + src/IO.Swagger/Models/AssetInformation.cs | 105 + src/IO.Swagger/Models/AssetKind.cs | 39 + src/IO.Swagger/Models/BasicEvent.cs | 121 + src/IO.Swagger/Models/Blob.cs | 136 + src/IO.Swagger/Models/BlobCertificate.cs | 151 + src/IO.Swagger/Models/Capability.cs | 105 + src/IO.Swagger/Models/Certificate.cs | 105 + src/IO.Swagger/Models/ConceptDescription.cs | 135 + src/IO.Swagger/Models/Constraint.cs | 123 + src/IO.Swagger/Models/DataElement.cs | 105 + .../Models/DataSpecificationContent.cs | 105 + .../DataSpecificationIEC61360Content.cs | 271 ++ .../DataSpecificationPhysicalUnitContent.cs | 303 ++ .../Models/EmbeddedDataSpecification.cs | 141 + src/IO.Swagger/Models/Entity.cs | 166 + src/IO.Swagger/Models/EntityType.cs | 39 + src/IO.Swagger/Models/Extension.cs | 166 + src/IO.Swagger/Models/File.cs | 136 + src/IO.Swagger/Models/Formula.cs | 105 + src/IO.Swagger/Models/GlobalReference.cs | 121 + src/IO.Swagger/Models/HasDataSpecification.cs | 120 + src/IO.Swagger/Models/HasExtensions.cs | 120 + src/IO.Swagger/Models/HasSemantics.cs | 122 + src/IO.Swagger/Models/Identifiable.cs | 136 + .../Models/IdentifierKeyValuePair.cs | 153 + src/IO.Swagger/Models/Key.cs | 139 + src/IO.Swagger/Models/KeyElements.cs | 144 + src/IO.Swagger/Models/LangString.cs | 137 + src/IO.Swagger/Models/LevelType.cs | 49 + src/IO.Swagger/Models/Message.cs | 197 + src/IO.Swagger/Models/ModelEvent.cs | 105 + src/IO.Swagger/Models/ModelReference.cs | 138 + src/IO.Swagger/Models/ModelType.cs | 123 + src/IO.Swagger/Models/ModelTypes.cs | 164 + src/IO.Swagger/Models/ModelingKind.cs | 39 + .../Models/MultiLanguageProperty.cs | 135 + src/IO.Swagger/Models/ObjectAttributes.cs | 120 + src/IO.Swagger/Models/OneOfCertificate.cs | 105 + src/IO.Swagger/Models/OneOfConstraint.cs | 105 + src/IO.Swagger/Models/OneOfDataElement.cs | 105 + .../Models/OneOfDataSpecificationContent.cs | 105 + .../Models/OneOfOperationVariableValue.cs | 105 + src/IO.Swagger/Models/OneOfReference.cs | 105 + src/IO.Swagger/Models/OneOfSubmodelElement.cs | 105 + src/IO.Swagger/Models/Operation.cs | 150 + src/IO.Swagger/Models/OperationRequest.cs | 165 + src/IO.Swagger/Models/OperationResult.cs | 219 ++ src/IO.Swagger/Models/OperationVariable.cs | 121 + src/IO.Swagger/Models/Permission.cs | 166 + src/IO.Swagger/Models/PermissionsPerObject.cs | 154 + .../Models/PolicyAdministrationPoint.cs | 138 + src/IO.Swagger/Models/PolicyDecisionPoint.cs | 121 + .../Models/PolicyEnforcementPoint.cs | 121 + .../Models/PolicyInformationPoints.cs | 136 + src/IO.Swagger/Models/Property.cs | 154 + src/IO.Swagger/Models/Qualifiable.cs | 120 + src/IO.Swagger/Models/Qualifier.cs | 170 + src/IO.Swagger/Models/Range.cs | 151 + src/IO.Swagger/Models/Referable.cs | 182 + src/IO.Swagger/Models/Reference.cs | 105 + src/IO.Swagger/Models/ReferenceElement.cs | 120 + src/IO.Swagger/Models/RelationshipElement.cs | 137 + src/IO.Swagger/Models/Result.cs | 135 + src/IO.Swagger/Models/Security.cs | 153 + src/IO.Swagger/Models/SubjectAttributes.cs | 120 + src/IO.Swagger/Models/Submodel.cs | 182 + src/IO.Swagger/Models/SubmodelElement.cs | 167 + src/IO.Swagger/Models/SubmodelElementList.cs | 165 + .../Models/SubmodelElementStruct.cs | 122 + src/IO.Swagger/Models/ValueList.cs | 121 + src/IO.Swagger/Models/ValueObject.cs | 154 + .../Models/ValueReferencePairType.cs | 105 + src/IO.Swagger/Models/ValueTypeEnum.cs | 249 ++ src/IO.Swagger/Models/View.cs | 152 + src/IO.Swagger/Program.cs | 34 + src/IO.Swagger/Properties/launchSettings.json | 37 + src/IO.Swagger/Startup.cs | 141 + src/IO.Swagger/appsettings.json | 10 + src/IO.Swagger/web.config | 12 + src/IO.Swagger/wwwroot/README.md | 42 + src/IO.Swagger/wwwroot/index.html | 1 + src/IO.Swagger/wwwroot/swagger-original.json | 3341 +++++++++++++++++ src/IO.Swagger/wwwroot/web.config | 9 + 101 files changed, 17662 insertions(+), 13 deletions(-) create mode 100644 src/IO.Swagger/.gitignore create mode 100644 src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs create mode 100644 src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs create mode 100644 src/IO.Swagger/Dockerfile create mode 100644 src/IO.Swagger/Filters/BasePathFilter.cs create mode 100644 src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs create mode 100644 src/IO.Swagger/Helpers/AASHelper.cs create mode 100644 src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs create mode 100644 src/IO.Swagger/Helpers/OutputModifierContractResolver.cs create mode 100644 src/IO.Swagger/IO.Swagger.csproj create mode 100644 src/IO.Swagger/Models/AccessControl.cs create mode 100644 src/IO.Swagger/Models/AccessControlPolicyPoints.cs create mode 100644 src/IO.Swagger/Models/AccessPermissionRule.cs create mode 100644 src/IO.Swagger/Models/AdministrativeInformation.cs create mode 100644 src/IO.Swagger/Models/AnnotatedRelationshipElement.cs create mode 100644 src/IO.Swagger/Models/AssetAdministrationShell.cs create mode 100644 src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs create mode 100644 src/IO.Swagger/Models/AssetInformation.cs create mode 100644 src/IO.Swagger/Models/AssetKind.cs create mode 100644 src/IO.Swagger/Models/BasicEvent.cs create mode 100644 src/IO.Swagger/Models/Blob.cs create mode 100644 src/IO.Swagger/Models/BlobCertificate.cs create mode 100644 src/IO.Swagger/Models/Capability.cs create mode 100644 src/IO.Swagger/Models/Certificate.cs create mode 100644 src/IO.Swagger/Models/ConceptDescription.cs create mode 100644 src/IO.Swagger/Models/Constraint.cs create mode 100644 src/IO.Swagger/Models/DataElement.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationContent.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs create mode 100644 src/IO.Swagger/Models/EmbeddedDataSpecification.cs create mode 100644 src/IO.Swagger/Models/Entity.cs create mode 100644 src/IO.Swagger/Models/EntityType.cs create mode 100644 src/IO.Swagger/Models/Extension.cs create mode 100644 src/IO.Swagger/Models/File.cs create mode 100644 src/IO.Swagger/Models/Formula.cs create mode 100644 src/IO.Swagger/Models/GlobalReference.cs create mode 100644 src/IO.Swagger/Models/HasDataSpecification.cs create mode 100644 src/IO.Swagger/Models/HasExtensions.cs create mode 100644 src/IO.Swagger/Models/HasSemantics.cs create mode 100644 src/IO.Swagger/Models/Identifiable.cs create mode 100644 src/IO.Swagger/Models/IdentifierKeyValuePair.cs create mode 100644 src/IO.Swagger/Models/Key.cs create mode 100644 src/IO.Swagger/Models/KeyElements.cs create mode 100644 src/IO.Swagger/Models/LangString.cs create mode 100644 src/IO.Swagger/Models/LevelType.cs create mode 100644 src/IO.Swagger/Models/Message.cs create mode 100644 src/IO.Swagger/Models/ModelEvent.cs create mode 100644 src/IO.Swagger/Models/ModelReference.cs create mode 100644 src/IO.Swagger/Models/ModelType.cs create mode 100644 src/IO.Swagger/Models/ModelTypes.cs create mode 100644 src/IO.Swagger/Models/ModelingKind.cs create mode 100644 src/IO.Swagger/Models/MultiLanguageProperty.cs create mode 100644 src/IO.Swagger/Models/ObjectAttributes.cs create mode 100644 src/IO.Swagger/Models/OneOfCertificate.cs create mode 100644 src/IO.Swagger/Models/OneOfConstraint.cs create mode 100644 src/IO.Swagger/Models/OneOfDataElement.cs create mode 100644 src/IO.Swagger/Models/OneOfDataSpecificationContent.cs create mode 100644 src/IO.Swagger/Models/OneOfOperationVariableValue.cs create mode 100644 src/IO.Swagger/Models/OneOfReference.cs create mode 100644 src/IO.Swagger/Models/OneOfSubmodelElement.cs create mode 100644 src/IO.Swagger/Models/Operation.cs create mode 100644 src/IO.Swagger/Models/OperationRequest.cs create mode 100644 src/IO.Swagger/Models/OperationResult.cs create mode 100644 src/IO.Swagger/Models/OperationVariable.cs create mode 100644 src/IO.Swagger/Models/Permission.cs create mode 100644 src/IO.Swagger/Models/PermissionsPerObject.cs create mode 100644 src/IO.Swagger/Models/PolicyAdministrationPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyDecisionPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyEnforcementPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyInformationPoints.cs create mode 100644 src/IO.Swagger/Models/Property.cs create mode 100644 src/IO.Swagger/Models/Qualifiable.cs create mode 100644 src/IO.Swagger/Models/Qualifier.cs create mode 100644 src/IO.Swagger/Models/Range.cs create mode 100644 src/IO.Swagger/Models/Referable.cs create mode 100644 src/IO.Swagger/Models/Reference.cs create mode 100644 src/IO.Swagger/Models/ReferenceElement.cs create mode 100644 src/IO.Swagger/Models/RelationshipElement.cs create mode 100644 src/IO.Swagger/Models/Result.cs create mode 100644 src/IO.Swagger/Models/Security.cs create mode 100644 src/IO.Swagger/Models/SubjectAttributes.cs create mode 100644 src/IO.Swagger/Models/Submodel.cs create mode 100644 src/IO.Swagger/Models/SubmodelElement.cs create mode 100644 src/IO.Swagger/Models/SubmodelElementList.cs create mode 100644 src/IO.Swagger/Models/SubmodelElementStruct.cs create mode 100644 src/IO.Swagger/Models/ValueList.cs create mode 100644 src/IO.Swagger/Models/ValueObject.cs create mode 100644 src/IO.Swagger/Models/ValueReferencePairType.cs create mode 100644 src/IO.Swagger/Models/ValueTypeEnum.cs create mode 100644 src/IO.Swagger/Models/View.cs create mode 100644 src/IO.Swagger/Program.cs create mode 100644 src/IO.Swagger/Properties/launchSettings.json create mode 100644 src/IO.Swagger/Startup.cs create mode 100644 src/IO.Swagger/appsettings.json create mode 100644 src/IO.Swagger/web.config create mode 100644 src/IO.Swagger/wwwroot/README.md create mode 100644 src/IO.Swagger/wwwroot/index.html create mode 100644 src/IO.Swagger/wwwroot/swagger-original.json create mode 100644 src/IO.Swagger/wwwroot/web.config diff --git a/src/AasxServer.sln b/src/AasxServer.sln index 891b05f48..ec3f4c8a7 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -17,7 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxServerBlazor\AasxServerBlazor.csproj", "{53165247-64F7-4151-A1DA-347780E0A538}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "..\..\aspnetcore-server-generated\src\IO.Swagger\IO.Swagger.csproj", "{51CE9584-07E9-4340-A7C0-29BD4E48653D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "IO.Swagger\IO.Swagger.csproj", "{478697A0-89E4-4039-902E-0F13EA4EAD72}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -77,18 +77,18 @@ Global {53165247-64F7-4151-A1DA-347780E0A538}.Release|x64.Build.0 = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.ActiveCfg = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x64.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x64.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x86.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x86.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|Any CPU.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/IO.Swagger/.gitignore b/src/IO.Swagger/.gitignore new file mode 100644 index 000000000..cd9b840e5 --- /dev/null +++ b/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 000000000..07cfabe83 --- /dev/null +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace IO.Swagger.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs new file mode 100644 index 000000000..1d3cd1796 --- /dev/null +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -0,0 +1,1481 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; + +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; +using IO.Swagger.Helpers; +using AdminShellNS; +using Microsoft.IdentityModel.Tokens; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class AssetAdministrationShellRepositoryApiController : ControllerBase + { + private static AASHelper aasHelper; + /// + /// Constructor + /// + public AssetAdministrationShellRepositoryApiController() + { + aasHelper = new AASHelper(); + } + + /// + /// Deletes an Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Administration Shell deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteAssetAdministrationShellById")] + public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + { + var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the AAS"); + } + + /// + /// Deletes a Concept Description + /// + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Concept Description deleted successfully + [HttpDelete] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteConceptDescriptionById")] + public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]string cdIdentifier) + { + bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the concept description {cdIdentifier}"); + } + + /// + /// Deletes a submodel element at a specified path within the submodel elements hierarchy + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Submodel element deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelElementByPath")] + public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out AdminShellV20.SubmodelElement parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + + /// + /// Deletes a submodel element at a specified path within the submodel elements hierarchy + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Submodel element deleted successfully + [HttpDelete] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] + public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + { + submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, Base64UrlEncoder.Decode(idShortPath), out AdminShellV20.SubmodelElement parent); + if (submodelElement != null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + + /// + /// Deletes the submodel reference from the Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Submodel reference deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelReferenceById")] + public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier) + { + aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); + submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + + bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the submodel reference {submodelIdentifier} from AAS {aasIdentifier}"); + } + + /// + /// Returns an appropriate serialization based on the specified format (see SerializationFormat) + /// + /// The Asset Administration Shells' unique ids (BASE64-URL-encoded) + /// The Submodels' unique ids (BASE64-URL-encoded) + /// Include Concept Descriptions? + /// Requested serialization based on SerializationFormat + [HttpGet] + [Route("/serialization")] + [ValidateModelState] + [SwaggerOperation("GenerateSerializationByIds")] + [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] + public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]List aasIds, [FromQuery][Required()]List submodelIds, [FromQuery][Required()]bool? includeConceptDescriptions) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(byte[])); + string exampleJson = null; + exampleJson = "\"\""; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(byte[]); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns all Asset Administration Shells + /// + /// The key-value-pair of an Asset identifier + /// The Asset Administration Shell’s IdShort + /// Requested Asset Administration Shells + [HttpGet] + [Route("/shells")] + [ValidateModelState] + [SwaggerOperation("GetAllAssetAdministrationShells")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Asset Administration Shells")] + //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) + public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string assetIds, [FromQuery]string idShort) + { + //TODO: Consider a case where both assetIds and idShort are present. + var aasList = new List(); + if (string.IsNullOrEmpty(assetIds) && string.IsNullOrEmpty(idShort)) + { + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + aasList.Add(env.AasEnv.AdministrationShells[0]); + } + } + + return new ObjectResult(aasList); + } + + if (!string.IsNullOrEmpty(assetIds)) + { + assetIds = Base64UrlEncoder.Decode(assetIds); + var assetIdList = JsonConvert.DeserializeObject>(assetIds); + return new ObjectResult(aasHelper.FindAllAasByAssetIds(assetIdList)); + } + + if (!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllAasByIdShort(idShort)); + } + + + return new ObjectResult(aasList); + } + + /// + /// Returns all Concept Descriptions + /// + /// The Concept Description’s IdShort + /// IsCaseOf reference (BASE64-URL-encoded) + /// DataSpecification reference (BASE64-URL-encoded) + /// Requested Concept Descriptions + [HttpGet] + [Route("/concept-descriptions")] + [ValidateModelState] + [SwaggerOperation("GetAllConceptDescriptions")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] + public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort, [FromQuery]string isCaseOf, [FromQuery]string dataSpecificationRef) + { + //Return all the concept-descriptions from the server, NO Filter + if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef) ) + { + var cdList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + cdList.AddRange(env.AasEnv.ConceptDescriptions); + } + } + + return new ObjectResult(cdList); + } + + //CDs filtered with idShort + if(!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); + } + + //CDs filtered with isCaseOfReference + if(!string.IsNullOrEmpty(isCaseOf)) + { + var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); + } + + //CDs filtered with isCaseOfReference + if (!string.IsNullOrEmpty(dataSpecificationRef)) + { + var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByDataSpecRef(dataSpecRefReq)); + } + + + //TODO:Re-do + return NoContent(); + + } + + /// + /// Returns all submodel elements including their hierarchy + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// List of found submodel elements + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelElements")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] + public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + + // access AAS and Submodel + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + + if(submodel == null) + { + return NotFound($"Submodel not found."); + } + + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + + if(string.IsNullOrEmpty(level) && string.IsNullOrEmpty(content) && string.IsNullOrEmpty(extent)) + { + return new ObjectResult(submodelElements); + } + + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + + return new ObjectResult(json); + } + + /// + /// Returns all submodel elements including their hierarchy + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// List of found submodel elements + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelElementsSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] + public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel != null) + { + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + return new ObjectResult(submodelElements); + } + else + { + return NotFound($"Submodel not found."); + } + } + + /// + /// Returns all submodel references + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested submodel references + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelReferences")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] + public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]string aasIdentifier) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS.submodelRefs); + } + else + { + return NotFound($"AAS not found."); + } + + } + + /// + /// Returns all Submodels + /// + /// The value of the semantic id reference (BASE64-URL-encoded) + /// The Submodel’s idShort + /// Requested Submodels + [HttpGet] + [Route("/submodels")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodels")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] + public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [FromQuery]string idShort) + { + //Fetch all the submodels from the server + if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + { + var submodelList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + submodelList.AddRange(env.AasEnv.Submodels); + } + } + + return new ObjectResult(submodelList); + } + + if(!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); + } + + if (!string.IsNullOrEmpty(semanticId)) + { + var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); + return new ObjectResult(aasHelper.FindAllSubmodelsBySemanticId(reqSemaniticId)); + } + + //TODO: Re-Do + return NoContent(); + } + + /// + /// Returns the Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Determines the request or response kind of the resource + /// Requested Asset Administration Shell + [HttpGet] + [Route("/shells/{aasIdentifier}/aas")] + [ValidateModelState] + [SwaggerOperation("GetAssetAdministrationShell")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] + public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]string aasIdentifier, [FromQuery]string content) + { + //TODO: Content ?? + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } + + return NotFound(); + } + + /// + /// Returns a specific Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested Asset Administration Shell + [HttpGet] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("GetAssetAdministrationShellById")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] + public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } + + return NotFound(); + } + + /// + /// Returns the Asset Information + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested Asset Information + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/asset-information")] + [ValidateModelState] + [SwaggerOperation("GetAssetInformation")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetInformation), description: "Requested Asset Information")] + public virtual IActionResult GetAssetInformation([FromRoute][Required]string aasIdentifier) + { + //TODO:Change to AssetInformation in V3 + //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); + if(asset != null) + { + return new ObjectResult(asset); + } + } + + return NotFound(); + + } + + /// + /// Returns a specific Concept Description + /// + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Requested Concept Description + [HttpGet] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("GetConceptDescriptionById")] + [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] + public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]string cdIdentifier) + { + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); + if(conceptDescription != null) + { + return new ObjectResult(conceptDescription); + } + + return NotFound($"Concept Description {cdIdentifier} not found"); + } + + /// + /// Returns the Operation result of an asynchronous invoked Operation + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded) + /// + /// Operation result object + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}")] + [ValidateModelState] + [SwaggerOperation("GetOperationAsyncResult")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns the Operation result of an asynchronous invoked Operation + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded) + /// + /// Operation result object + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}")] + [ValidateModelState] + [SwaggerOperation("GetOperationAsyncResultSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns the Submodel + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested Submodel + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("GetSubmodel")] + [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] + public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider other parameters súch as level, content, & extent + + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel != null) + { + return new ObjectResult(submodel); + } + + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + } + + /// + /// Returns a specific submodel element from the Submodel at a specified path + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested submodel element + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelElementByPath")] + [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] + public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if(submodelElement != null) + { + return new ObjectResult(submodelElement); + } + + return NotFound($"Requested submodel element not found."); + } + + /// + /// Returns a specific submodel element from the Submodel at a specified path + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested submodel element + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelElementByPathSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] + public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: support for Content, extent and level + + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement != null) + { + return new ObjectResult(submodelElement); + } + + return NotFound($"Requested submodel element not found."); + } + + /// + /// Returns the Submodel + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested Submodel + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] + public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider rest of the parameters i.e., level, content & extent + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel != null) + { + return new ObjectResult(submodel); + } + + return NotFound($"Submodel not found."); + } + + /// + /// Synchronously or asynchronously invokes an Operation at a specified path + /// + /// Operation request object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// Determines whether an operation invocation is performed asynchronously or synchronously + /// Determines the request or response kind of the resource + /// Operation result object + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke")] + [ValidateModelState] + [SwaggerOperation("InvokeOperation")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + { + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if(submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var output = aasHelper.InvokeOperation(submodelElement); + + return NoContent(); + } + + /// + /// Synchronously or asynchronously invokes an Operation at a specified path + /// + /// Operation request object + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// Determines whether an operation invocation is performed asynchronously or synchronously + /// Determines the request or response kind of the resource + /// Operation result object + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke")] + [ValidateModelState] + [SwaggerOperation("InvokeOperationSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult InvokeOperationSubmodelRepo([FromBody]OperationRequest body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Creates a new Asset Administration Shell + /// + /// Asset Administration Shell object + /// Asset Administration Shell created successfully + [HttpPost] + [Route("/shells")] + [ValidateModelState] + [SwaggerOperation("PostAssetAdministrationShell")] + [SwaggerResponse(statusCode: 201, type: typeof(AssetAdministrationShell), description: "Asset Administration Shell created successfully")] + //public virtual IActionResult PostAssetAdministrationShell([FromBody]AssetAdministrationShell body) + public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + //Check if already exists + var aasReturn = aasHelper.FindAas(body.idShort); + if(aasReturn.AAS != null) + { + return Conflict($"Asset Administration Shell {body.idShort} already exists."); + } + + bool added = aasHelper.AddAas(body); + if(added) + { + AasxServer.Program.signalNewData(2); + return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + + /// + /// Creates a new Concept Description + /// + /// Concept Description object + /// Concept Description created successfully + [HttpPost] + [Route("/concept-descriptions")] + [ValidateModelState] + [SwaggerOperation("PostConceptDescription")] + [SwaggerResponse(statusCode: 201, type: typeof(ConceptDescription), description: "Concept Description created successfully")] + //public virtual IActionResult PostConceptDescription([FromBody]ConceptDescription body) + public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.ConceptDescription body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } + + //Check if already exists + var conceptDescription = aasHelper.FindConceptDescription(body.idShort, out _); + if (conceptDescription != null) + { + return Conflict($"Concept Description {body.idShort} already exists."); + } + + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Concept Description {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new Submodel + /// + /// Submodel object + /// Submodel created successfully + [HttpPost] + [Route("/submodels")] + [ValidateModelState] + [SwaggerOperation("PostSubmodel")] + [SwaggerResponse(statusCode: 201, type: typeof(Submodel), description: "Submodel created successfully")] + //public virtual IActionResult PostSubmodel([FromBody]Submodel body) + public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + //Check if already exists + var submodel = aasHelper.FindSubmodel(body.idShort); + if (submodel != null) + { + return Conflict($"Submodel {body.idShort} already exists."); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new submodel element + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElement")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider rest of the parameters, i.e., level, content & extent + + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel == null) + { + return NotFound($"Submodel not found"); + } + + //Check for idShort in SubmodelElement + if(string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } + + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if(submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel Element {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementByPath")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } + + if(string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + //Check if requested submodel element already exists in the parent SME + if(parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + { + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if(existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if(added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Creates a new submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementByPathSubmodelRepo")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + { + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Creates a new submodel element + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementSubmodelRepo")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } + + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel Element {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a submodel reference at the Asset Administration Shell + /// + /// Reference to the Submodel + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Submodel reference created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelReference")] + [SwaggerResponse(statusCode: 201, type: typeof(Reference), description: "Submodel reference created successfully")] + //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Reference body, [FromRoute][Required]string aasIdentifier) + { + if (body.Count == 0) + { + return BadRequest($"No references present in the request payload."); + } + else if(body.Count != 1) + { + return BadRequest($"More than one references present in the request payload."); + } + + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found."); + } + + //Check if Submodel with this reference exists + var submodel = aasHelper.FindSubmodelWithReference(body); + if (submodel == null) + { + return BadRequest($"No Submodel with this reference present in the server"); + } + + //Check if reference already exists with the AAS + if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + { + return Conflict($"The Submodel Reference already exists in AAS {aasIdentifier}"); + } + + aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); + AasxServer.Program.signalNewData(1); + return Created($"Submodel reference created successfully.", body); + + } + + /// + /// Updates the Asset Administration Shell + /// + /// Asset Administration Shell object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Determines the request or response kind of the resource + /// Asset Administration Shell updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas")] + [ValidateModelState] + [SwaggerOperation("PutAssetAdministrationShell")] + //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + { + //TODO: content?? + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + if(!aasIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {aasIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates an existing Asset Administration Shell + /// + /// Asset Administration Shell object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Administration Shell updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("PutAssetAdministrationShellById")] + //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + if (!aasIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {aasIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates the Asset Information + /// + /// Asset Information object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Information updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/asset-information")] + [ValidateModelState] + [SwaggerOperation("PutAssetInformation")] + public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) + { + //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(204); + + throw new NotImplementedException(); + } + + /// + /// Updates an existing Concept Description + /// + /// Concept Description object + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Concept Description updated successfully + [HttpPut] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("PutConceptDescriptionById")] + //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) + public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.ConceptDescription body, [FromRoute][Required]string cdIdentifier) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } + + if (!cdIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {cdIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates the Submodel + /// + /// Submodel object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("PutSubmodel")] + //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider other parameters i.e., level, content, extent + + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found."); + } + + if (!submodelIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {submodelIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + //Check if AAS has the submodelRef, if not create one. + var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); + if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + { + aasReturn.AAS.submodelRefs.Add(newsmRef); + } + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelElementByPath")] + //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element updated successfully + [HttpPut] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelElementByPathSubmodelRepo")] + //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Updates the Submodel + /// + /// Submodel object + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel updated successfully + [HttpPut] + [Route("/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelSubmodelRepo")] + //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + if (!submodelIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {submodelIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + } +} diff --git a/src/IO.Swagger/Dockerfile b/src/IO.Swagger/Dockerfile new file mode 100644 index 000000000..a22c4e17f --- /dev/null +++ b/src/IO.Swagger/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 +WORKDIR /app +COPY --from=build-env /app/out . + +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 000000000..c9d95d6d1 --- /dev/null +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,51 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 000000000..1845e56ac --- /dev/null +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,96 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; + } + } + } + } + } + } +} diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs new file mode 100644 index 000000000..fd2f5a87f --- /dev/null +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -0,0 +1,729 @@ +using AdminShellNS; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Helpers +{ + /// + /// A helper class to suffice all the AAS related queries. + /// + public class AASHelper + { + private static AdminShellPackageEnv[] Packages; + + /// + /// Constructor + /// + public AASHelper() + { + Packages = AasxServer.Program.env; + } + + internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) + { + FindAasReturn aasReturn = FindAas(aasIdentifier); + + if (aasReturn.AAS == null) + return null; + + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodel; + } + + // no + return null; + } + + /// + /// Return a specific AAS from the server + /// + /// The Asset Administration Shell’s unique id + /// + public FindAasReturn FindAas(string aasIdentifier) + { + FindAasReturn findAasReturn = new FindAasReturn(); + + if (Packages == null) + return null; + + if (Regex.IsMatch(aasIdentifier, @"^\d+$")) // only number, i.e. index + { + // Index + int i = Convert.ToInt32(aasIdentifier); + + if (i > Packages.Length) + return null; + + if (Packages[i] == null || Packages[i].AasEnv == null || Packages[i].AasEnv.AdministrationShells == null + || Packages[i].AasEnv.AdministrationShells.Count < 1) + return null; + + findAasReturn.AAS = Packages[i].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = i; + } + else + { + // Name + if (aasIdentifier == "id") + { + findAasReturn.AAS = Packages[0].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = 0; + } + else + { + for (int i = 0; i < Packages.Length; i++) + { + if (Packages[i] != null) + { + if (Packages[i].AasEnv.AdministrationShells[0].identification.id == aasIdentifier) + { + findAasReturn.AAS = Packages[i].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = i; + break; + } + } + } + } + } + + return findAasReturn; + } + + //TODO: delete the cd Ref from corresponding AAS + internal bool DeleteConceptDescription(string cdIdentifier) + { + bool deleted = false; + var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); + if(conceptDescription != null) + { + Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); + deleted = true; + } + + return deleted; + } + + + internal ConceptDescription FindConceptDescription(string cdIdentifier, out int packageIndex) + { + if (Packages != null) + { + for(int i=0; i< Packages.Length;i++) + { + var env = Packages[i]; + if (env != null) + { + foreach(var cd in env.AasEnv.ConceptDescriptions) + { + if (cd.identification.id != null && cd.identification.id.Trim().ToLower() == cdIdentifier.Trim().ToLower()) + { + packageIndex = i; + return cd; + } + } + } + } + } + + packageIndex = 0; + return null; + } + + //TODO: Check if asset needs to be deleted? an asset can be referenced in many shells. + internal bool DeleteAASAndAsset(string aasIdentifier) + { + bool success = false; + // find the AAS + var aasReturn = FindAas(aasIdentifier); + if(aasReturn.AAS != null) + { + // find the asset + var asset = FindAssetwithReference(aasReturn.AAS.assetRef); + //Deleting AAS from the server + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Remove(aasReturn.AAS); + success = true; + if (Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Count == 0) + { + Packages[aasReturn.IPackage] = null; + } + else + { + if (asset != null) + { + //TODO:Check if needs to be removed (BG: Asset can have multiple shells) + Packages[aasReturn.IPackage].AasEnv.Assets.Remove(asset); + } + } + } + + return success; + } + + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) + { + if(parent is SubmodelElementCollection parentColl) + { + parentColl.value.Remove(submodelElement); + return true; + } + + return false; + } + + internal Asset FindAssetwithReference(AssetRef assetRef) + { + if (Packages != null) + { + foreach (var env in Packages) + { + if (env != null) + { + Asset asset = env.AasEnv.FindAsset(assetRef); + if(asset != null) + { + return asset; + } + } + } + } + + return null; + } + + internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submodelIdentifier) + { + FindAasReturn aasReturn = FindAas(aasIdentifier); + + if (aasReturn.AAS!= null) + { + SubmodelRef submodelRef = FindSubmodelRefWithinAAS(aasReturn, submodelIdentifier); + if (submodelRef != null) + { + aasReturn.AAS.submodelRefs.Remove(submodelRef); + return true; + } + } + + return false; + } + + internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string submodelIdentifier) + { + if (aasReturn.AAS != null) + { + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodelRef; + } + } + + return null; + } + + internal Submodel FindSubmodel(string submodelIdentifier) + { + if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) + return null; + + //TODO: Check again + // via handle + //var specialHandles = CreateHandlesFromRawUrl(rawUrl); + //var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); + //if (handleId != null && handleId.identification != null) + // return Packages[0].AasEnv.FindSubmodel(handleId.identification); + + // no, iterate & find + foreach (var submodel in Packages[0].AasEnv.Submodels) + { + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodel; + } + + // no + return null; + } + + /// + /// If AAS exists, it is updated. If not, added. + /// Similar to HTTP PUT + /// + /// + /// + internal bool AddAas(AdministrationShell aas) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingAas = Packages[envi].AasEnv.FindAAS(aas.identification); + if (existingAas != null) + { + Packages[envi].AasEnv.AdministrationShells.Remove(existingAas); + Packages[envi].AasEnv.AdministrationShells.Add(aas); + return true; + } + } + else + { + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); + return true; + } + + return false; + } + + internal bool AddConceptDescription(ConceptDescription conceptDescription) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingCD = Packages[envi].AasEnv.FindConceptDescription(conceptDescription.identification); + if (existingCD != null) + { + Packages[envi].AasEnv.ConceptDescriptions.Remove(existingCD); + Packages[envi].AasEnv.ConceptDescriptions.Add(conceptDescription); + return true; + } + } + else + { + //TODO: This logic is not in the old server. + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); + return true; + } + + return false; + } + + internal List FindAllAasByIdShort(string idShort) + { + List outputShells = new List(); + foreach (AdminShellPackageEnv env in Packages) + { + if (env != null) + { + foreach (AdministrationShell aas in env.AasEnv.AdministrationShells) + { + if (!string.IsNullOrEmpty(aas.idShort) && aas.idShort.Equals(idShort)) + { + outputShells.Add(aas); + } + } + } + } + + return outputShells; + } + + internal List FindAllAasByAssetIds(List assetIdList) + { + List outputShells = new List(); + + foreach(IdentifierKeyValuePair_V2 assetId in assetIdList) + { + outputShells.AddRange(FindAasByAssetId(assetId.Value)); + } + + return outputShells; + } + + private List FindAasByAssetId(string assetId) + { + List outputShells = new List(); + foreach (AdminShellPackageEnv env in Packages) + { + if (env != null) + { + foreach (AdministrationShell aas in env.AasEnv.AdministrationShells) + { + if (!aas.assetRef.IsEmpty && aas.assetRef.Keys[0].value.Equals(assetId)) + { + outputShells.Add(aas); + } + } + } + } + + return outputShells; + } + + internal List FindAllConceptDescriptionsByIdShort(string idShort) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach(ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if(conceptDescription.idShort.Equals(idShort)) + { + outputCds.Add(conceptDescription); + } + } + } + } + + return outputCds; + } + + internal object FindAllConceptDescriptionsByDataSpecRef(DataSpecificationRef dataSpecRefReq) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if (conceptDescription.embeddedDataSpecification != null ) + { + foreach(EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) + { + if(embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + { + outputCds.Add(conceptDescription); + } + } + + } + } + } + } + + return outputCds; + } + + internal List FindAllConceptDescriptionsByIsCaseOf(List isCaseOfObj) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if ((conceptDescription.IsCaseOf != null) && CompareIsCaseOf(conceptDescription.IsCaseOf, isCaseOfObj)) + { + outputCds.Add(conceptDescription); + } + } + } + } + + return outputCds; + } + + private bool CompareIsCaseOf(List isCaseOf1, List isCaseOf2) + { + foreach(Reference isCaseOf1_Ref in isCaseOf1) + { + bool found=false; + foreach(Reference isCaseOf2_Ref in isCaseOf2) + { + if(isCaseOf1_Ref.Matches(isCaseOf2_Ref)) + { + found = true; + break; + } + } + + if(!found) + { + return false; + } + } + + return true; + } + + internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") + { + //Handle Level + var json = ApplyLevelModifier(level, obj); + return json; + } + + private object ApplyLevelModifier(string level, object obj) + { + if(level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + var contractResolver = new OutputModifierContractResolver(true); + var settings = new JsonSerializerSettings(); + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; + } + return null; + } + + internal bool AddSubmodel(Submodel submodel) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingSubmodel = Packages[envi].AasEnv.FindSubmodel(submodel.identification); + if (existingSubmodel != null) + { + Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); + Packages[envi].AasEnv.Submodels.Add(submodel); + return true; + } + } + else + { + //TODO: This logic is not in the old server. + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.Submodels.Add(submodel); + return true; + } + + return false; + } + + internal Submodel FindSubmodelWithReference(Reference submodelRef) + { + //There should be exactly one key + if (submodelRef.Count != 1) + return null; + + foreach(var env in Packages) + { + if(env != null) + { + var submodel = env.AasEnv.FindSubmodel(new Identification(submodelRef.First.idType, submodelRef.First.value)); + if(submodel != null) + { + return submodel; + } + } + } + + return null; + } + + internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElement) + { + var existingSmEle = submodel.FindSubmodelElementWrapper(submodelElement.idShort); + //Check if submodel element already exists in the submodel + if (existingSmEle != null) + { + int indexOfExistingSmw = submodel.submodelElements.IndexOf(existingSmEle); + submodel.submodelElements.RemoveAt(indexOfExistingSmw); + submodel.Insert(indexOfExistingSmw, submodelElement); + submodel.SetAllParents(DateTime.UtcNow); + return true; + } + else + { + submodel.Add(submodelElement); + submodel.SetAllParents(DateTime.UtcNow); + return true; + } + + } + + /// + /// + /// + /// + /// e.g. SMEColl_idShort.SME_idShort + /// Parent of SME, bzw. SMEColl + /// + internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out SubmodelElement parent) + { + parent = null; + if (idShortPath.Contains('.')) + { + string[] idShorts = idShortPath.Split('.', 2); + foreach (var smeWrapper in submodel.submodelElements) + { + var submodelElement = smeWrapper.submodelElement; + if (submodelElement.idShort.Equals(idShorts[0])) + { + if (submodelElement is SubmodelElementCollection collection) + { + return FindSubmodelElementByPath(collection, idShorts[1], out parent); + } + } + } + } + else + { + var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); + if(smeWrapper != null) + return smeWrapper.submodelElement; + } + + return null; + } + + internal object FindAllSubmodelsBySemanticId(SemanticId reqSemaniticId) + { + var outputSubmodels = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (Submodel submodel in env.AasEnv.Submodels) + { + if ((submodel.semanticId != null) && submodel.semanticId.Matches(reqSemaniticId)) + { + outputSubmodels.Add(submodel); + } + } + } + } + + return outputSubmodels; + } + + internal List FindAllSubmodelsByIdShort(string idShort) + { + var outputSubmodels = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (Submodel submodel in env.AasEnv.Submodels) + { + if(submodel.idShort.Equals(idShort)) + { + outputSubmodels.Add(submodel); + } + } + } + } + + return outputSubmodels; + } + + internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection smeColl, string idShortPath, out SubmodelElement parent) + { + parent = null; + string[] idShorts = idShortPath.Split('.', 2); + foreach (var smeWrapper in smeColl.value) + { + var submodelElement = smeWrapper.submodelElement; + if (submodelElement.idShort.Equals(idShorts[0])) + { + if (submodelElement is SubmodelElementCollection collection) + { + parent = collection; + FindSubmodelElementByPath(collection, idShorts[1], out parent); + } + else if (submodelElement is SubmodelElement) + { + parent = smeColl; + return submodelElement; + } + } + } + + return null; + } + + internal object InvokeOperation(SubmodelElement submodelElement) + { + throw new NotImplementedException(); + } + + /// + /// Adds the submodel element to the SMECollection + /// + /// + /// + /// + internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) + { + + if (parentSME is SubmodelElementCollection parentSMEColl) + { + var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); + //Check if submodel element already exists in the collection + if (existingSmEle != null) + { + int indexOfExistingSmw = parentSMEColl.value.IndexOf(existingSmEle); + parentSMEColl.value.RemoveAt(indexOfExistingSmw); + parentSMEColl.Insert(indexOfExistingSmw, submodelElement); + } + else + { + parentSMEColl.Add(submodelElement); + + } + + submodelElement.SetAllTimeStamps(DateTime.UtcNow); + return true; + } + + return false; + } + } + + /// + /// The class consists of an AAS and a ENV package which it belongs to. + /// + public class FindAasReturn + { + public AdminShell.AdministrationShell AAS { get; set; } = null; + public int IPackage { get; set; } = -1; + } +} diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs new file mode 100644 index 000000000..a5f0b5c4c --- /dev/null +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -0,0 +1,127 @@ +using IO.Swagger.Models; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace IO.Swagger.Helpers +{ + /// + /// + /// + [DataContract] + public partial class IdentifierKeyValuePair_V2 + { + /// + /// Gets or Sets Key + /// + [Required] + + [DataMember(Name = "key")] + public string Key { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name = "value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IdentifierKeyValuePair {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IdentifierKeyValuePair_V2)obj); + } + + /// + /// Returns true if IdentifierKeyValuePair instances are equal + /// + /// Instance of IdentifierKeyValuePair to be compared + /// Boolean + public bool Equals(IdentifierKeyValuePair other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Key == other.Key || + Key != null && + Key.Equals(other.Key) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Key != null) + hashCode = hashCode * 59 + Key.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators +#pragma warning disable 1591 + + //public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + //{ + // return Equals(left, right); + //} + + //public static bool operator !=(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + //{ + // return !Equals(left, right); + //} + +#pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs new file mode 100644 index 000000000..f77fe899a --- /dev/null +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -0,0 +1,65 @@ +using AdminShellNS; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +namespace IO.Swagger.Helpers +{ + /// + /// This converter / contract resolver for Json.NET adaptively filters different levels of depth + /// of nested AASX structures. + /// + public class OutputModifierContractResolver : DefaultContractResolver + { + public bool AasHasViews = true; + public bool BlobHasValue = false; // only true, if extent modifier is withBLOBValue + public bool SubmodelHasElements = true; + public bool SmcHasValue = true; + public bool OpHasVariables = true; + + + public OutputModifierContractResolver(bool deep = true) + { + if (!deep) + { + this.SubmodelHasElements = false; + this.SmcHasValue = false; + this.OpHasVariables = false; + this.BlobHasValue = false; + this.AasHasViews = false; + } + } + + /// + /// + /// + /// + /// + /// + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + JsonProperty property = base.CreateProperty(member, memberSerialization); + + if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && property.PropertyName == "value") + property.ShouldSerialize = instance => { return false; }; + + if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && property.PropertyName == "submodelElements") + property.ShouldSerialize = instance => { return false; }; + + if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && property.PropertyName == "value") + property.ShouldSerialize = instance => { return false; }; + + if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && (property.PropertyName == "in" || property.PropertyName == "out")) + property.ShouldSerialize = instance => { return false; }; + + if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && property.PropertyName == "views") + property.ShouldSerialize = instance => { return false; }; + + return property; + } + } +} diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 000000000..4aa64e512 --- /dev/null +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,24 @@ + + + IO.Swagger + IO.Swagger + netcoreapp3.1 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + + + + + + diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs new file mode 100644 index 000000000..1e06c68d5 --- /dev/null +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -0,0 +1,222 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessControl : IEquatable + { + /// + /// Gets or Sets AccessPermissionRule + /// + + [DataMember(Name="accessPermissionRule")] + public List AccessPermissionRule { get; set; } + + /// + /// Gets or Sets DefaultEnvironmentAttributes + /// + + [DataMember(Name="defaultEnvironmentAttributes")] + //TODO:Uncomment + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultEnvironmentAttributes { get; set; } + public Reference DefaultEnvironmentAttributes { get; set; } + + /// + /// Gets or Sets DefaultPermissions + /// + + [DataMember(Name="defaultPermissions")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultPermissions { get; set; } + public Reference DefaultPermissions { get; set; } + + /// + /// Gets or Sets DefaultSubjectAttributes + /// + + [DataMember(Name="defaultSubjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultSubjectAttributes { get; set; } + public Reference DefaultSubjectAttributes { get; set; } + + /// + /// Gets or Sets SelectableEnvironmentAttributes + /// + + [DataMember(Name="selectableEnvironmentAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableEnvironmentAttributes { get; set; } + public Reference SelectableEnvironmentAttributes { get; set; } + + /// + /// Gets or Sets SelectablePermissions + /// + + [DataMember(Name="selectablePermissions")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectablePermissions { get; set; } + public Reference SelectablePermissions { get; set; } + + /// + /// Gets or Sets SelectableSubjectAttributes + /// + + [DataMember(Name="selectableSubjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableSubjectAttributes { get; set; } + public Reference SelectableSubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessControl {\n"); + sb.Append(" AccessPermissionRule: ").Append(AccessPermissionRule).Append("\n"); + sb.Append(" DefaultEnvironmentAttributes: ").Append(DefaultEnvironmentAttributes).Append("\n"); + sb.Append(" DefaultPermissions: ").Append(DefaultPermissions).Append("\n"); + sb.Append(" DefaultSubjectAttributes: ").Append(DefaultSubjectAttributes).Append("\n"); + sb.Append(" SelectableEnvironmentAttributes: ").Append(SelectableEnvironmentAttributes).Append("\n"); + sb.Append(" SelectablePermissions: ").Append(SelectablePermissions).Append("\n"); + sb.Append(" SelectableSubjectAttributes: ").Append(SelectableSubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessControl)obj); + } + + /// + /// Returns true if AccessControl instances are equal + /// + /// Instance of AccessControl to be compared + /// Boolean + public bool Equals(AccessControl other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AccessPermissionRule == other.AccessPermissionRule || + AccessPermissionRule != null && + AccessPermissionRule.SequenceEqual(other.AccessPermissionRule) + ) && + ( + DefaultEnvironmentAttributes == other.DefaultEnvironmentAttributes || + DefaultEnvironmentAttributes != null && + DefaultEnvironmentAttributes.Equals(other.DefaultEnvironmentAttributes) + ) && + ( + DefaultPermissions == other.DefaultPermissions || + DefaultPermissions != null && + DefaultPermissions.Equals(other.DefaultPermissions) + ) && + ( + DefaultSubjectAttributes == other.DefaultSubjectAttributes || + DefaultSubjectAttributes != null && + DefaultSubjectAttributes.Equals(other.DefaultSubjectAttributes) + ) && + ( + SelectableEnvironmentAttributes == other.SelectableEnvironmentAttributes || + SelectableEnvironmentAttributes != null && + SelectableEnvironmentAttributes.Equals(other.SelectableEnvironmentAttributes) + ) && + ( + SelectablePermissions == other.SelectablePermissions || + SelectablePermissions != null && + SelectablePermissions.Equals(other.SelectablePermissions) + ) && + ( + SelectableSubjectAttributes == other.SelectableSubjectAttributes || + SelectableSubjectAttributes != null && + SelectableSubjectAttributes.Equals(other.SelectableSubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AccessPermissionRule != null) + hashCode = hashCode * 59 + AccessPermissionRule.GetHashCode(); + if (DefaultEnvironmentAttributes != null) + hashCode = hashCode * 59 + DefaultEnvironmentAttributes.GetHashCode(); + if (DefaultPermissions != null) + hashCode = hashCode * 59 + DefaultPermissions.GetHashCode(); + if (DefaultSubjectAttributes != null) + hashCode = hashCode * 59 + DefaultSubjectAttributes.GetHashCode(); + if (SelectableEnvironmentAttributes != null) + hashCode = hashCode * 59 + SelectableEnvironmentAttributes.GetHashCode(); + if (SelectablePermissions != null) + hashCode = hashCode * 59 + SelectablePermissions.GetHashCode(); + if (SelectableSubjectAttributes != null) + hashCode = hashCode * 59 + SelectableSubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessControl left, AccessControl right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessControl left, AccessControl right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs new file mode 100644 index 000000000..292864002 --- /dev/null +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -0,0 +1,178 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessControlPolicyPoints : IEquatable + { + /// + /// Gets or Sets PolicyAdministrationPoint + /// + [Required] + + [DataMember(Name="policyAdministrationPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyAdministrationPoint PolicyAdministrationPoint { get; set; } + public PolicyAdministrationPoint PolicyAdministrationPoint { get; set; } + + /// + /// Gets or Sets PolicyDecisionPoint + /// + [Required] + + [DataMember(Name="policyDecisionPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyDecisionPoint PolicyDecisionPoint { get; set; } + public PolicyDecisionPoint PolicyDecisionPoint { get; set; } + + /// + /// Gets or Sets PolicyEnforcementPoint + /// + [Required] + + [DataMember(Name="policyEnforcementPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyEnforcementPoint + //PolicyEnforcementPoint { get; set; } + //https://app.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyInformationPoints + public PolicyEnforcementPoint PolicyEnforcementPoint { get; set; } + + /// + /// Gets or Sets PolicyInformationPoints + /// + + [DataMember(Name="policyInformationPoints")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyInformationPoints PolicyInformationPoints { get; set; } + public PolicyInformationPoints PolicyInformationPoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessControlPolicyPoints {\n"); + sb.Append(" PolicyAdministrationPoint: ").Append(PolicyAdministrationPoint).Append("\n"); + sb.Append(" PolicyDecisionPoint: ").Append(PolicyDecisionPoint).Append("\n"); + sb.Append(" PolicyEnforcementPoint: ").Append(PolicyEnforcementPoint).Append("\n"); + sb.Append(" PolicyInformationPoints: ").Append(PolicyInformationPoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessControlPolicyPoints)obj); + } + + /// + /// Returns true if AccessControlPolicyPoints instances are equal + /// + /// Instance of AccessControlPolicyPoints to be compared + /// Boolean + public bool Equals(AccessControlPolicyPoints other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + PolicyAdministrationPoint == other.PolicyAdministrationPoint || + PolicyAdministrationPoint != null && + PolicyAdministrationPoint.Equals(other.PolicyAdministrationPoint) + ) && + ( + PolicyDecisionPoint == other.PolicyDecisionPoint || + PolicyDecisionPoint != null && + PolicyDecisionPoint.Equals(other.PolicyDecisionPoint) + ) && + ( + PolicyEnforcementPoint == other.PolicyEnforcementPoint || + PolicyEnforcementPoint != null && + PolicyEnforcementPoint.Equals(other.PolicyEnforcementPoint) + ) && + ( + PolicyInformationPoints == other.PolicyInformationPoints || + PolicyInformationPoints != null && + PolicyInformationPoints.Equals(other.PolicyInformationPoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (PolicyAdministrationPoint != null) + hashCode = hashCode * 59 + PolicyAdministrationPoint.GetHashCode(); + if (PolicyDecisionPoint != null) + hashCode = hashCode * 59 + PolicyDecisionPoint.GetHashCode(); + if (PolicyEnforcementPoint != null) + hashCode = hashCode * 59 + PolicyEnforcementPoint.GetHashCode(); + if (PolicyInformationPoints != null) + hashCode = hashCode * 59 + PolicyInformationPoints.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessControlPolicyPoints left, AccessControlPolicyPoints right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessControlPolicyPoints left, AccessControlPolicyPoints right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs new file mode 100644 index 000000000..95a9b18a6 --- /dev/null +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessPermissionRule : Referable, IEquatable + { + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets PermissionsPerObject + /// + + [DataMember(Name="permissionsPerObject")] + public List PermissionsPerObject { get; set; } + + /// + /// Gets or Sets TargetSubjectAttributes + /// + [Required] + + [DataMember(Name="targetSubjectAttributes")] + public List TargetSubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessPermissionRule {\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" PermissionsPerObject: ").Append(PermissionsPerObject).Append("\n"); + sb.Append(" TargetSubjectAttributes: ").Append(TargetSubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessPermissionRule)obj); + } + + /// + /// Returns true if AccessPermissionRule instances are equal + /// + /// Instance of AccessPermissionRule to be compared + /// Boolean + public bool Equals(AccessPermissionRule other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + PermissionsPerObject == other.PermissionsPerObject || + PermissionsPerObject != null && + PermissionsPerObject.SequenceEqual(other.PermissionsPerObject) + ) && + ( + TargetSubjectAttributes == other.TargetSubjectAttributes || + TargetSubjectAttributes != null && + TargetSubjectAttributes.SequenceEqual(other.TargetSubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (PermissionsPerObject != null) + hashCode = hashCode * 59 + PermissionsPerObject.GetHashCode(); + if (TargetSubjectAttributes != null) + hashCode = hashCode * 59 + TargetSubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessPermissionRule left, AccessPermissionRule right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessPermissionRule left, AccessPermissionRule right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs new file mode 100644 index 000000000..c106e04bc --- /dev/null +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AdministrativeInformation : IEquatable + { + /// + /// Gets or Sets Revision + /// + + [DataMember(Name="revision")] + public string Revision { get; set; } + + /// + /// Gets or Sets Version + /// + + [DataMember(Name="version")] + public string Version { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdministrativeInformation {\n"); + sb.Append(" Revision: ").Append(Revision).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AdministrativeInformation)obj); + } + + /// + /// Returns true if AdministrativeInformation instances are equal + /// + /// Instance of AdministrativeInformation to be compared + /// Boolean + public bool Equals(AdministrativeInformation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Revision == other.Revision || + Revision != null && + Revision.Equals(other.Revision) + ) && + ( + Version == other.Version || + Version != null && + Version.Equals(other.Version) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Revision != null) + hashCode = hashCode * 59 + Revision.GetHashCode(); + if (Version != null) + hashCode = hashCode * 59 + Version.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AdministrativeInformation left, AdministrativeInformation right) + { + return Equals(left, right); + } + + public static bool operator !=(AdministrativeInformation left, AdministrativeInformation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs new file mode 100644 index 000000000..f3a9b5681 --- /dev/null +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AnnotatedRelationshipElement : RelationshipElement, IEquatable + { + /// + /// Gets or Sets Annotation + /// + + [DataMember(Name="annotation")] + public List Annotation { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnnotatedRelationshipElement {\n"); + sb.Append(" Annotation: ").Append(Annotation).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AnnotatedRelationshipElement)obj); + } + + /// + /// Returns true if AnnotatedRelationshipElement instances are equal + /// + /// Instance of AnnotatedRelationshipElement to be compared + /// Boolean + public bool Equals(AnnotatedRelationshipElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Annotation == other.Annotation || + Annotation != null && + Annotation.SequenceEqual(other.Annotation) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Annotation != null) + hashCode = hashCode * 59 + Annotation.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) + { + return Equals(left, right); + } + + public static bool operator !=(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs new file mode 100644 index 000000000..930317d36 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -0,0 +1,196 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetAdministrationShell : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets AssetInformation + /// + [Required] + + [DataMember(Name="assetInformation")] + public AssetInformation AssetInformation { get; set; } + + /// + /// Gets or Sets DerivedFrom + /// + + [DataMember(Name="derivedFrom")] + public Reference DerivedFrom { get; set; } + + /// + /// Gets or Sets Security + /// + + [DataMember(Name="security")] + public Security Security { get; set; } + + /// + /// Gets or Sets Submodels + /// + + [DataMember(Name="submodels")] + public List Submodels { get; set; } + + /// + /// Gets or Sets Views + /// + + [DataMember(Name="views")] + public List Views { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetAdministrationShell {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" AssetInformation: ").Append(AssetInformation).Append("\n"); + sb.Append(" DerivedFrom: ").Append(DerivedFrom).Append("\n"); + sb.Append(" Security: ").Append(Security).Append("\n"); + sb.Append(" Submodels: ").Append(Submodels).Append("\n"); + sb.Append(" Views: ").Append(Views).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetAdministrationShell)obj); + } + + /// + /// Returns true if AssetAdministrationShell instances are equal + /// + /// Instance of AssetAdministrationShell to be compared + /// Boolean + public bool Equals(AssetAdministrationShell other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + AssetInformation == other.AssetInformation || + AssetInformation != null && + AssetInformation.Equals(other.AssetInformation) + ) && + ( + DerivedFrom == other.DerivedFrom || + DerivedFrom != null && + DerivedFrom.Equals(other.DerivedFrom) + ) && + ( + Security == other.Security || + Security != null && + Security.Equals(other.Security) + ) && + ( + Submodels == other.Submodels || + Submodels != null && + Submodels.SequenceEqual(other.Submodels) + ) && + ( + Views == other.Views || + Views != null && + Views.SequenceEqual(other.Views) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (AssetInformation != null) + hashCode = hashCode * 59 + AssetInformation.GetHashCode(); + if (DerivedFrom != null) + hashCode = hashCode * 59 + DerivedFrom.GetHashCode(); + if (Security != null) + hashCode = hashCode * 59 + Security.GetHashCode(); + if (Submodels != null) + hashCode = hashCode * 59 + Submodels.GetHashCode(); + if (Views != null) + hashCode = hashCode * 59 + Views.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetAdministrationShell left, AssetAdministrationShell right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetAdministrationShell left, AssetAdministrationShell right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs new file mode 100644 index 000000000..3f1819c13 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -0,0 +1,150 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetAdministrationShellEnvironment : IEquatable + { + /// + /// Gets or Sets AssetAdministrationShells + /// + + [DataMember(Name="assetAdministrationShells")] + public List AssetAdministrationShells { get; set; } + + /// + /// Gets or Sets ConceptDescriptions + /// + + [DataMember(Name="conceptDescriptions")] + public List ConceptDescriptions { get; set; } + + /// + /// Gets or Sets Submodels + /// + + [DataMember(Name="submodels")] + public List Submodels { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetAdministrationShellEnvironment {\n"); + sb.Append(" AssetAdministrationShells: ").Append(AssetAdministrationShells).Append("\n"); + sb.Append(" ConceptDescriptions: ").Append(ConceptDescriptions).Append("\n"); + sb.Append(" Submodels: ").Append(Submodels).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetAdministrationShellEnvironment)obj); + } + + /// + /// Returns true if AssetAdministrationShellEnvironment instances are equal + /// + /// Instance of AssetAdministrationShellEnvironment to be compared + /// Boolean + public bool Equals(AssetAdministrationShellEnvironment other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AssetAdministrationShells == other.AssetAdministrationShells || + AssetAdministrationShells != null && + AssetAdministrationShells.SequenceEqual(other.AssetAdministrationShells) + ) && + ( + ConceptDescriptions == other.ConceptDescriptions || + ConceptDescriptions != null && + ConceptDescriptions.SequenceEqual(other.ConceptDescriptions) + ) && + ( + Submodels == other.Submodels || + Submodels != null && + Submodels.SequenceEqual(other.Submodels) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AssetAdministrationShells != null) + hashCode = hashCode * 59 + AssetAdministrationShells.GetHashCode(); + if (ConceptDescriptions != null) + hashCode = hashCode * 59 + ConceptDescriptions.GetHashCode(); + if (Submodels != null) + hashCode = hashCode * 59 + Submodels.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs new file mode 100644 index 000000000..8ab61ca3e --- /dev/null +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetInformation : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetInformation {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetInformation)obj); + } + + /// + /// Returns true if AssetInformation instances are equal + /// + /// Instance of AssetInformation to be compared + /// Boolean + public bool Equals(AssetInformation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetInformation left, AssetInformation right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetInformation left, AssetInformation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs new file mode 100644 index 000000000..e236f583e --- /dev/null +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets AssetKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AssetKind + { + /// + /// Enum TypeEnum for Type + /// + [EnumMember(Value = "Type")] + TypeEnum = 0, + /// + /// Enum InstanceEnum for Instance + /// + [EnumMember(Value = "Instance")] + InstanceEnum = 1 } +} diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs new file mode 100644 index 000000000..318151203 --- /dev/null +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BasicEvent : ModelEvent, IEquatable + { + /// + /// Gets or Sets Observed + /// + [Required] + + [DataMember(Name="observed")] + public Reference Observed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BasicEvent {\n"); + sb.Append(" Observed: ").Append(Observed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BasicEvent)obj); + } + + /// + /// Returns true if BasicEvent instances are equal + /// + /// Instance of BasicEvent to be compared + /// Boolean + public bool Equals(BasicEvent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Observed == other.Observed || + Observed != null && + Observed.Equals(other.Observed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Observed != null) + hashCode = hashCode * 59 + Observed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BasicEvent left, BasicEvent right) + { + return Equals(left, right); + } + + public static bool operator !=(BasicEvent left, BasicEvent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs new file mode 100644 index 000000000..100026f1b --- /dev/null +++ b/src/IO.Swagger/Models/Blob.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Blob : SubmodelElement, IEquatable + { + /// + /// Gets or Sets MimeType + /// + [Required] + + [DataMember(Name="mimeType")] + public string MimeType { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Blob {\n"); + sb.Append(" MimeType: ").Append(MimeType).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Blob)obj); + } + + /// + /// Returns true if Blob instances are equal + /// + /// Instance of Blob to be compared + /// Boolean + public bool Equals(Blob other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + MimeType == other.MimeType || + MimeType != null && + MimeType.Equals(other.MimeType) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (MimeType != null) + hashCode = hashCode * 59 + MimeType.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Blob left, Blob right) + { + return Equals(left, right); + } + + public static bool operator !=(Blob left, Blob right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs new file mode 100644 index 000000000..aa57ec7ff --- /dev/null +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BlobCertificate : IEquatable + { + /// + /// Gets or Sets _BlobCertificate + /// + + [DataMember(Name="blobCertificate")] + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasBlob _BlobCertificate { get; set; } + public Blob _BlobCertificate { get; set; } + + /// + /// Gets or Sets ContainedExtension + /// + + [DataMember(Name="containedExtension")] + public List ContainedExtension { get; set; } + + /// + /// Gets or Sets LastCertificate + /// + + [DataMember(Name="lastCertificate")] + public bool? LastCertificate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BlobCertificate {\n"); + sb.Append(" _BlobCertificate: ").Append(_BlobCertificate).Append("\n"); + sb.Append(" ContainedExtension: ").Append(ContainedExtension).Append("\n"); + sb.Append(" LastCertificate: ").Append(LastCertificate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BlobCertificate)obj); + } + + /// + /// Returns true if BlobCertificate instances are equal + /// + /// Instance of BlobCertificate to be compared + /// Boolean + public bool Equals(BlobCertificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _BlobCertificate == other._BlobCertificate || + _BlobCertificate != null && + _BlobCertificate.Equals(other._BlobCertificate) + ) && + ( + ContainedExtension == other.ContainedExtension || + ContainedExtension != null && + ContainedExtension.SequenceEqual(other.ContainedExtension) + ) && + ( + LastCertificate == other.LastCertificate || + LastCertificate != null && + LastCertificate.Equals(other.LastCertificate) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_BlobCertificate != null) + hashCode = hashCode * 59 + _BlobCertificate.GetHashCode(); + if (ContainedExtension != null) + hashCode = hashCode * 59 + ContainedExtension.GetHashCode(); + if (LastCertificate != null) + hashCode = hashCode * 59 + LastCertificate.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BlobCertificate left, BlobCertificate right) + { + return Equals(left, right); + } + + public static bool operator !=(BlobCertificate left, BlobCertificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs new file mode 100644 index 000000000..a52f19279 --- /dev/null +++ b/src/IO.Swagger/Models/Capability.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Capability : SubmodelElement, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capability {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Capability)obj); + } + + /// + /// Returns true if Capability instances are equal + /// + /// Instance of Capability to be compared + /// Boolean + public bool Equals(Capability other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Capability left, Capability right) + { + return Equals(left, right); + } + + public static bool operator !=(Capability left, Capability right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs new file mode 100644 index 000000000..ea6808243 --- /dev/null +++ b/src/IO.Swagger/Models/Certificate.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Certificate : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Certificate {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Certificate)obj); + } + + /// + /// Returns true if Certificate instances are equal + /// + /// Instance of Certificate to be compared + /// Boolean + public bool Equals(Certificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Certificate left, Certificate right) + { + return Equals(left, right); + } + + public static bool operator !=(Certificate left, Certificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs new file mode 100644 index 000000000..daee04c35 --- /dev/null +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ConceptDescription : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets IsCaseOf + /// + + [DataMember(Name="isCaseOf")] + public List IsCaseOf { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ConceptDescription {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" IsCaseOf: ").Append(IsCaseOf).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ConceptDescription)obj); + } + + /// + /// Returns true if ConceptDescription instances are equal + /// + /// Instance of ConceptDescription to be compared + /// Boolean + public bool Equals(ConceptDescription other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + IsCaseOf == other.IsCaseOf || + IsCaseOf != null && + IsCaseOf.SequenceEqual(other.IsCaseOf) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (IsCaseOf != null) + hashCode = hashCode * 59 + IsCaseOf.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ConceptDescription left, ConceptDescription right) + { + return Equals(left, right); + } + + public static bool operator !=(ConceptDescription left, ConceptDescription right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs new file mode 100644 index 000000000..ec4b27a12 --- /dev/null +++ b/src/IO.Swagger/Models/Constraint.cs @@ -0,0 +1,123 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Constraint : IEquatable + { + /// + /// Gets or Sets ModelType + /// + [Required] + + [DataMember(Name="modelType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelType ModelType { get; set; } + public ModelType ModelType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Constraint {\n"); + sb.Append(" ModelType: ").Append(ModelType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Constraint)obj); + } + + /// + /// Returns true if Constraint instances are equal + /// + /// Instance of Constraint to be compared + /// Boolean + public bool Equals(Constraint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ModelType == other.ModelType || + ModelType != null && + ModelType.Equals(other.ModelType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ModelType != null) + hashCode = hashCode * 59 + ModelType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Constraint left, Constraint right) + { + return Equals(left, right); + } + + public static bool operator !=(Constraint left, Constraint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs new file mode 100644 index 000000000..03e2b6ab0 --- /dev/null +++ b/src/IO.Swagger/Models/DataElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataElement)obj); + } + + /// + /// Returns true if DataElement instances are equal + /// + /// Instance of DataElement to be compared + /// Boolean + public bool Equals(DataElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataElement left, DataElement right) + { + return Equals(left, right); + } + + public static bool operator !=(DataElement left, DataElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs new file mode 100644 index 000000000..73470a843 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationContent : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationContent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationContent)obj); + } + + /// + /// Returns true if DataSpecificationContent instances are equal + /// + /// Instance of DataSpecificationContent to be compared + /// Boolean + public bool Equals(DataSpecificationContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationContent left, DataSpecificationContent right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationContent left, DataSpecificationContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs new file mode 100644 index 000000000..35597f732 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -0,0 +1,271 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable + { + /// + /// Gets or Sets DataType + /// + + [DataMember(Name="dataType")] + public string DataType { get; set; } + + /// + /// Gets or Sets Definition + /// + + [DataMember(Name="definition")] + public List Definition { get; set; } + + /// + /// Gets or Sets LevelType + /// + + [DataMember(Name="levelType")] + public List LevelType { get; set; } + + /// + /// Gets or Sets PreferredName + /// + [Required] + + [DataMember(Name="preferredName")] + public List PreferredName { get; set; } + + /// + /// Gets or Sets ShortName + /// + + [DataMember(Name="shortName")] + public List ShortName { get; set; } + + /// + /// Gets or Sets SourceOfDefinition + /// + + [DataMember(Name="sourceOfDefinition")] + public string SourceOfDefinition { get; set; } + + /// + /// Gets or Sets Symbol + /// + + [DataMember(Name="symbol")] + public string Symbol { get; set; } + + /// + /// Gets or Sets Unit + /// + + [DataMember(Name="unit")] + public string Unit { get; set; } + + /// + /// Gets or Sets UnitId + /// + + [DataMember(Name="unitId")] + public Reference UnitId { get; set; } + + /// + /// Gets or Sets ValueFormat + /// + + [DataMember(Name="valueFormat")] + public string ValueFormat { get; set; } + + /// + /// Gets or Sets ValueList + /// + + [DataMember(Name="valueList")] + public ValueList ValueList { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationIEC61360Content {\n"); + sb.Append(" DataType: ").Append(DataType).Append("\n"); + sb.Append(" Definition: ").Append(Definition).Append("\n"); + sb.Append(" LevelType: ").Append(LevelType).Append("\n"); + sb.Append(" PreferredName: ").Append(PreferredName).Append("\n"); + sb.Append(" ShortName: ").Append(ShortName).Append("\n"); + sb.Append(" SourceOfDefinition: ").Append(SourceOfDefinition).Append("\n"); + sb.Append(" Symbol: ").Append(Symbol).Append("\n"); + sb.Append(" Unit: ").Append(Unit).Append("\n"); + sb.Append(" UnitId: ").Append(UnitId).Append("\n"); + sb.Append(" ValueFormat: ").Append(ValueFormat).Append("\n"); + sb.Append(" ValueList: ").Append(ValueList).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationIEC61360Content)obj); + } + + /// + /// Returns true if DataSpecificationIEC61360Content instances are equal + /// + /// Instance of DataSpecificationIEC61360Content to be compared + /// Boolean + public bool Equals(DataSpecificationIEC61360Content other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + DataType == other.DataType || + DataType != null && + DataType.Equals(other.DataType) + ) && + ( + Definition == other.Definition || + Definition != null && + Definition.SequenceEqual(other.Definition) + ) && + ( + LevelType == other.LevelType || + LevelType != null && + LevelType.SequenceEqual(other.LevelType) + ) && + ( + PreferredName == other.PreferredName || + PreferredName != null && + PreferredName.SequenceEqual(other.PreferredName) + ) && + ( + ShortName == other.ShortName || + ShortName != null && + ShortName.SequenceEqual(other.ShortName) + ) && + ( + SourceOfDefinition == other.SourceOfDefinition || + SourceOfDefinition != null && + SourceOfDefinition.Equals(other.SourceOfDefinition) + ) && + ( + Symbol == other.Symbol || + Symbol != null && + Symbol.Equals(other.Symbol) + ) && + ( + Unit == other.Unit || + Unit != null && + Unit.Equals(other.Unit) + ) && + ( + UnitId == other.UnitId || + UnitId != null && + UnitId.Equals(other.UnitId) + ) && + ( + ValueFormat == other.ValueFormat || + ValueFormat != null && + ValueFormat.Equals(other.ValueFormat) + ) && + ( + ValueList == other.ValueList || + ValueList != null && + ValueList.Equals(other.ValueList) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (DataType != null) + hashCode = hashCode * 59 + DataType.GetHashCode(); + if (Definition != null) + hashCode = hashCode * 59 + Definition.GetHashCode(); + if (LevelType != null) + hashCode = hashCode * 59 + LevelType.GetHashCode(); + if (PreferredName != null) + hashCode = hashCode * 59 + PreferredName.GetHashCode(); + if (ShortName != null) + hashCode = hashCode * 59 + ShortName.GetHashCode(); + if (SourceOfDefinition != null) + hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); + if (Symbol != null) + hashCode = hashCode * 59 + Symbol.GetHashCode(); + if (Unit != null) + hashCode = hashCode * 59 + Unit.GetHashCode(); + if (UnitId != null) + hashCode = hashCode * 59 + UnitId.GetHashCode(); + if (ValueFormat != null) + hashCode = hashCode * 59 + ValueFormat.GetHashCode(); + if (ValueList != null) + hashCode = hashCode * 59 + ValueList.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs new file mode 100644 index 000000000..f72ad4d3b --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -0,0 +1,303 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationPhysicalUnitContent : IEquatable + { + /// + /// Gets or Sets ConversionFactor + /// + + [DataMember(Name="conversionFactor")] + public string ConversionFactor { get; set; } + + /// + /// Gets or Sets Definition + /// + [Required] + + [DataMember(Name="definition")] + public List Definition { get; set; } + + /// + /// Gets or Sets DinNotation + /// + + [DataMember(Name="dinNotation")] + public string DinNotation { get; set; } + + /// + /// Gets or Sets EceCode + /// + + [DataMember(Name="eceCode")] + public string EceCode { get; set; } + + /// + /// Gets or Sets EceName + /// + + [DataMember(Name="eceName")] + public string EceName { get; set; } + + /// + /// Gets or Sets NistName + /// + + [DataMember(Name="nistName")] + public string NistName { get; set; } + + /// + /// Gets or Sets RegistrationAuthorityId + /// + + [DataMember(Name="registrationAuthorityId")] + public string RegistrationAuthorityId { get; set; } + + /// + /// Gets or Sets SiName + /// + + [DataMember(Name="siName")] + public string SiName { get; set; } + + /// + /// Gets or Sets SiNotation + /// + + [DataMember(Name="siNotation")] + public string SiNotation { get; set; } + + /// + /// Gets or Sets SourceOfDefinition + /// + + [DataMember(Name="sourceOfDefinition")] + public string SourceOfDefinition { get; set; } + + /// + /// Gets or Sets Supplier + /// + + [DataMember(Name="supplier")] + public string Supplier { get; set; } + + /// + /// Gets or Sets UnitName + /// + [Required] + + [DataMember(Name="unitName")] + public string UnitName { get; set; } + + /// + /// Gets or Sets UnitSymbol + /// + [Required] + + [DataMember(Name="unitSymbol")] + public string UnitSymbol { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationPhysicalUnitContent {\n"); + sb.Append(" ConversionFactor: ").Append(ConversionFactor).Append("\n"); + sb.Append(" Definition: ").Append(Definition).Append("\n"); + sb.Append(" DinNotation: ").Append(DinNotation).Append("\n"); + sb.Append(" EceCode: ").Append(EceCode).Append("\n"); + sb.Append(" EceName: ").Append(EceName).Append("\n"); + sb.Append(" NistName: ").Append(NistName).Append("\n"); + sb.Append(" RegistrationAuthorityId: ").Append(RegistrationAuthorityId).Append("\n"); + sb.Append(" SiName: ").Append(SiName).Append("\n"); + sb.Append(" SiNotation: ").Append(SiNotation).Append("\n"); + sb.Append(" SourceOfDefinition: ").Append(SourceOfDefinition).Append("\n"); + sb.Append(" Supplier: ").Append(Supplier).Append("\n"); + sb.Append(" UnitName: ").Append(UnitName).Append("\n"); + sb.Append(" UnitSymbol: ").Append(UnitSymbol).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationPhysicalUnitContent)obj); + } + + /// + /// Returns true if DataSpecificationPhysicalUnitContent instances are equal + /// + /// Instance of DataSpecificationPhysicalUnitContent to be compared + /// Boolean + public bool Equals(DataSpecificationPhysicalUnitContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ConversionFactor == other.ConversionFactor || + ConversionFactor != null && + ConversionFactor.Equals(other.ConversionFactor) + ) && + ( + Definition == other.Definition || + Definition != null && + Definition.SequenceEqual(other.Definition) + ) && + ( + DinNotation == other.DinNotation || + DinNotation != null && + DinNotation.Equals(other.DinNotation) + ) && + ( + EceCode == other.EceCode || + EceCode != null && + EceCode.Equals(other.EceCode) + ) && + ( + EceName == other.EceName || + EceName != null && + EceName.Equals(other.EceName) + ) && + ( + NistName == other.NistName || + NistName != null && + NistName.Equals(other.NistName) + ) && + ( + RegistrationAuthorityId == other.RegistrationAuthorityId || + RegistrationAuthorityId != null && + RegistrationAuthorityId.Equals(other.RegistrationAuthorityId) + ) && + ( + SiName == other.SiName || + SiName != null && + SiName.Equals(other.SiName) + ) && + ( + SiNotation == other.SiNotation || + SiNotation != null && + SiNotation.Equals(other.SiNotation) + ) && + ( + SourceOfDefinition == other.SourceOfDefinition || + SourceOfDefinition != null && + SourceOfDefinition.Equals(other.SourceOfDefinition) + ) && + ( + Supplier == other.Supplier || + Supplier != null && + Supplier.Equals(other.Supplier) + ) && + ( + UnitName == other.UnitName || + UnitName != null && + UnitName.Equals(other.UnitName) + ) && + ( + UnitSymbol == other.UnitSymbol || + UnitSymbol != null && + UnitSymbol.Equals(other.UnitSymbol) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ConversionFactor != null) + hashCode = hashCode * 59 + ConversionFactor.GetHashCode(); + if (Definition != null) + hashCode = hashCode * 59 + Definition.GetHashCode(); + if (DinNotation != null) + hashCode = hashCode * 59 + DinNotation.GetHashCode(); + if (EceCode != null) + hashCode = hashCode * 59 + EceCode.GetHashCode(); + if (EceName != null) + hashCode = hashCode * 59 + EceName.GetHashCode(); + if (NistName != null) + hashCode = hashCode * 59 + NistName.GetHashCode(); + if (RegistrationAuthorityId != null) + hashCode = hashCode * 59 + RegistrationAuthorityId.GetHashCode(); + if (SiName != null) + hashCode = hashCode * 59 + SiName.GetHashCode(); + if (SiNotation != null) + hashCode = hashCode * 59 + SiNotation.GetHashCode(); + if (SourceOfDefinition != null) + hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); + if (Supplier != null) + hashCode = hashCode * 59 + Supplier.GetHashCode(); + if (UnitName != null) + hashCode = hashCode * 59 + UnitName.GetHashCode(); + if (UnitSymbol != null) + hashCode = hashCode * 59 + UnitSymbol.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs new file mode 100644 index 000000000..c21e05e0f --- /dev/null +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -0,0 +1,141 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class EmbeddedDataSpecification : IEquatable + { + /// + /// Gets or Sets DataSpecification + /// + [Required] + + [DataMember(Name="dataSpecification")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DataSpecification { get; set; } + public Reference DataSpecification { get; set; } + + /// + /// Gets or Sets DataSpecificationContent + /// + [Required] + + [DataMember(Name="dataSpecificationContent")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasDataSpecificationContent DataSpecificationContent { get; set; } + public DataSpecificationContent DataSpecificationContent { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EmbeddedDataSpecification {\n"); + sb.Append(" DataSpecification: ").Append(DataSpecification).Append("\n"); + sb.Append(" DataSpecificationContent: ").Append(DataSpecificationContent).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((EmbeddedDataSpecification)obj); + } + + /// + /// Returns true if EmbeddedDataSpecification instances are equal + /// + /// Instance of EmbeddedDataSpecification to be compared + /// Boolean + public bool Equals(EmbeddedDataSpecification other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + DataSpecification == other.DataSpecification || + DataSpecification != null && + DataSpecification.Equals(other.DataSpecification) + ) && + ( + DataSpecificationContent == other.DataSpecificationContent || + DataSpecificationContent != null && + DataSpecificationContent.Equals(other.DataSpecificationContent) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (DataSpecification != null) + hashCode = hashCode * 59 + DataSpecification.GetHashCode(); + if (DataSpecificationContent != null) + hashCode = hashCode * 59 + DataSpecificationContent.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(EmbeddedDataSpecification left, EmbeddedDataSpecification right) + { + return Equals(left, right); + } + + public static bool operator !=(EmbeddedDataSpecification left, EmbeddedDataSpecification right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs new file mode 100644 index 000000000..49a3d9a09 --- /dev/null +++ b/src/IO.Swagger/Models/Entity.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Entity : SubmodelElement, IEquatable + { + /// + /// Gets or Sets EntityType + /// + [Required] + + [DataMember(Name="entityType")] + public EntityType EntityType { get; set; } + + /// + /// Gets or Sets GlobalAssetId + /// + + [DataMember(Name="globalAssetId")] + public Reference GlobalAssetId { get; set; } + + /// + /// Gets or Sets SpecificAssetIds + /// + + [DataMember(Name="specificAssetIds")] + public List SpecificAssetIds { get; set; } + + /// + /// Gets or Sets Statements + /// + + [DataMember(Name="statements")] + public List Statements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Entity {\n"); + sb.Append(" EntityType: ").Append(EntityType).Append("\n"); + sb.Append(" GlobalAssetId: ").Append(GlobalAssetId).Append("\n"); + sb.Append(" SpecificAssetIds: ").Append(SpecificAssetIds).Append("\n"); + sb.Append(" Statements: ").Append(Statements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Entity)obj); + } + + /// + /// Returns true if Entity instances are equal + /// + /// Instance of Entity to be compared + /// Boolean + public bool Equals(Entity other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EntityType == other.EntityType || + EntityType != null && + EntityType.Equals(other.EntityType) + ) && + ( + GlobalAssetId == other.GlobalAssetId || + GlobalAssetId != null && + GlobalAssetId.Equals(other.GlobalAssetId) + ) && + ( + SpecificAssetIds == other.SpecificAssetIds || + SpecificAssetIds != null && + SpecificAssetIds.SequenceEqual(other.SpecificAssetIds) + ) && + ( + Statements == other.Statements || + Statements != null && + Statements.SequenceEqual(other.Statements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EntityType != null) + hashCode = hashCode * 59 + EntityType.GetHashCode(); + if (GlobalAssetId != null) + hashCode = hashCode * 59 + GlobalAssetId.GetHashCode(); + if (SpecificAssetIds != null) + hashCode = hashCode * 59 + SpecificAssetIds.GetHashCode(); + if (Statements != null) + hashCode = hashCode * 59 + Statements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Entity left, Entity right) + { + return Equals(left, right); + } + + public static bool operator !=(Entity left, Entity right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs new file mode 100644 index 000000000..569dcd10d --- /dev/null +++ b/src/IO.Swagger/Models/EntityType.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets EntityType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum EntityType + { + /// + /// Enum CoManagedEntityEnum for CoManagedEntity + /// + [EnumMember(Value = "CoManagedEntity")] + CoManagedEntityEnum = 0, + /// + /// Enum SelfManagedEntityEnum for SelfManagedEntity + /// + [EnumMember(Value = "SelfManagedEntity")] + SelfManagedEntityEnum = 1 } +} diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs new file mode 100644 index 000000000..48d5cad95 --- /dev/null +++ b/src/IO.Swagger/Models/Extension.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Extension : HasSemantics, IEquatable + { + /// + /// Gets or Sets Name + /// + [Required] + + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets RefersTo + /// + + [DataMember(Name="refersTo")] + public Reference RefersTo { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Extension {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" RefersTo: ").Append(RefersTo).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Extension)obj); + } + + /// + /// Returns true if Extension instances are equal + /// + /// Instance of Extension to be compared + /// Boolean + public bool Equals(Extension other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + RefersTo == other.RefersTo || + RefersTo != null && + RefersTo.Equals(other.RefersTo) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (RefersTo != null) + hashCode = hashCode * 59 + RefersTo.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Extension left, Extension right) + { + return Equals(left, right); + } + + public static bool operator !=(Extension left, Extension right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs new file mode 100644 index 000000000..330434ae0 --- /dev/null +++ b/src/IO.Swagger/Models/File.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class File : SubmodelElement, IEquatable + { + /// + /// Gets or Sets MimeType + /// + [Required] + + [DataMember(Name="mimeType")] + public string MimeType { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" MimeType: ").Append(MimeType).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((File)obj); + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + MimeType == other.MimeType || + MimeType != null && + MimeType.Equals(other.MimeType) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (MimeType != null) + hashCode = hashCode * 59 + MimeType.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(File left, File right) + { + return Equals(left, right); + } + + public static bool operator !=(File left, File right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs new file mode 100644 index 000000000..1214dc664 --- /dev/null +++ b/src/IO.Swagger/Models/Formula.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Formula : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Formula {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Formula)obj); + } + + /// + /// Returns true if Formula instances are equal + /// + /// Instance of Formula to be compared + /// Boolean + public bool Equals(Formula other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Formula left, Formula right) + { + return Equals(left, right); + } + + public static bool operator !=(Formula left, Formula right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs new file mode 100644 index 000000000..1b3123530 --- /dev/null +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class GlobalReference : Reference, IEquatable + { + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GlobalReference {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((GlobalReference)obj); + } + + /// + /// Returns true if GlobalReference instances are equal + /// + /// Instance of GlobalReference to be compared + /// Boolean + public bool Equals(GlobalReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(GlobalReference left, GlobalReference right) + { + return Equals(left, right); + } + + public static bool operator !=(GlobalReference left, GlobalReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs new file mode 100644 index 000000000..e901e1f31 --- /dev/null +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasDataSpecification : IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasDataSpecification {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasDataSpecification)obj); + } + + /// + /// Returns true if HasDataSpecification instances are equal + /// + /// Instance of HasDataSpecification to be compared + /// Boolean + public bool Equals(HasDataSpecification other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasDataSpecification left, HasDataSpecification right) + { + return Equals(left, right); + } + + public static bool operator !=(HasDataSpecification left, HasDataSpecification right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs new file mode 100644 index 000000000..3f0120412 --- /dev/null +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasExtensions : IEquatable + { + /// + /// Gets or Sets Extensions + /// + + [DataMember(Name="extensions")] + public List Extensions { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasExtensions {\n"); + sb.Append(" Extensions: ").Append(Extensions).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasExtensions)obj); + } + + /// + /// Returns true if HasExtensions instances are equal + /// + /// Instance of HasExtensions to be compared + /// Boolean + public bool Equals(HasExtensions other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Extensions == other.Extensions || + Extensions != null && + Extensions.SequenceEqual(other.Extensions) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Extensions != null) + hashCode = hashCode * 59 + Extensions.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasExtensions left, HasExtensions right) + { + return Equals(left, right); + } + + public static bool operator !=(HasExtensions left, HasExtensions right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs new file mode 100644 index 000000000..bfc6dbf15 --- /dev/null +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -0,0 +1,122 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasSemantics : IEquatable + { + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasSemantics {\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasSemantics)obj); + } + + /// + /// Returns true if HasSemantics instances are equal + /// + /// Instance of HasSemantics to be compared + /// Boolean + public bool Equals(HasSemantics other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasSemantics left, HasSemantics right) + { + return Equals(left, right); + } + + public static bool operator !=(HasSemantics left, HasSemantics right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs new file mode 100644 index 000000000..486255b3f --- /dev/null +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Identifiable : Referable, IEquatable + { + /// + /// Gets or Sets Administration + /// + + [DataMember(Name="administration")] + public AdministrativeInformation Administration { get; set; } + + /// + /// Gets or Sets Identification + /// + [Required] + + [DataMember(Name="identification")] + public string Identification { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Identifiable {\n"); + sb.Append(" Administration: ").Append(Administration).Append("\n"); + sb.Append(" Identification: ").Append(Identification).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Identifiable)obj); + } + + /// + /// Returns true if Identifiable instances are equal + /// + /// Instance of Identifiable to be compared + /// Boolean + public bool Equals(Identifiable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Administration == other.Administration || + Administration != null && + Administration.Equals(other.Administration) + ) && + ( + Identification == other.Identification || + Identification != null && + Identification.Equals(other.Identification) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Administration != null) + hashCode = hashCode * 59 + Administration.GetHashCode(); + if (Identification != null) + hashCode = hashCode * 59 + Identification.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Identifiable left, Identifiable right) + { + return Equals(left, right); + } + + public static bool operator !=(Identifiable left, Identifiable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs new file mode 100644 index 000000000..e71676d8b --- /dev/null +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -0,0 +1,153 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class IdentifierKeyValuePair : HasSemantics, IEquatable + { + /// + /// Gets or Sets Key + /// + [Required] + + [DataMember(Name="key")] + public string Key { get; set; } + + /// + /// Gets or Sets SubjectId + /// + [Required] + + [DataMember(Name="subjectId")] + public Reference SubjectId { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IdentifierKeyValuePair {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" SubjectId: ").Append(SubjectId).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IdentifierKeyValuePair)obj); + } + + /// + /// Returns true if IdentifierKeyValuePair instances are equal + /// + /// Instance of IdentifierKeyValuePair to be compared + /// Boolean + public bool Equals(IdentifierKeyValuePair other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Key == other.Key || + Key != null && + Key.Equals(other.Key) + ) && + ( + SubjectId == other.SubjectId || + SubjectId != null && + SubjectId.Equals(other.SubjectId) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Key != null) + hashCode = hashCode * 59 + Key.GetHashCode(); + if (SubjectId != null) + hashCode = hashCode * 59 + SubjectId.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + { + return Equals(left, right); + } + + public static bool operator !=(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs new file mode 100644 index 000000000..eeed899eb --- /dev/null +++ b/src/IO.Swagger/Models/Key.cs @@ -0,0 +1,139 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Key : IEquatable + { + /// + /// Gets or Sets Type + /// + [Required] + + [DataMember(Name="type")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasKeyElements Type { get; set; } + public KeyElements Type { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Key {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Key)obj); + } + + /// + /// Returns true if Key instances are equal + /// + /// Instance of Key to be compared + /// Boolean + public bool Equals(Key other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Key left, Key right) + { + return Equals(left, right); + } + + public static bool operator !=(Key left, Key right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs new file mode 100644 index 000000000..ab4fe4203 --- /dev/null +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -0,0 +1,144 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets KeyElements + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KeyElements + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum AccessPermissionRuleEnum for AccessPermissionRule + /// + [EnumMember(Value = "AccessPermissionRule")] + AccessPermissionRuleEnum = 1, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 2, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 3, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 4, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 5, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 6, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 7, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 8, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 9, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 10, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 22 } +} diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs new file mode 100644 index 000000000..88d7f5203 --- /dev/null +++ b/src/IO.Swagger/Models/LangString.cs @@ -0,0 +1,137 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class LangString : IEquatable + { + /// + /// Gets or Sets Language + /// + [Required] + + [DataMember(Name="language")] + public string Language { get; set; } + + /// + /// Gets or Sets Text + /// + [Required] + + [DataMember(Name="text")] + public string Text { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class LangString {\n"); + sb.Append(" Language: ").Append(Language).Append("\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((LangString)obj); + } + + /// + /// Returns true if LangString instances are equal + /// + /// Instance of LangString to be compared + /// Boolean + public bool Equals(LangString other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Language == other.Language || + Language != null && + Language.Equals(other.Language) + ) && + ( + Text == other.Text || + Text != null && + Text.Equals(other.Text) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Language != null) + hashCode = hashCode * 59 + Language.GetHashCode(); + if (Text != null) + hashCode = hashCode * 59 + Text.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(LangString left, LangString right) + { + return Equals(left, right); + } + + public static bool operator !=(LangString left, LangString right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs new file mode 100644 index 000000000..a638d02b6 --- /dev/null +++ b/src/IO.Swagger/Models/LevelType.cs @@ -0,0 +1,49 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets LevelType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum LevelType + { + /// + /// Enum MinEnum for Min + /// + [EnumMember(Value = "Min")] + MinEnum = 0, + /// + /// Enum MaxEnum for Max + /// + [EnumMember(Value = "Max")] + MaxEnum = 1, + /// + /// Enum NomEnum for Nom + /// + [EnumMember(Value = "Nom")] + NomEnum = 2, + /// + /// Enum TypEnum for Typ + /// + [EnumMember(Value = "Typ")] + TypEnum = 3 } +} diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs new file mode 100644 index 000000000..b83d19d4c --- /dev/null +++ b/src/IO.Swagger/Models/Message.cs @@ -0,0 +1,197 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Message : IEquatable + { + /// + /// Gets or Sets Code + /// + + [DataMember(Name="code")] + public string Code { get; set; } + + /// + /// Gets or Sets MessageType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum MessageTypeEnum + { + /// + /// Enum UndefinedEnum for Undefined + /// + [EnumMember(Value = "Undefined")] + UndefinedEnum = 0, + /// + /// Enum InfoEnum for Info + /// + [EnumMember(Value = "Info")] + InfoEnum = 1, + /// + /// Enum WarningEnum for Warning + /// + [EnumMember(Value = "Warning")] + WarningEnum = 2, + /// + /// Enum ErrorEnum for Error + /// + [EnumMember(Value = "Error")] + ErrorEnum = 3, + /// + /// Enum ExceptionEnum for Exception + /// + [EnumMember(Value = "Exception")] + ExceptionEnum = 4 } + + /// + /// Gets or Sets MessageType + /// + + [DataMember(Name="messageType")] + public MessageTypeEnum? MessageType { get; set; } + + /// + /// Gets or Sets Text + /// + + [DataMember(Name="text")] + public string Text { get; set; } + + /// + /// Gets or Sets Timestamp + /// + + [DataMember(Name="timestamp")] + public string Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Message {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" MessageType: ").Append(MessageType).Append("\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Message)obj); + } + + /// + /// Returns true if Message instances are equal + /// + /// Instance of Message to be compared + /// Boolean + public bool Equals(Message other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + Code != null && + Code.Equals(other.Code) + ) && + ( + MessageType == other.MessageType || + MessageType != null && + MessageType.Equals(other.MessageType) + ) && + ( + Text == other.Text || + Text != null && + Text.Equals(other.Text) + ) && + ( + Timestamp == other.Timestamp || + Timestamp != null && + Timestamp.Equals(other.Timestamp) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Code != null) + hashCode = hashCode * 59 + Code.GetHashCode(); + if (MessageType != null) + hashCode = hashCode * 59 + MessageType.GetHashCode(); + if (Text != null) + hashCode = hashCode * 59 + Text.GetHashCode(); + if (Timestamp != null) + hashCode = hashCode * 59 + Timestamp.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Message left, Message right) + { + return Equals(left, right); + } + + public static bool operator !=(Message left, Message right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs new file mode 100644 index 000000000..49065b6ef --- /dev/null +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelEvent : SubmodelElement, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelEvent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelEvent)obj); + } + + /// + /// Returns true if ModelEvent instances are equal + /// + /// Instance of ModelEvent to be compared + /// Boolean + public bool Equals(ModelEvent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelEvent left, ModelEvent right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelEvent left, ModelEvent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs new file mode 100644 index 000000000..a297f5f82 --- /dev/null +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -0,0 +1,138 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelReference : Reference, IEquatable + { + /// + /// Gets or Sets ReferredSemanticId + /// + + [DataMember(Name="referredSemanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ReferredSemanticId { get; set; } + public Reference ReferredSemanticId { get; set; } + + /// + /// Gets or Sets Keys + /// + [Required] + + [DataMember(Name="keys")] + public List Keys { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelReference {\n"); + sb.Append(" ReferredSemanticId: ").Append(ReferredSemanticId).Append("\n"); + sb.Append(" Keys: ").Append(Keys).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelReference)obj); + } + + /// + /// Returns true if ModelReference instances are equal + /// + /// Instance of ModelReference to be compared + /// Boolean + public bool Equals(ModelReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ReferredSemanticId == other.ReferredSemanticId || + ReferredSemanticId != null && + ReferredSemanticId.Equals(other.ReferredSemanticId) + ) && + ( + Keys == other.Keys || + Keys != null && + Keys.SequenceEqual(other.Keys) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ReferredSemanticId != null) + hashCode = hashCode * 59 + ReferredSemanticId.GetHashCode(); + if (Keys != null) + hashCode = hashCode * 59 + Keys.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelReference left, ModelReference right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelReference left, ModelReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs new file mode 100644 index 000000000..b75e6b0f8 --- /dev/null +++ b/src/IO.Swagger/Models/ModelType.cs @@ -0,0 +1,123 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelType : IEquatable + { + /// + /// Gets or Sets Name + /// + [Required] + + [DataMember(Name="name")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelTypes Name { get; set; } + public ModelTypes Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelType {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelType)obj); + } + + /// + /// Returns true if ModelType instances are equal + /// + /// Instance of ModelType to be compared + /// Boolean + public bool Equals(ModelType other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelType left, ModelType right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelType left, ModelType right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs new file mode 100644 index 000000000..2a7d418c9 --- /dev/null +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -0,0 +1,164 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ModelTypes + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelTypes + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 1, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 2, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 3, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 4, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 5, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 6, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 7, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 8, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 9, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 10, + /// + /// Enum ModelReferenceEnum for ModelReference + /// + [EnumMember(Value = "ModelReference")] + ModelReferenceEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum GlobalReferenceEnum for GlobalReference + /// + [EnumMember(Value = "GlobalReference")] + GlobalReferenceEnum = 22, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 23, + /// + /// Enum ConstraintEnum for Constraint + /// + [EnumMember(Value = "Constraint")] + ConstraintEnum = 24, + /// + /// Enum FormulaEnum for Formula + /// + [EnumMember(Value = "Formula")] + FormulaEnum = 25, + /// + /// Enum QualifierEnum for Qualifier + /// + [EnumMember(Value = "Qualifier")] + QualifierEnum = 26 } +} diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs new file mode 100644 index 000000000..3aaf4f82e --- /dev/null +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ModelingKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelingKind + { + /// + /// Enum TemplateEnum for Template + /// + [EnumMember(Value = "Template")] + TemplateEnum = 0, + /// + /// Enum InstanceEnum for Instance + /// + [EnumMember(Value = "Instance")] + InstanceEnum = 1 } +} diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs new file mode 100644 index 000000000..952db25c5 --- /dev/null +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class MultiLanguageProperty : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + public Reference ValueId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MultiLanguageProperty {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((MultiLanguageProperty)obj); + } + + /// + /// Returns true if MultiLanguageProperty instances are equal + /// + /// Instance of MultiLanguageProperty to be compared + /// Boolean + public bool Equals(MultiLanguageProperty other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(MultiLanguageProperty left, MultiLanguageProperty right) + { + return Equals(left, right); + } + + public static bool operator !=(MultiLanguageProperty left, MultiLanguageProperty right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs new file mode 100644 index 000000000..66fb952f5 --- /dev/null +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ObjectAttributes : IEquatable + { + /// + /// Gets or Sets ObjectAttribute + /// + + [DataMember(Name="objectAttribute")] + public List ObjectAttribute { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ObjectAttributes {\n"); + sb.Append(" ObjectAttribute: ").Append(ObjectAttribute).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ObjectAttributes)obj); + } + + /// + /// Returns true if ObjectAttributes instances are equal + /// + /// Instance of ObjectAttributes to be compared + /// Boolean + public bool Equals(ObjectAttributes other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ObjectAttribute == other.ObjectAttribute || + ObjectAttribute != null && + ObjectAttribute.SequenceEqual(other.ObjectAttribute) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ObjectAttribute != null) + hashCode = hashCode * 59 + ObjectAttribute.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ObjectAttributes left, ObjectAttributes right) + { + return Equals(left, right); + } + + public static bool operator !=(ObjectAttributes left, ObjectAttributes right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs new file mode 100644 index 000000000..1f33b2292 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfCertificate : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfCertificate {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfCertificate)obj); + } + + /// + /// Returns true if OneOfCertificate instances are equal + /// + /// Instance of OneOfCertificate to be compared + /// Boolean + public bool Equals(OneOfCertificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfCertificate left, OneOfCertificate right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfCertificate left, OneOfCertificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs new file mode 100644 index 000000000..a26901a55 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfConstraint : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfConstraint {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfConstraint)obj); + } + + /// + /// Returns true if OneOfConstraint instances are equal + /// + /// Instance of OneOfConstraint to be compared + /// Boolean + public bool Equals(OneOfConstraint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfConstraint left, OneOfConstraint right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfConstraint left, OneOfConstraint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs new file mode 100644 index 000000000..f898be81d --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfDataElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfDataElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfDataElement)obj); + } + + /// + /// Returns true if OneOfDataElement instances are equal + /// + /// Instance of OneOfDataElement to be compared + /// Boolean + public bool Equals(OneOfDataElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfDataElement left, OneOfDataElement right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfDataElement left, OneOfDataElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs new file mode 100644 index 000000000..a7081005a --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfDataSpecificationContent : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfDataSpecificationContent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfDataSpecificationContent)obj); + } + + /// + /// Returns true if OneOfDataSpecificationContent instances are equal + /// + /// Instance of OneOfDataSpecificationContent to be compared + /// Boolean + public bool Equals(OneOfDataSpecificationContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs new file mode 100644 index 000000000..10cded410 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfOperationVariableValue : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfOperationVariableValue {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfOperationVariableValue)obj); + } + + /// + /// Returns true if OneOfOperationVariableValue instances are equal + /// + /// Instance of OneOfOperationVariableValue to be compared + /// Boolean + public bool Equals(OneOfOperationVariableValue other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfOperationVariableValue left, OneOfOperationVariableValue right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfOperationVariableValue left, OneOfOperationVariableValue right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs new file mode 100644 index 000000000..f92a58231 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfReference : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfReference {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfReference)obj); + } + + /// + /// Returns true if OneOfReference instances are equal + /// + /// Instance of OneOfReference to be compared + /// Boolean + public bool Equals(OneOfReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfReference left, OneOfReference right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfReference left, OneOfReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs new file mode 100644 index 000000000..b3c6d1148 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfSubmodelElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfSubmodelElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfSubmodelElement)obj); + } + + /// + /// Returns true if OneOfSubmodelElement instances are equal + /// + /// Instance of OneOfSubmodelElement to be compared + /// Boolean + public bool Equals(OneOfSubmodelElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfSubmodelElement left, OneOfSubmodelElement right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfSubmodelElement left, OneOfSubmodelElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs new file mode 100644 index 000000000..78b7bd9ce --- /dev/null +++ b/src/IO.Swagger/Models/Operation.cs @@ -0,0 +1,150 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Operation : SubmodelElement, IEquatable + { + /// + /// Gets or Sets InoutputVariable + /// + + [DataMember(Name="inoutputVariable")] + public List InoutputVariable { get; set; } + + /// + /// Gets or Sets InputVariable + /// + + [DataMember(Name="inputVariable")] + public List InputVariable { get; set; } + + /// + /// Gets or Sets OutputVariable + /// + + [DataMember(Name="outputVariable")] + public List OutputVariable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Operation {\n"); + sb.Append(" InoutputVariable: ").Append(InoutputVariable).Append("\n"); + sb.Append(" InputVariable: ").Append(InputVariable).Append("\n"); + sb.Append(" OutputVariable: ").Append(OutputVariable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Operation)obj); + } + + /// + /// Returns true if Operation instances are equal + /// + /// Instance of Operation to be compared + /// Boolean + public bool Equals(Operation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + InoutputVariable == other.InoutputVariable || + InoutputVariable != null && + InoutputVariable.SequenceEqual(other.InoutputVariable) + ) && + ( + InputVariable == other.InputVariable || + InputVariable != null && + InputVariable.SequenceEqual(other.InputVariable) + ) && + ( + OutputVariable == other.OutputVariable || + OutputVariable != null && + OutputVariable.SequenceEqual(other.OutputVariable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (InoutputVariable != null) + hashCode = hashCode * 59 + InoutputVariable.GetHashCode(); + if (InputVariable != null) + hashCode = hashCode * 59 + InputVariable.GetHashCode(); + if (OutputVariable != null) + hashCode = hashCode * 59 + OutputVariable.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Operation left, Operation right) + { + return Equals(left, right); + } + + public static bool operator !=(Operation left, Operation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs new file mode 100644 index 000000000..7201d0be6 --- /dev/null +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -0,0 +1,165 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationRequest : IEquatable + { + /// + /// Gets or Sets InoutputArguments + /// + + [DataMember(Name="inoutputArguments")] + public List InoutputArguments { get; set; } + + /// + /// Gets or Sets InputArguments + /// + + [DataMember(Name="inputArguments")] + public List InputArguments { get; set; } + + /// + /// Gets or Sets RequestId + /// + + [DataMember(Name="requestId")] + public string RequestId { get; set; } + + /// + /// Gets or Sets Timeout + /// + + [DataMember(Name="timeout")] + public int? Timeout { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationRequest {\n"); + sb.Append(" InoutputArguments: ").Append(InoutputArguments).Append("\n"); + sb.Append(" InputArguments: ").Append(InputArguments).Append("\n"); + sb.Append(" RequestId: ").Append(RequestId).Append("\n"); + sb.Append(" Timeout: ").Append(Timeout).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationRequest)obj); + } + + /// + /// Returns true if OperationRequest instances are equal + /// + /// Instance of OperationRequest to be compared + /// Boolean + public bool Equals(OperationRequest other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + InoutputArguments == other.InoutputArguments || + InoutputArguments != null && + InoutputArguments.SequenceEqual(other.InoutputArguments) + ) && + ( + InputArguments == other.InputArguments || + InputArguments != null && + InputArguments.SequenceEqual(other.InputArguments) + ) && + ( + RequestId == other.RequestId || + RequestId != null && + RequestId.Equals(other.RequestId) + ) && + ( + Timeout == other.Timeout || + Timeout != null && + Timeout.Equals(other.Timeout) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (InoutputArguments != null) + hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); + if (InputArguments != null) + hashCode = hashCode * 59 + InputArguments.GetHashCode(); + if (RequestId != null) + hashCode = hashCode * 59 + RequestId.GetHashCode(); + if (Timeout != null) + hashCode = hashCode * 59 + Timeout.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationRequest left, OperationRequest right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationRequest left, OperationRequest right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs new file mode 100644 index 000000000..a443d7e69 --- /dev/null +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -0,0 +1,219 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationResult : IEquatable + { + /// + /// Gets or Sets ExecutionResult + /// + + [DataMember(Name="executionResult")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasResult ExecutionResult { get; set; } + public Result ExecutionResult { get; set; } + + /// + /// Gets or Sets ExecutionState + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ExecutionStateEnum + { + /// + /// Enum InitiatedEnum for Initiated + /// + [EnumMember(Value = "Initiated")] + InitiatedEnum = 0, + /// + /// Enum RunningEnum for Running + /// + [EnumMember(Value = "Running")] + RunningEnum = 1, + /// + /// Enum CompletedEnum for Completed + /// + [EnumMember(Value = "Completed")] + CompletedEnum = 2, + /// + /// Enum CanceledEnum for Canceled + /// + [EnumMember(Value = "Canceled")] + CanceledEnum = 3, + /// + /// Enum FailedEnum for Failed + /// + [EnumMember(Value = "Failed")] + FailedEnum = 4, + /// + /// Enum TimeoutEnum for Timeout + /// + [EnumMember(Value = "Timeout")] + TimeoutEnum = 5 } + + /// + /// Gets or Sets ExecutionState + /// + + [DataMember(Name="executionState")] + public ExecutionStateEnum? ExecutionState { get; set; } + + /// + /// Gets or Sets InoutputArguments + /// + + [DataMember(Name="inoutputArguments")] + public List InoutputArguments { get; set; } + + /// + /// Gets or Sets OutputArguments + /// + + [DataMember(Name="outputArguments")] + public List OutputArguments { get; set; } + + /// + /// Gets or Sets RequestId + /// + + [DataMember(Name="requestId")] + public string RequestId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationResult {\n"); + sb.Append(" ExecutionResult: ").Append(ExecutionResult).Append("\n"); + sb.Append(" ExecutionState: ").Append(ExecutionState).Append("\n"); + sb.Append(" InoutputArguments: ").Append(InoutputArguments).Append("\n"); + sb.Append(" OutputArguments: ").Append(OutputArguments).Append("\n"); + sb.Append(" RequestId: ").Append(RequestId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationResult)obj); + } + + /// + /// Returns true if OperationResult instances are equal + /// + /// Instance of OperationResult to be compared + /// Boolean + public bool Equals(OperationResult other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExecutionResult == other.ExecutionResult || + ExecutionResult != null && + ExecutionResult.Equals(other.ExecutionResult) + ) && + ( + ExecutionState == other.ExecutionState || + ExecutionState != null && + ExecutionState.Equals(other.ExecutionState) + ) && + ( + InoutputArguments == other.InoutputArguments || + InoutputArguments != null && + InoutputArguments.SequenceEqual(other.InoutputArguments) + ) && + ( + OutputArguments == other.OutputArguments || + OutputArguments != null && + OutputArguments.SequenceEqual(other.OutputArguments) + ) && + ( + RequestId == other.RequestId || + RequestId != null && + RequestId.Equals(other.RequestId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExecutionResult != null) + hashCode = hashCode * 59 + ExecutionResult.GetHashCode(); + if (ExecutionState != null) + hashCode = hashCode * 59 + ExecutionState.GetHashCode(); + if (InoutputArguments != null) + hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); + if (OutputArguments != null) + hashCode = hashCode * 59 + OutputArguments.GetHashCode(); + if (RequestId != null) + hashCode = hashCode * 59 + RequestId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationResult left, OperationResult right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationResult left, OperationResult right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs new file mode 100644 index 000000000..1bb9242d3 --- /dev/null +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationVariable : IEquatable + { + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public OneOfOperationVariableValue Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationVariable {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationVariable)obj); + } + + /// + /// Returns true if OperationVariable instances are equal + /// + /// Instance of OperationVariable to be compared + /// Boolean + public bool Equals(OperationVariable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationVariable left, OperationVariable right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationVariable left, OperationVariable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs new file mode 100644 index 000000000..3df8196a2 --- /dev/null +++ b/src/IO.Swagger/Models/Permission.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Permission : IEquatable + { + /// + /// Gets or Sets KindOfPermission + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KindOfPermissionEnum + { + /// + /// Enum AllowEnum for Allow + /// + [EnumMember(Value = "Allow")] + AllowEnum = 0, + /// + /// Enum DenyEnum for Deny + /// + [EnumMember(Value = "Deny")] + DenyEnum = 1, + /// + /// Enum NotApplicableEnum for NotApplicable + /// + [EnumMember(Value = "NotApplicable")] + NotApplicableEnum = 2, + /// + /// Enum UndefinedEnum for Undefined + /// + [EnumMember(Value = "Undefined")] + UndefinedEnum = 3 } + + /// + /// Gets or Sets KindOfPermission + /// + [Required] + + [DataMember(Name="kindOfPermission")] + public KindOfPermissionEnum? KindOfPermission { get; set; } + + /// + /// Gets or Sets _Permission + /// + [Required] + + [DataMember(Name="permission")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Permission { get; set; } + public Reference _Permission { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Permission {\n"); + sb.Append(" KindOfPermission: ").Append(KindOfPermission).Append("\n"); + sb.Append(" _Permission: ").Append(_Permission).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Permission)obj); + } + + /// + /// Returns true if Permission instances are equal + /// + /// Instance of Permission to be compared + /// Boolean + public bool Equals(Permission other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + KindOfPermission == other.KindOfPermission || + KindOfPermission != null && + KindOfPermission.Equals(other.KindOfPermission) + ) && + ( + _Permission == other._Permission || + _Permission != null && + _Permission.Equals(other._Permission) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (KindOfPermission != null) + hashCode = hashCode * 59 + KindOfPermission.GetHashCode(); + if (_Permission != null) + hashCode = hashCode * 59 + _Permission.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Permission left, Permission right) + { + return Equals(left, right); + } + + public static bool operator !=(Permission left, Permission right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs new file mode 100644 index 000000000..e4604d13c --- /dev/null +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PermissionsPerObject : IEquatable + { + /// + /// Gets or Sets _Object + /// + + [DataMember(Name="object")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Object { get; set; } + public Reference _Object { get; set; } + + /// + /// Gets or Sets Permission + /// + + [DataMember(Name="permission")] + public List Permission { get; set; } + + /// + /// Gets or Sets TargetObjectAttributes + /// + + [DataMember(Name="targetObjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasObjectAttributes TargetObjectAttributes { get; set; } + public ObjectAttributes TargetObjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PermissionsPerObject {\n"); + sb.Append(" _Object: ").Append(_Object).Append("\n"); + sb.Append(" Permission: ").Append(Permission).Append("\n"); + sb.Append(" TargetObjectAttributes: ").Append(TargetObjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PermissionsPerObject)obj); + } + + /// + /// Returns true if PermissionsPerObject instances are equal + /// + /// Instance of PermissionsPerObject to be compared + /// Boolean + public bool Equals(PermissionsPerObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _Object == other._Object || + _Object != null && + _Object.Equals(other._Object) + ) && + ( + Permission == other.Permission || + Permission != null && + Permission.SequenceEqual(other.Permission) + ) && + ( + TargetObjectAttributes == other.TargetObjectAttributes || + TargetObjectAttributes != null && + TargetObjectAttributes.Equals(other.TargetObjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_Object != null) + hashCode = hashCode * 59 + _Object.GetHashCode(); + if (Permission != null) + hashCode = hashCode * 59 + Permission.GetHashCode(); + if (TargetObjectAttributes != null) + hashCode = hashCode * 59 + TargetObjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PermissionsPerObject left, PermissionsPerObject right) + { + return Equals(left, right); + } + + public static bool operator !=(PermissionsPerObject left, PermissionsPerObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs new file mode 100644 index 000000000..c5224f43e --- /dev/null +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -0,0 +1,138 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyAdministrationPoint : IEquatable + { + /// + /// Gets or Sets ExternalAccessControl + /// + [Required] + + [DataMember(Name="externalAccessControl")] + public bool? ExternalAccessControl { get; set; } + + /// + /// Gets or Sets LocalAccessControl + /// + + [DataMember(Name="localAccessControl")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControl LocalAccessControl { get; set; } + public AccessControl LocalAccessControl { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyAdministrationPoint {\n"); + sb.Append(" ExternalAccessControl: ").Append(ExternalAccessControl).Append("\n"); + sb.Append(" LocalAccessControl: ").Append(LocalAccessControl).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyAdministrationPoint)obj); + } + + /// + /// Returns true if PolicyAdministrationPoint instances are equal + /// + /// Instance of PolicyAdministrationPoint to be compared + /// Boolean + public bool Equals(PolicyAdministrationPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalAccessControl == other.ExternalAccessControl || + ExternalAccessControl != null && + ExternalAccessControl.Equals(other.ExternalAccessControl) + ) && + ( + LocalAccessControl == other.LocalAccessControl || + LocalAccessControl != null && + LocalAccessControl.Equals(other.LocalAccessControl) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalAccessControl != null) + hashCode = hashCode * 59 + ExternalAccessControl.GetHashCode(); + if (LocalAccessControl != null) + hashCode = hashCode * 59 + LocalAccessControl.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyAdministrationPoint left, PolicyAdministrationPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyAdministrationPoint left, PolicyAdministrationPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs new file mode 100644 index 000000000..736a37c49 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyDecisionPoint : IEquatable + { + /// + /// Gets or Sets ExternalPolicyDecisionPoints + /// + [Required] + + [DataMember(Name="externalPolicyDecisionPoints")] + public bool? ExternalPolicyDecisionPoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyDecisionPoint {\n"); + sb.Append(" ExternalPolicyDecisionPoints: ").Append(ExternalPolicyDecisionPoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyDecisionPoint)obj); + } + + /// + /// Returns true if PolicyDecisionPoint instances are equal + /// + /// Instance of PolicyDecisionPoint to be compared + /// Boolean + public bool Equals(PolicyDecisionPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalPolicyDecisionPoints == other.ExternalPolicyDecisionPoints || + ExternalPolicyDecisionPoints != null && + ExternalPolicyDecisionPoints.Equals(other.ExternalPolicyDecisionPoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalPolicyDecisionPoints != null) + hashCode = hashCode * 59 + ExternalPolicyDecisionPoints.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyDecisionPoint left, PolicyDecisionPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyDecisionPoint left, PolicyDecisionPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs new file mode 100644 index 000000000..97f2ed0d3 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyEnforcementPoint : IEquatable + { + /// + /// Gets or Sets ExternalPolicyEnforcementPoint + /// + [Required] + + [DataMember(Name="externalPolicyEnforcementPoint")] + public bool? ExternalPolicyEnforcementPoint { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyEnforcementPoint {\n"); + sb.Append(" ExternalPolicyEnforcementPoint: ").Append(ExternalPolicyEnforcementPoint).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyEnforcementPoint)obj); + } + + /// + /// Returns true if PolicyEnforcementPoint instances are equal + /// + /// Instance of PolicyEnforcementPoint to be compared + /// Boolean + public bool Equals(PolicyEnforcementPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalPolicyEnforcementPoint == other.ExternalPolicyEnforcementPoint || + ExternalPolicyEnforcementPoint != null && + ExternalPolicyEnforcementPoint.Equals(other.ExternalPolicyEnforcementPoint) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalPolicyEnforcementPoint != null) + hashCode = hashCode * 59 + ExternalPolicyEnforcementPoint.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyEnforcementPoint left, PolicyEnforcementPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyEnforcementPoint left, PolicyEnforcementPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs new file mode 100644 index 000000000..6cbe41c71 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyInformationPoints : IEquatable + { + /// + /// Gets or Sets ExternalInformationPoint + /// + [Required] + + [DataMember(Name="externalInformationPoint")] + public bool? ExternalInformationPoint { get; set; } + + /// + /// Gets or Sets InternalInformationPoint + /// + + [DataMember(Name="internalInformationPoint")] + public List InternalInformationPoint { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyInformationPoints {\n"); + sb.Append(" ExternalInformationPoint: ").Append(ExternalInformationPoint).Append("\n"); + sb.Append(" InternalInformationPoint: ").Append(InternalInformationPoint).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyInformationPoints)obj); + } + + /// + /// Returns true if PolicyInformationPoints instances are equal + /// + /// Instance of PolicyInformationPoints to be compared + /// Boolean + public bool Equals(PolicyInformationPoints other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalInformationPoint == other.ExternalInformationPoint || + ExternalInformationPoint != null && + ExternalInformationPoint.Equals(other.ExternalInformationPoint) + ) && + ( + InternalInformationPoint == other.InternalInformationPoint || + InternalInformationPoint != null && + InternalInformationPoint.SequenceEqual(other.InternalInformationPoint) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalInformationPoint != null) + hashCode = hashCode * 59 + ExternalInformationPoint.GetHashCode(); + if (InternalInformationPoint != null) + hashCode = hashCode * 59 + InternalInformationPoint.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyInformationPoints left, PolicyInformationPoints right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyInformationPoints left, PolicyInformationPoints right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs new file mode 100644 index 000000000..0c2eef1dd --- /dev/null +++ b/src/IO.Swagger/Models/Property.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Property : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Property {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Property)obj); + } + + /// + /// Returns true if Property instances are equal + /// + /// Instance of Property to be compared + /// Boolean + public bool Equals(Property other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Property left, Property right) + { + return Equals(left, right); + } + + public static bool operator !=(Property left, Property right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs new file mode 100644 index 000000000..91093fcaf --- /dev/null +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Qualifiable : IEquatable + { + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Qualifiable {\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Qualifiable)obj); + } + + /// + /// Returns true if Qualifiable instances are equal + /// + /// Instance of Qualifiable to be compared + /// Boolean + public bool Equals(Qualifiable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Qualifiable left, Qualifiable right) + { + return Equals(left, right); + } + + public static bool operator !=(Qualifiable left, Qualifiable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs new file mode 100644 index 000000000..229d0ab9d --- /dev/null +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -0,0 +1,170 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Qualifier : HasSemantics, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Gets or Sets Type + /// + [Required] + + [DataMember(Name="type")] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Qualifier {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Qualifier)obj); + } + + /// + /// Returns true if Qualifier instances are equal + /// + /// Instance of Qualifier to be compared + /// Boolean + public bool Equals(Qualifier other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Qualifier left, Qualifier right) + { + return Equals(left, right); + } + + public static bool operator !=(Qualifier left, Qualifier right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs new file mode 100644 index 000000000..db644e080 --- /dev/null +++ b/src/IO.Swagger/Models/Range.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Range : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Max + /// + + [DataMember(Name="max")] + public string Max { get; set; } + + /// + /// Gets or Sets Min + /// + + [DataMember(Name="min")] + public string Min { get; set; } + + /// + /// Gets or Sets ValueType + /// + [Required] + + [DataMember(Name="valueType")] + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Range {\n"); + sb.Append(" Max: ").Append(Max).Append("\n"); + sb.Append(" Min: ").Append(Min).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Range)obj); + } + + /// + /// Returns true if Range instances are equal + /// + /// Instance of Range to be compared + /// Boolean + public bool Equals(Range other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Max == other.Max || + Max != null && + Max.Equals(other.Max) + ) && + ( + Min == other.Min || + Min != null && + Min.Equals(other.Min) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Max != null) + hashCode = hashCode * 59 + Max.GetHashCode(); + if (Min != null) + hashCode = hashCode * 59 + Min.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Range left, Range right) + { + return Equals(left, right); + } + + public static bool operator !=(Range left, Range right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs new file mode 100644 index 000000000..3528845d5 --- /dev/null +++ b/src/IO.Swagger/Models/Referable.cs @@ -0,0 +1,182 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Referable : HasExtensions, IEquatable + { + /// + /// Gets or Sets Category + /// + + [DataMember(Name="category")] + public string Category { get; set; } + + /// + /// Gets or Sets Description + /// + + [DataMember(Name="description")] + public List Description { get; set; } + + /// + /// Gets or Sets DisplayName + /// + + [DataMember(Name="displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or Sets IdShort + /// + [Required] + + [DataMember(Name="idShort")] + public string IdShort { get; set; } + + /// + /// Gets or Sets ModelType + /// + [Required] + + [DataMember(Name="modelType")] + public ModelType ModelType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Referable {\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" DisplayName: ").Append(DisplayName).Append("\n"); + sb.Append(" IdShort: ").Append(IdShort).Append("\n"); + sb.Append(" ModelType: ").Append(ModelType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Referable)obj); + } + + /// + /// Returns true if Referable instances are equal + /// + /// Instance of Referable to be compared + /// Boolean + public bool Equals(Referable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Description == other.Description || + Description != null && + Description.SequenceEqual(other.Description) + ) && + ( + DisplayName == other.DisplayName || + DisplayName != null && + DisplayName.Equals(other.DisplayName) + ) && + ( + IdShort == other.IdShort || + IdShort != null && + IdShort.Equals(other.IdShort) + ) && + ( + ModelType == other.ModelType || + ModelType != null && + ModelType.Equals(other.ModelType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + if (DisplayName != null) + hashCode = hashCode * 59 + DisplayName.GetHashCode(); + if (IdShort != null) + hashCode = hashCode * 59 + IdShort.GetHashCode(); + if (ModelType != null) + hashCode = hashCode * 59 + ModelType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Referable left, Referable right) + { + return Equals(left, right); + } + + public static bool operator !=(Referable left, Referable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs new file mode 100644 index 000000000..8ef828da3 --- /dev/null +++ b/src/IO.Swagger/Models/Reference.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Reference : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Reference {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Reference)obj); + } + + /// + /// Returns true if Reference instances are equal + /// + /// Instance of Reference to be compared + /// Boolean + public bool Equals(Reference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Reference left, Reference right) + { + return Equals(left, right); + } + + public static bool operator !=(Reference left, Reference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs new file mode 100644 index 000000000..29583b3c2 --- /dev/null +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ReferenceElement : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public Reference Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReferenceElement {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ReferenceElement)obj); + } + + /// + /// Returns true if ReferenceElement instances are equal + /// + /// Instance of ReferenceElement to be compared + /// Boolean + public bool Equals(ReferenceElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ReferenceElement left, ReferenceElement right) + { + return Equals(left, right); + } + + public static bool operator !=(ReferenceElement left, ReferenceElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs new file mode 100644 index 000000000..10ae5a544 --- /dev/null +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -0,0 +1,137 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class RelationshipElement : SubmodelElement, IEquatable + { + /// + /// Gets or Sets First + /// + [Required] + + [DataMember(Name="first")] + public Reference First { get; set; } + + /// + /// Gets or Sets Second + /// + [Required] + + [DataMember(Name="second")] + public Reference Second { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class RelationshipElement {\n"); + sb.Append(" First: ").Append(First).Append("\n"); + sb.Append(" Second: ").Append(Second).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((RelationshipElement)obj); + } + + /// + /// Returns true if RelationshipElement instances are equal + /// + /// Instance of RelationshipElement to be compared + /// Boolean + public bool Equals(RelationshipElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + First == other.First || + First != null && + First.Equals(other.First) + ) && + ( + Second == other.Second || + Second != null && + Second.Equals(other.Second) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (First != null) + hashCode = hashCode * 59 + First.GetHashCode(); + if (Second != null) + hashCode = hashCode * 59 + Second.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(RelationshipElement left, RelationshipElement right) + { + return Equals(left, right); + } + + public static bool operator !=(RelationshipElement left, RelationshipElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs new file mode 100644 index 000000000..c5ccfb1ce --- /dev/null +++ b/src/IO.Swagger/Models/Result.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Result : IEquatable + { + /// + /// Gets or Sets Messages + /// + + [DataMember(Name="messages")] + public List Messages { get; set; } + + /// + /// Gets or Sets Success + /// + + [DataMember(Name="success")] + public bool? Success { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Result {\n"); + sb.Append(" Messages: ").Append(Messages).Append("\n"); + sb.Append(" Success: ").Append(Success).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Result)obj); + } + + /// + /// Returns true if Result instances are equal + /// + /// Instance of Result to be compared + /// Boolean + public bool Equals(Result other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Messages == other.Messages || + Messages != null && + Messages.SequenceEqual(other.Messages) + ) && + ( + Success == other.Success || + Success != null && + Success.Equals(other.Success) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Messages != null) + hashCode = hashCode * 59 + Messages.GetHashCode(); + if (Success != null) + hashCode = hashCode * 59 + Success.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Result left, Result right) + { + return Equals(left, right); + } + + public static bool operator !=(Result left, Result right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs new file mode 100644 index 000000000..2db4764ee --- /dev/null +++ b/src/IO.Swagger/Models/Security.cs @@ -0,0 +1,153 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Security : IEquatable + { + /// + /// Gets or Sets AccessControlPolicyPoints + /// + [Required] + + [DataMember(Name="accessControlPolicyPoints")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControlPolicyPoints AccessControlPolicyPoints { get; set; } + public AccessControlPolicyPoints AccessControlPolicyPoints { get; set; } + + /// + /// Gets or Sets Certificate + /// + + [DataMember(Name="certificate")] + public List Certificate { get; set; } + + /// + /// Gets or Sets RequiredCertificateExtension + /// + + [DataMember(Name="requiredCertificateExtension")] + public List RequiredCertificateExtension { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Security {\n"); + sb.Append(" AccessControlPolicyPoints: ").Append(AccessControlPolicyPoints).Append("\n"); + sb.Append(" Certificate: ").Append(Certificate).Append("\n"); + sb.Append(" RequiredCertificateExtension: ").Append(RequiredCertificateExtension).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Security)obj); + } + + /// + /// Returns true if Security instances are equal + /// + /// Instance of Security to be compared + /// Boolean + public bool Equals(Security other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AccessControlPolicyPoints == other.AccessControlPolicyPoints || + AccessControlPolicyPoints != null && + AccessControlPolicyPoints.Equals(other.AccessControlPolicyPoints) + ) && + ( + Certificate == other.Certificate || + Certificate != null && + Certificate.SequenceEqual(other.Certificate) + ) && + ( + RequiredCertificateExtension == other.RequiredCertificateExtension || + RequiredCertificateExtension != null && + RequiredCertificateExtension.SequenceEqual(other.RequiredCertificateExtension) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AccessControlPolicyPoints != null) + hashCode = hashCode * 59 + AccessControlPolicyPoints.GetHashCode(); + if (Certificate != null) + hashCode = hashCode * 59 + Certificate.GetHashCode(); + if (RequiredCertificateExtension != null) + hashCode = hashCode * 59 + RequiredCertificateExtension.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Security left, Security right) + { + return Equals(left, right); + } + + public static bool operator !=(Security left, Security right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs new file mode 100644 index 000000000..6e30f03b8 --- /dev/null +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubjectAttributes : IEquatable + { + /// + /// Gets or Sets _SubjectAttributes + /// + + [DataMember(Name="subjectAttributes")] + public List _SubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubjectAttributes {\n"); + sb.Append(" _SubjectAttributes: ").Append(_SubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubjectAttributes)obj); + } + + /// + /// Returns true if SubjectAttributes instances are equal + /// + /// Instance of SubjectAttributes to be compared + /// Boolean + public bool Equals(SubjectAttributes other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _SubjectAttributes == other._SubjectAttributes || + _SubjectAttributes != null && + _SubjectAttributes.SequenceEqual(other._SubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_SubjectAttributes != null) + hashCode = hashCode * 59 + _SubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubjectAttributes left, SubjectAttributes right) + { + return Equals(left, right); + } + + public static bool operator !=(SubjectAttributes left, SubjectAttributes right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs new file mode 100644 index 000000000..6d686a7ff --- /dev/null +++ b/src/IO.Swagger/Models/Submodel.cs @@ -0,0 +1,182 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Submodel : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets Kind + /// + + [DataMember(Name="kind")] + public ModelingKind Kind { get; set; } + + /// + /// Gets or Sets SubmodelElements + /// + + [DataMember(Name="submodelElements")] + public List SubmodelElements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Submodel {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append(" SubmodelElements: ").Append(SubmodelElements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Submodel)obj); + } + + /// + /// Returns true if Submodel instances are equal + /// + /// Instance of Submodel to be compared + /// Boolean + public bool Equals(Submodel other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + Kind == other.Kind || + Kind != null && + Kind.Equals(other.Kind) + ) && + ( + SubmodelElements == other.SubmodelElements || + SubmodelElements != null && + SubmodelElements.SequenceEqual(other.SubmodelElements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (Kind != null) + hashCode = hashCode * 59 + Kind.GetHashCode(); + if (SubmodelElements != null) + hashCode = hashCode * 59 + SubmodelElements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Submodel left, Submodel right) + { + return Equals(left, right); + } + + public static bool operator !=(Submodel left, Submodel right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs new file mode 100644 index 000000000..a2f20eb03 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -0,0 +1,167 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElement : Referable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets Kind + /// + + [DataMember(Name="kind")] + public ModelingKind Kind { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElement {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElement)obj); + } + + /// + /// Returns true if SubmodelElement instances are equal + /// + /// Instance of SubmodelElement to be compared + /// Boolean + public bool Equals(SubmodelElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + Kind == other.Kind || + Kind != null && + Kind.Equals(other.Kind) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (Kind != null) + hashCode = hashCode * 59 + Kind.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElement left, SubmodelElement right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElement left, SubmodelElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs new file mode 100644 index 000000000..3e2e75550 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -0,0 +1,165 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElementList : SubmodelElement, IEquatable + { + /// + /// Gets or Sets SemanticIdValues + /// + + [DataMember(Name="semanticIdValues")] + public Reference SemanticIdValues { get; set; } + + /// + /// Gets or Sets SubmodelElementTypeValues + /// + + [DataMember(Name="submodelElementTypeValues")] + public ModelType SubmodelElementTypeValues { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Gets or Sets ValueTypeValues + /// + + [DataMember(Name="valueTypeValues")] + public ValueTypeEnum ValueTypeValues { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElementList {\n"); + sb.Append(" SemanticIdValues: ").Append(SemanticIdValues).Append("\n"); + sb.Append(" SubmodelElementTypeValues: ").Append(SubmodelElementTypeValues).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueTypeValues: ").Append(ValueTypeValues).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElementList)obj); + } + + /// + /// Returns true if SubmodelElementList instances are equal + /// + /// Instance of SubmodelElementList to be compared + /// Boolean + public bool Equals(SubmodelElementList other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + SemanticIdValues == other.SemanticIdValues || + SemanticIdValues != null && + SemanticIdValues.Equals(other.SemanticIdValues) + ) && + ( + SubmodelElementTypeValues == other.SubmodelElementTypeValues || + SubmodelElementTypeValues != null && + SubmodelElementTypeValues.Equals(other.SubmodelElementTypeValues) + ) && + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ) && + ( + ValueTypeValues == other.ValueTypeValues || + ValueTypeValues != null && + ValueTypeValues.Equals(other.ValueTypeValues) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (SemanticIdValues != null) + hashCode = hashCode * 59 + SemanticIdValues.GetHashCode(); + if (SubmodelElementTypeValues != null) + hashCode = hashCode * 59 + SubmodelElementTypeValues.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueTypeValues != null) + hashCode = hashCode * 59 + ValueTypeValues.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElementList left, SubmodelElementList right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElementList left, SubmodelElementList right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs new file mode 100644 index 000000000..a08559806 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -0,0 +1,122 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElementStruct : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasSubmodelElement Value { get; set; } + public SubmodelElement Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElementStruct {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElementStruct)obj); + } + + /// + /// Returns true if SubmodelElementStruct instances are equal + /// + /// Instance of SubmodelElementStruct to be compared + /// Boolean + public bool Equals(SubmodelElementStruct other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElementStruct left, SubmodelElementStruct right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElementStruct left, SubmodelElementStruct right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs new file mode 100644 index 000000000..8308d84f8 --- /dev/null +++ b/src/IO.Swagger/Models/ValueList.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueList : IEquatable + { + /// + /// Gets or Sets ValueReferencePairTypes + /// + [Required] + + [DataMember(Name="valueReferencePairTypes")] + public List ValueReferencePairTypes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueList {\n"); + sb.Append(" ValueReferencePairTypes: ").Append(ValueReferencePairTypes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueList)obj); + } + + /// + /// Returns true if ValueList instances are equal + /// + /// Instance of ValueList to be compared + /// Boolean + public bool Equals(ValueList other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ValueReferencePairTypes == other.ValueReferencePairTypes || + ValueReferencePairTypes != null && + ValueReferencePairTypes.SequenceEqual(other.ValueReferencePairTypes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ValueReferencePairTypes != null) + hashCode = hashCode * 59 + ValueReferencePairTypes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueList left, ValueList right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueList left, ValueList right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs new file mode 100644 index 000000000..bbb677815 --- /dev/null +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueObject : IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueObject {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueObject)obj); + } + + /// + /// Returns true if ValueObject instances are equal + /// + /// Instance of ValueObject to be compared + /// Boolean + public bool Equals(ValueObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueObject left, ValueObject right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueObject left, ValueObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs new file mode 100644 index 000000000..af6705d11 --- /dev/null +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueReferencePairType : ValueObject, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueReferencePairType {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueReferencePairType)obj); + } + + /// + /// Returns true if ValueReferencePairType instances are equal + /// + /// Instance of ValueReferencePairType to be compared + /// Boolean + public bool Equals(ValueReferencePairType other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueReferencePairType left, ValueReferencePairType right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueReferencePairType left, ValueReferencePairType right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs new file mode 100644 index 000000000..a573295c3 --- /dev/null +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -0,0 +1,249 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ValueTypeEnum + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ValueTypeEnum + { + /// + /// Enum AnyUriEnum for anyUri + /// + [EnumMember(Value = "anyUri")] + AnyUriEnum = 0, + /// + /// Enum Base64BinaryEnum for base64Binary + /// + [EnumMember(Value = "base64Binary")] + Base64BinaryEnum = 1, + /// + /// Enum BooleanEnum for boolean + /// + [EnumMember(Value = "boolean")] + BooleanEnum = 2, + /// + /// Enum DateEnum for date + /// + [EnumMember(Value = "date")] + DateEnum = 3, + /// + /// Enum DateTimeEnum for dateTime + /// + [EnumMember(Value = "dateTime")] + DateTimeEnum = 4, + /// + /// Enum DateTimeStampEnum for dateTimeStamp + /// + [EnumMember(Value = "dateTimeStamp")] + DateTimeStampEnum = 5, + /// + /// Enum DecimalEnum for decimal + /// + [EnumMember(Value = "decimal")] + DecimalEnum = 6, + /// + /// Enum IntegerEnum for integer + /// + [EnumMember(Value = "integer")] + IntegerEnum = 7, + /// + /// Enum LongEnum for long + /// + [EnumMember(Value = "long")] + LongEnum = 8, + /// + /// Enum IntEnum for int + /// + [EnumMember(Value = "int")] + IntEnum = 9, + /// + /// Enum ShortEnum for short + /// + [EnumMember(Value = "short")] + ShortEnum = 10, + /// + /// Enum ByteEnum for byte + /// + [EnumMember(Value = "byte")] + ByteEnum = 11, + /// + /// Enum NonNegativeIntegerEnum for nonNegativeInteger + /// + [EnumMember(Value = "nonNegativeInteger")] + NonNegativeIntegerEnum = 12, + /// + /// Enum PositiveIntegerEnum for positiveInteger + /// + [EnumMember(Value = "positiveInteger")] + PositiveIntegerEnum = 13, + /// + /// Enum UnsignedLongEnum for unsignedLong + /// + [EnumMember(Value = "unsignedLong")] + UnsignedLongEnum = 14, + /// + /// Enum UnsignedIntEnum for unsignedInt + /// + [EnumMember(Value = "unsignedInt")] + UnsignedIntEnum = 15, + /// + /// Enum UnsignedShortEnum for unsignedShort + /// + [EnumMember(Value = "unsignedShort")] + UnsignedShortEnum = 16, + /// + /// Enum UnsignedByteEnum for unsignedByte + /// + [EnumMember(Value = "unsignedByte")] + UnsignedByteEnum = 17, + /// + /// Enum NonPositiveIntegerEnum for nonPositiveInteger + /// + [EnumMember(Value = "nonPositiveInteger")] + NonPositiveIntegerEnum = 18, + /// + /// Enum NegativeIntegerEnum for negativeInteger + /// + [EnumMember(Value = "negativeInteger")] + NegativeIntegerEnum = 19, + /// + /// Enum DoubleEnum for double + /// + [EnumMember(Value = "double")] + DoubleEnum = 20, + /// + /// Enum DurationEnum for duration + /// + [EnumMember(Value = "duration")] + DurationEnum = 21, + /// + /// Enum DayTimeDurationEnum for dayTimeDuration + /// + [EnumMember(Value = "dayTimeDuration")] + DayTimeDurationEnum = 22, + /// + /// Enum YearMonthDurationEnum for yearMonthDuration + /// + [EnumMember(Value = "yearMonthDuration")] + YearMonthDurationEnum = 23, + /// + /// Enum FloatEnum for float + /// + [EnumMember(Value = "float")] + FloatEnum = 24, + /// + /// Enum GDayEnum for gDay + /// + [EnumMember(Value = "gDay")] + GDayEnum = 25, + /// + /// Enum GMonthEnum for gMonth + /// + [EnumMember(Value = "gMonth")] + GMonthEnum = 26, + /// + /// Enum GMonthDayEnum for gMonthDay + /// + [EnumMember(Value = "gMonthDay")] + GMonthDayEnum = 27, + /// + /// Enum GYearEnum for gYear + /// + [EnumMember(Value = "gYear")] + GYearEnum = 28, + /// + /// Enum GYearMonthEnum for gYearMonth + /// + [EnumMember(Value = "gYearMonth")] + GYearMonthEnum = 29, + /// + /// Enum HexBinaryEnum for hexBinary + /// + [EnumMember(Value = "hexBinary")] + HexBinaryEnum = 30, + /// + /// Enum NOTATIONEnum for NOTATION + /// + [EnumMember(Value = "NOTATION")] + NOTATIONEnum = 31, + /// + /// Enum QNameEnum for QName + /// + [EnumMember(Value = "QName")] + QNameEnum = 32, + /// + /// Enum StringEnum for string + /// + [EnumMember(Value = "string")] + StringEnum = 33, + /// + /// Enum NormalizedStringEnum for normalizedString + /// + [EnumMember(Value = "normalizedString")] + NormalizedStringEnum = 34, + /// + /// Enum TokenEnum for token + /// + [EnumMember(Value = "token")] + TokenEnum = 35, + /// + /// Enum LanguageEnum for language + /// + [EnumMember(Value = "language")] + LanguageEnum = 36, + /// + /// Enum NameEnum for Name + /// + [EnumMember(Value = "Name")] + NameEnum = 37, + /// + /// Enum NCNameEnum for NCName + /// + [EnumMember(Value = "NCName")] + NCNameEnum = 38, + /// + /// Enum ENTITYEnum for ENTITY + /// + [EnumMember(Value = "ENTITY")] + ENTITYEnum = 39, + /// + /// Enum IDEnum for ID + /// + [EnumMember(Value = "ID")] + IDEnum = 40, + /// + /// Enum IDREFEnum for IDREF + /// + [EnumMember(Value = "IDREF")] + IDREFEnum = 41, + /// + /// Enum NMTOKENEnum for NMTOKEN + /// + [EnumMember(Value = "NMTOKEN")] + NMTOKENEnum = 42, + /// + /// Enum TimeEnum for time + /// + [EnumMember(Value = "time")] + TimeEnum = 43 } +} diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs new file mode 100644 index 000000000..b0016246c --- /dev/null +++ b/src/IO.Swagger/Models/View.cs @@ -0,0 +1,152 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class View : Referable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets ContainedElements + /// + + [DataMember(Name="containedElements")] + public List ContainedElements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class View {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" ContainedElements: ").Append(ContainedElements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((View)obj); + } + + /// + /// Returns true if View instances are equal + /// + /// Instance of View to be compared + /// Boolean + public bool Equals(View other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + ContainedElements == other.ContainedElements || + ContainedElements != null && + ContainedElements.SequenceEqual(other.ContainedElements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (ContainedElements != null) + hashCode = hashCode * 59 + ContainedElements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(View left, View right) + { + return Equals(left, right); + } + + public static bool operator !=(View left, View right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Program.cs b/src/IO.Swagger/Program.cs new file mode 100644 index 000000000..cdbbe15a7 --- /dev/null +++ b/src/IO.Swagger/Program.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + + CreateWebHostBuilder(args).Build().RunAsync(); + + //CreateHostBuilder(args).Build().RunAsync(); + + AasxServer.Program.Main(args); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/src/IO.Swagger/Properties/launchSettings.json b/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 000000000..7ef03b4e0 --- /dev/null +++ b/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "publishAllPorts": true, + "useSSL": true + } + } +} \ No newline at end of file diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs new file mode 100644 index 000000000..39fcd6c69 --- /dev/null +++ b/src/IO.Swagger/Startup.cs @@ -0,0 +1,141 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.IO; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; + + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IWebHostEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IWebHostEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); + }) + .AddXmlSerializerFormatters(); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("Final-Draft", new OpenApiInfo + { + Version = "Final-Draft", + Title = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", + Contact = new OpenApiContact() + { + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" + }, + TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") + }); + c.CustomSchemaIds(type => type.FullName); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.UseRouting(); + + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/Final-Draft/swagger.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + app.UseExceptionHandler("/Error"); + + app.UseHsts(); + } + } + } +} diff --git a/src/IO.Swagger/appsettings.json b/src/IO.Swagger/appsettings.json new file mode 100644 index 000000000..c6af7d9b0 --- /dev/null +++ b/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/IO.Swagger/web.config b/src/IO.Swagger/web.config new file mode 100644 index 000000000..6250eaf44 --- /dev/null +++ b/src/IO.Swagger/web.config @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/IO.Swagger/wwwroot/README.md b/src/IO.Swagger/wwwroot/README.md new file mode 100644 index 000000000..6a0b78471 --- /dev/null +++ b/src/IO.Swagger/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/src/IO.Swagger/wwwroot/index.html b/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 000000000..cde1f2f90 --- /dev/null +++ b/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/IO.Swagger/wwwroot/swagger-original.json b/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 000000000..97327baee --- /dev/null +++ b/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,3341 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + "description" : "An exemplary interface combination for the use case of an Asset Administration Shell Repository", + "termsOfService" : "https://github.com/admin-shell-io/aas-specs", + "contact" : { + "name" : "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche" + }, + "version" : "Final-Draft" + }, + "servers" : [ { + "url" : "/" + } ], + "paths" : { + "/shells" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Asset Administration Shells", + "operationId" : "GetAllAssetAdministrationShells", + "parameters" : [ { + "name" : "assetIds", + "in" : "query", + "description" : "The key-value-pair of an Asset identifier", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "example" : "[{\"key\": \"globalAssetId\",\"value\": \"http://example.company/myAsset\"},{\"key\": \"myOwnInternalAssetId\",\"value\": \"12345ABC\"}]", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + } + }, { + "name" : "idShort", + "in" : "query", + "description" : "The Asset Administration Shell’s IdShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shells", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllAssetAdministrationShells/1/0/RC02", "https://admin-shell.io/aas/API/GetAllAssetAdministrationShellsByAssetId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllAssetAdministrationShellsByIdShort/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Asset Administration Shell", + "operationId" : "PostAssetAdministrationShell", + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Asset Administration Shell created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostAssetAdministrationShell/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific Asset Administration Shell", + "operationId" : "GetAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shell", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetAdministrationShellById/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing Asset Administration Shell", + "operationId" : "PutAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Administration Shell updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetAdministrationShellById/1/0/RC02" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes an Asset Administration Shell", + "operationId" : "DeleteAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Asset Administration Shell deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteAssetAdministrationShellById/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Asset Administration Shell", + "operationId" : "GetAssetAdministrationShell", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shell", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetAdministrationShell/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Asset Administration Shell", + "operationId" : "PutAssetAdministrationShell", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + } ], + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Administration Shell updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetAdministrationShell/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/asset-information" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Asset Information", + "operationId" : "GetAssetInformation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Information", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetInformation" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetInformation/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Asset Information", + "operationId" : "PutAssetInformation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Asset Information object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetInformation" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Information updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetInformation/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel references", + "operationId" : "GetAllSubmodelReferences", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel references", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelReferences/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a submodel reference at the Asset Administration Shell", + "operationId" : "PostSubmodelReference", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Reference to the Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Reference" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel reference created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelReference/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}" : { + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes the submodel reference from the Asset Administration Shell", + "operationId" : "DeleteSubmodelReferenceById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel reference deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelReference/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Submodel", + "operationId" : "GetSubmodel", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodel/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Submodel", + "operationId" : "PutSubmodel", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodel/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel elements including their hierarchy", + "operationId" : "GetAllSubmodelElements", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "List of found submodel elements", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelElements/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsByParentPathAndSemanticId/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element", + "operationId" : "PostSubmodelElement", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElement/1/0/RC02c" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific submodel element from the Submodel at a specified path", + "operationId" : "GetSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodelElementByPath/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PutSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel element updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodelElementByPath/1/0/RC02c", "https://admin-shell.io/aas/API/SetSubmodelElementValueByPath/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PostSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElementByPath/1/0/RC02c" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a submodel element at a specified path within the submodel elements hierarchy", + "operationId" : "DeleteSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel element deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelElementByPath/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke" : { + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Synchronously or asynchronously invokes an Operation at a specified path", + "operationId" : "InvokeOperation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "async", + "in" : "query", + "description" : "Determines whether an operation invocation is performed asynchronously or synchronously", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Operation request object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/InvokeOperationSync/1/0/RC02", "https://admin-shell.io/aas/API/InvokeOperationAsync/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Operation result of an asynchronous invoked Operation", + "operationId" : "GetOperationAsyncResult", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "value" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "handleId", + "in" : "path", + "description" : "The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetOperationAsyncResult/1/0/RC02" ] + } + }, + "/submodels" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Submodels", + "operationId" : "GetAllSubmodels", + "parameters" : [ { + "name" : "semanticId", + "in" : "query", + "description" : "The value of the semantic id reference (BASE64-URL-encoded)", + "schema" : { + "type" : "string" + } + }, { + "name" : "idShort", + "in" : "query", + "description" : "The Submodel’s idShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodels", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Submodel" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodels/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelsByIdShort/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Submodel", + "operationId" : "PostSubmodel", + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodel/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Submodel", + "operationId" : "GetSubmodel_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodel/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Submodel", + "operationId" : "PutSubmodel_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodel/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel elements including their hierarchy", + "operationId" : "GetAllSubmodelElements_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "List of found submodel elements", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelElements/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsByParentPathAndSemanticId/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element", + "operationId" : "PostSubmodelElement_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElement/1/0/RC02c" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific submodel element from the Submodel at a specified path", + "operationId" : "GetSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodelElementByPath/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PutSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel element updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodelElementByPath/1/0/RC02c", "https://admin-shell.io/aas/API/SetSubmodelElementValueByPath/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PostSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElementByPath/1/0/RC02c" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a submodel element at a specified path within the submodel elements hierarchy", + "operationId" : "DeleteSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel element deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelElementByPath/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke" : { + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Synchronously or asynchronously invokes an Operation at a specified path", + "operationId" : "InvokeOperation_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "async", + "in" : "query", + "description" : "Determines whether an operation invocation is performed asynchronously or synchronously", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Operation request object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/InvokeOperationSync/1/0/RC02", "https://admin-shell.io/aas/API/InvokeOperationAsync/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Operation result of an asynchronous invoked Operation", + "operationId" : "GetOperationAsyncResult_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "value" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "handleId", + "in" : "path", + "description" : "The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetOperationAsyncResult/1/0/RC02" ] + } + }, + "/concept-descriptions" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Concept Descriptions", + "operationId" : "GetAllConceptDescriptions", + "parameters" : [ { + "name" : "idShort", + "in" : "query", + "description" : "The Concept Description’s IdShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "isCaseOf", + "in" : "query", + "description" : "IsCaseOf reference (BASE64-URL-encoded)", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "dataSpecificationRef", + "in" : "query", + "description" : "DataSpecification reference (BASE64-URL-encoded)", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Concept Descriptions", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConceptDescription" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllConceptDescriptions/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByIdShort/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByIsCaseOf/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByDataSpecificationReference/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Concept Description", + "operationId" : "PostConceptDescription", + "requestBody" : { + "description" : "Concept Description object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Concept Description created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostConceptDescription/1/0/RC02" ] + } + }, + "/concept-descriptions/{cdIdentifier}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific Concept Description", + "operationId" : "GetConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Concept Description", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetConceptDescriptionById/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing Concept Description", + "operationId" : "PutConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Concept Description object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Concept Description updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutConceptDescriptionById/1/0/RC02" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a Concept Description", + "operationId" : "DeleteConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Concept Description deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteConceptDescriptionById/1/0/RC02" ] + } + }, + "/serialization" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns an appropriate serialization based on the specified format (see SerializationFormat)", + "operationId" : "GenerateSerializationByIds", + "parameters" : [ { + "name" : "aasIds", + "in" : "query", + "description" : "The Asset Administration Shells' unique ids (BASE64-URL-encoded)", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, { + "name" : "submodelIds", + "in" : "query", + "description" : "The Submodels' unique ids (BASE64-URL-encoded)", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, { + "name" : "includeConceptDescriptions", + "in" : "query", + "description" : "Include Concept Descriptions?", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : true + } + } ], + "responses" : { + "200" : { + "description" : "Requested serialization based on SerializationFormat", + "content" : { + "application/asset-administration-shell-package+xml" : { + "schema" : { + "type" : "string", + "description" : "AASX package", + "format" : "binary", + "x-content-type" : "application/asset-administration-shell-package+xml" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShellEnvironment" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schema/AssetAdministrationShellEnvironment" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GenerateSerializationByIds/1/0/RC02" ] + } + } + }, + "components" : { + "schemas" : { + "IdentifierKeyValuePair" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "required" : [ "key", "subjectId", "value" ], + "properties" : { + "key" : { + "type" : "string" + }, + "subjectId" : { + "$ref" : "#/components/schemas/Reference" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "HasSemantics" : { + "type" : "object", + "properties" : { + "semanticId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "Reference" : { + "type" : "object", + "oneOf" : [ { + "$ref" : "#/components/schemas/GlobalReference" + }, { + "$ref" : "#/components/schemas/ModelReference" + } ] + }, + "GlobalReference" : { + "required" : [ "value" ], + "properties" : { + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/Reference" + } ] + }, + "Identifier" : { + "type" : "string" + }, + "ModelReference" : { + "required" : [ "keys" ], + "properties" : { + "referredSemanticId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "keys" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Key" + } + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/Reference" + } ] + }, + "Key" : { + "required" : [ "type", "value" ], + "type" : "object", + "properties" : { + "type" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/KeyElements" + }, + "value" : { + "type" : "string" + } + } + }, + "KeyElements" : { + "type" : "string", + "enum" : [ "AssetAdministrationShell", "AccessPermissionRule", "ConceptDescription", "Submodel", "AnnotatedRelationshipElement", "BasicEvent", "Blob", "Capability", "DataElement", "File", "Entity", "Event", "MultiLanguageProperty", "Operation", "Property", "Range", "ReferenceElement", "RelationshipElement", "SubmodelElement", "SubmodelElementList", "SubmodelElementStruct", "View", "FragmentReference" ] + }, + "AssetAdministrationShell" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "required" : [ "assetInformation" ], + "properties" : { + "assetInformation" : { + "$ref" : "#/components/schemas/AssetInformation" + }, + "derivedFrom" : { + "$ref" : "#/components/schemas/Reference" + }, + "security" : { + "$ref" : "#/components/schemas/Security" + }, + "submodels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "views" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/View" + } + } + } + } ] + }, + "Identifiable" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "required" : [ "identification" ], + "properties" : { + "administration" : { + "$ref" : "#/components/schemas/AdministrativeInformation" + }, + "identification" : { + "$ref" : "#/components/schemas/Identifier" + } + } + } ] + }, + "Referable" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasExtensions" + }, { + "required" : [ "idShort", "modelType" ], + "properties" : { + "category" : { + "type" : "string" + }, + "description" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "displayName" : { + "type" : "string" + }, + "idShort" : { + "type" : "string" + }, + "modelType" : { + "$ref" : "#/components/schemas/ModelType" + } + } + } ] + }, + "HasExtensions" : { + "type" : "object", + "properties" : { + "extensions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Extension" + } + } + } + }, + "Extension" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "refersTo" : { + "$ref" : "#/components/schemas/Reference" + }, + "value" : { + "type" : "string" + }, + "valueType" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "ValueTypeEnum" : { + "type" : "string", + "enum" : [ "anyUri", "base64Binary", "boolean", "date", "dateTime", "dateTimeStamp", "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", "positiveInteger", "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", "negativeInteger", "double", "duration", "dayTimeDuration", "yearMonthDuration", "float", "gDay", "gMonth", "gMonthDay", "gYear", "gYearMonth", "hexBinary", "NOTATION", "QName", "string", "normalizedString", "token", "language", "Name", "NCName", "ENTITY", "ID", "IDREF", "NMTOKEN", "time" ] + }, + "LangString" : { + "required" : [ "language", "text" ], + "type" : "object", + "properties" : { + "language" : { + "type" : "string" + }, + "text" : { + "type" : "string" + } + } + }, + "ModelType" : { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "name" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ModelTypes" + } + } + }, + "ModelTypes" : { + "type" : "string", + "enum" : [ "AssetAdministrationShell", "ConceptDescription", "Submodel", "AnnotatedRelationshipElement", "BasicEvent", "Blob", "Capability", "DataElement", "File", "Entity", "Event", "ModelReference", "MultiLanguageProperty", "Operation", "Property", "Range", "ReferenceElement", "RelationshipElement", "SubmodelElement", "SubmodelElementList", "SubmodelElementStruct", "View", "GlobalReference", "FragmentReference", "Constraint", "Formula", "Qualifier" ] + }, + "AdministrativeInformation" : { + "type" : "object", + "properties" : { + "revision" : { + "type" : "string" + }, + "version" : { + "type" : "string" + } + } + }, + "HasDataSpecification" : { + "type" : "object", + "properties" : { + "embeddedDataSpecifications" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/EmbeddedDataSpecification" + } + } + } + }, + "EmbeddedDataSpecification" : { + "required" : [ "dataSpecification", "dataSpecificationContent" ], + "type" : "object", + "properties" : { + "dataSpecification" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "dataSpecificationContent" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/DataSpecificationContent" + } + } + }, + "DataSpecificationContent" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/DataSpecificationIEC61360Content" + }, { + "$ref" : "#/components/schemas/DataSpecificationPhysicalUnitContent" + } ] + }, + "DataSpecificationIEC61360Content" : { + "allOf" : [ { + "$ref" : "#/components/schemas/ValueObject" + }, { + "required" : [ "preferredName" ], + "type" : "object", + "properties" : { + "dataType" : { + "type" : "string", + "enum" : [ "DATE", "STRING", "STRING_TRANSLATABLE", "REAL_MEASURE", "REAL_COUNT", "REAL_CURRENCY", "BOOLEAN", "URL", "RATIONAL", "RATIONAL_MEASURE", "TIME", "TIMESTAMP", "INTEGER_COUNT", "INTEGER_MEASURE", "INTEGER_CURRENCY" ] + }, + "definition" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "levelType" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LevelType" + } + }, + "preferredName" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "shortName" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "sourceOfDefinition" : { + "type" : "string" + }, + "symbol" : { + "type" : "string" + }, + "unit" : { + "type" : "string" + }, + "unitId" : { + "$ref" : "#/components/schemas/Reference" + }, + "valueFormat" : { + "type" : "string" + }, + "valueList" : { + "$ref" : "#/components/schemas/ValueList" + } + } + } ] + }, + "ValueObject" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "string" + }, + "valueId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "valueType" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ValueTypeEnum" + } + } + }, + "LevelType" : { + "type" : "string", + "enum" : [ "Min", "Max", "Nom", "Typ" ] + }, + "ValueList" : { + "required" : [ "valueReferencePairTypes" ], + "type" : "object", + "properties" : { + "valueReferencePairTypes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueReferencePairType" + } + } + } + }, + "ValueReferencePairType" : { + "allOf" : [ { + "$ref" : "#/components/schemas/ValueObject" + } ] + }, + "DataSpecificationPhysicalUnitContent" : { + "required" : [ "definition", "unitName", "unitSymbol" ], + "type" : "object", + "properties" : { + "conversionFactor" : { + "type" : "string" + }, + "definition" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "dinNotation" : { + "type" : "string" + }, + "eceCode" : { + "type" : "string" + }, + "eceName" : { + "type" : "string" + }, + "nistName" : { + "type" : "string" + }, + "registrationAuthorityId" : { + "type" : "string" + }, + "siName" : { + "type" : "string" + }, + "siNotation" : { + "type" : "string" + }, + "sourceOfDefinition" : { + "type" : "string" + }, + "supplier" : { + "type" : "string" + }, + "unitName" : { + "type" : "string" + }, + "unitSymbol" : { + "type" : "string" + } + } + }, + "AssetInformation" : { + "allOf" : [ { + "required" : [ "assetKind" ], + "properties" : { + "assetKind" : { + "$ref" : "#/components/schemas/AssetKind" + }, + "billOfMaterial" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "globalAssetId" : { + "$ref" : "#/components/schemas/Reference" + }, + "specificAssetIds" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + }, + "thumbnail" : { + "$ref" : "#/components/schemas/File" + } + } + } ] + }, + "AssetKind" : { + "type" : "string", + "enum" : [ "Type", "Instance" ] + }, + "File" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "mimeType" ], + "properties" : { + "mimeType" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "SubmodelElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "properties" : { + "kind" : { + "$ref" : "#/components/schemas/ModelingKind" + } + } + } ], + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/Capability" + }, { + "$ref" : "#/components/schemas/Entity" + }, { + "$ref" : "#/components/schemas/Event" + }, { + "$ref" : "#/components/schemas/BasicEvent" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Operation" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + }, { + "$ref" : "#/components/schemas/AnnotatedRelationshipElement" + }, { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "$ref" : "#/components/schemas/SubmodelElementList" + }, { + "$ref" : "#/components/schemas/SubmodelElementStruct" + } ] + }, + "Qualifiable" : { + "type" : "object", + "properties" : { + "qualifiers" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Constraint" + } + } + } + }, + "Constraint" : { + "required" : [ "modelType" ], + "properties" : { + "modelType" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ModelType" + } + }, + "oneOf" : [ { + "$ref" : "#/components/schemas/Qualifier" + }, { + "$ref" : "#/components/schemas/Formula" + } ] + }, + "Qualifier" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "$ref" : "#/components/schemas/ValueObject" + }, { + "required" : [ "type" ], + "properties" : { + "type" : { + "type" : "string" + } + } + } ] + }, + "Formula" : { + "allOf" : [ { + "properties" : { + "dependsOn" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "ModelingKind" : { + "type" : "string", + "enum" : [ "Template", "Instance" ] + }, + "Blob" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "mimeType" ], + "properties" : { + "mimeType" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "Capability" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "Entity" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "entityType" ], + "properties" : { + "entityType" : { + "$ref" : "#/components/schemas/EntityType" + }, + "globalAssetId" : { + "$ref" : "#/components/schemas/Reference" + }, + "specificAssetIds" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + }, + "statements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } ] + }, + "EntityType" : { + "type" : "string", + "enum" : [ "CoManagedEntity", "SelfManagedEntity" ] + }, + "Event" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "BasicEvent" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Event" + }, { + "required" : [ "observed" ], + "properties" : { + "observed" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "MultiLanguageProperty" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "valueId" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "Operation" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "inoutputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "inputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "outputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + } + } + } ] + }, + "OperationVariable" : { + "required" : [ "value" ], + "type" : "object", + "properties" : { + "value" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/Capability" + }, { + "$ref" : "#/components/schemas/Entity" + }, { + "$ref" : "#/components/schemas/Event" + }, { + "$ref" : "#/components/schemas/BasicEvent" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Operation" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + }, { + "$ref" : "#/components/schemas/AnnotatedRelationshipElement" + }, { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "$ref" : "#/components/schemas/SubmodelElementList" + }, { + "$ref" : "#/components/schemas/SubmodelElementStruct" + } ] + } + }, + "example" : { + "value" : "" + } + }, + "Property" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "$ref" : "#/components/schemas/ValueObject" + } ] + }, + "Range" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "valueType" ], + "properties" : { + "max" : { + "type" : "string" + }, + "min" : { + "type" : "string" + }, + "valueType" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "ReferenceElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "value" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "AnnotatedRelationshipElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "properties" : { + "annotation" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DataElement" + } + } + } + } ] + }, + "RelationshipElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "first", "second" ], + "properties" : { + "first" : { + "$ref" : "#/components/schemas/Reference" + }, + "second" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "DataElement" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + } ] + }, + "SubmodelElementList" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "semanticIdValues" : { + "$ref" : "#/components/schemas/Reference" + }, + "submodelElementTypeValues" : { + "$ref" : "#/components/schemas/ModelType" + }, + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + }, + "valueTypeValues" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "SubmodelElementStruct" : { + "properties" : { + "value" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/SubmodelElement" + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "Security" : { + "required" : [ "accessControlPolicyPoints" ], + "type" : "object", + "properties" : { + "accessControlPolicyPoints" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/AccessControlPolicyPoints" + }, + "certificate" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Certificate" + } + }, + "requiredCertificateExtension" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "AccessControlPolicyPoints" : { + "required" : [ "policyAdministrationPoint", "policyDecisionPoint", "policyEnforcementPoint" ], + "type" : "object", + "properties" : { + "policyAdministrationPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyAdministrationPoint" + }, + "policyDecisionPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyDecisionPoint" + }, + "policyEnforcementPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyEnforcementPoint" + }, + "policyInformationPoints" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyInformationPoints" + } + } + }, + "PolicyAdministrationPoint" : { + "required" : [ "externalAccessControl" ], + "type" : "object", + "properties" : { + "externalAccessControl" : { + "type" : "boolean" + }, + "localAccessControl" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/AccessControl" + } + } + }, + "AccessControl" : { + "type" : "object", + "properties" : { + "accessPermissionRule" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AccessPermissionRule" + } + }, + "defaultEnvironmentAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "defaultPermissions" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "defaultSubjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectableEnvironmentAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectablePermissions" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectableSubjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "AccessPermissionRule" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "required" : [ "targetSubjectAttributes" ], + "properties" : { + "permissionsPerObject" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PermissionsPerObject" + } + }, + "targetSubjectAttributes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubjectAttributes" + } + } + } + } ] + }, + "PermissionsPerObject" : { + "type" : "object", + "properties" : { + "object" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "permission" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Permission" + } + }, + "targetObjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ObjectAttributes" + } + } + }, + "Permission" : { + "required" : [ "kindOfPermission", "permission" ], + "type" : "object", + "properties" : { + "kindOfPermission" : { + "type" : "string", + "enum" : [ "Allow", "Deny", "NotApplicable", "Undefined" ] + }, + "permission" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "ObjectAttributes" : { + "type" : "object", + "properties" : { + "objectAttribute" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Property" + } + } + } + }, + "SubjectAttributes" : { + "type" : "object", + "properties" : { + "subjectAttributes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "PolicyDecisionPoint" : { + "required" : [ "externalPolicyDecisionPoints" ], + "type" : "object", + "properties" : { + "externalPolicyDecisionPoints" : { + "type" : "boolean" + } + } + }, + "PolicyEnforcementPoint" : { + "required" : [ "externalPolicyEnforcementPoint" ], + "type" : "object", + "properties" : { + "externalPolicyEnforcementPoint" : { + "type" : "boolean" + } + } + }, + "PolicyInformationPoints" : { + "required" : [ "externalInformationPoint" ], + "type" : "object", + "properties" : { + "externalInformationPoint" : { + "type" : "boolean" + }, + "internalInformationPoint" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "Certificate" : { + "type" : "object", + "oneOf" : [ { + "$ref" : "#/components/schemas/BlobCertificate" + } ] + }, + "BlobCertificate" : { + "properties" : { + "blobCertificate" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Blob" + }, + "containedExtension" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "lastCertificate" : { + "type" : "boolean" + } + } + }, + "View" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "properties" : { + "containedElements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "Submodel" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "properties" : { + "kind" : { + "$ref" : "#/components/schemas/ModelingKind" + }, + "submodelElements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } ] + }, + "OperationRequest" : { + "type" : "object", + "properties" : { + "inoutputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "inputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "requestId" : { + "type" : "string" + }, + "timeout" : { + "type" : "integer" + } + } + }, + "OperationResult" : { + "type" : "object", + "properties" : { + "executionResult" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Result" + }, + "executionState" : { + "type" : "string", + "enum" : [ "Initiated", "Running", "Completed", "Canceled", "Failed", "Timeout" ] + }, + "inoutputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "outputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "requestId" : { + "type" : "string" + } + }, + "example" : { + "outputArguments" : [ null, null ], + "requestId" : "requestId", + "executionResult" : "{}", + "executionState" : "Initiated", + "inoutputArguments" : [ { + "value" : "" + }, { + "value" : "" + } ] + } + }, + "Result" : { + "type" : "object", + "properties" : { + "messages" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Message" + } + }, + "success" : { + "type" : "boolean" + } + } + }, + "Message" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "string" + }, + "messageType" : { + "type" : "string", + "enum" : [ "Undefined", "Info", "Warning", "Error", "Exception" ] + }, + "text" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string" + } + } + }, + "ConceptDescription" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "properties" : { + "isCaseOf" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "AssetAdministrationShellEnvironment" : { + "type" : "object", + "properties" : { + "assetAdministrationShells" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + }, + "conceptDescriptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + }, + "submodels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + } + } +} diff --git a/src/IO.Swagger/wwwroot/web.config b/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 000000000..e70a7778d --- /dev/null +++ b/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + From c78c99a8fe8f8afa7ffb062616b92d50528af2a6 Mon Sep 17 00:00:00 2001 From: Andreas Orzelski Date: Fri, 14 Jan 2022 07:38:11 +0100 Subject: [PATCH 03/53] Change launchSettings.json --- src/AasxServerBlazor/Properties/launchSettings.json | 3 +-- src/IO.Swagger/Properties/launchSettings.json | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index c6019dc41..f76e1b5c1 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -18,8 +18,7 @@ }, "AasxServerBlazor": { "commandName": "Project", - //"commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\Modbus\" --edit", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/src/IO.Swagger/Properties/launchSettings.json b/src/IO.Swagger/Properties/launchSettings.json index 7ef03b4e0..3bc67e449 100644 --- a/src/IO.Swagger/Properties/launchSettings.json +++ b/src/IO.Swagger/Properties/launchSettings.json @@ -18,13 +18,13 @@ }, "web": { "commandName": "Project", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", "launchBrowser": true, "launchUrl": "swagger", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", - "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" }, "Docker": { "commandName": "Docker", From 2c921246342609ef23c376c524a608cc95687d23 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Fri, 21 Jan 2022 12:27:03 +0100 Subject: [PATCH 04/53] Changed the formatting --- .../aasxs/Example_AAS_ServoDCMotor_21.aasx | Bin 203968 -> 204115 bytes .../Attributes/ValidateModelStateAttribute.cs | 6 +- .../AssetAdministrationShellRepositoryApi.cs | 393 +++++++++------ src/IO.Swagger/Filters/BasePathFilter.cs | 5 +- .../GeneratePathParamsValidationFilter.cs | 4 +- src/IO.Swagger/Helpers/AASHelper.cs | 208 ++++++-- .../Helpers/IdentifierKeyValuePair_V2.cs | 4 - .../Helpers/OutputModifierContractResolver.cs | 47 +- src/IO.Swagger/Models/AccessControl.cs | 60 ++- .../Models/AccessControlPolicyPoints.cs | 41 +- src/IO.Swagger/Models/AccessPermissionRule.cs | 37 +- .../Models/AdministrativeInformation.cs | 30 +- .../Models/AnnotatedRelationshipElement.cs | 26 +- .../Models/AssetAdministrationShell.cs | 55 +-- .../AssetAdministrationShellEnvironment.cs | 36 +- src/IO.Swagger/Models/AssetInformation.cs | 18 +- src/IO.Swagger/Models/AssetKind.cs | 41 +- src/IO.Swagger/Models/BasicEvent.cs | 25 +- src/IO.Swagger/Models/Blob.cs | 31 +- src/IO.Swagger/Models/BlobCertificate.cs | 36 +- src/IO.Swagger/Models/Capability.cs | 20 +- src/IO.Swagger/Models/Certificate.cs | 18 +- src/IO.Swagger/Models/ConceptDescription.cs | 32 +- src/IO.Swagger/Models/Constraint.cs | 23 +- src/IO.Swagger/Models/DataElement.cs | 18 +- .../Models/DataSpecificationContent.cs | 18 +- .../DataSpecificationIEC61360Content.cs | 85 ++-- .../DataSpecificationPhysicalUnitContent.cs | 95 ++-- .../Models/EmbeddedDataSpecification.cs | 29 +- src/IO.Swagger/Models/Entity.cs | 43 +- src/IO.Swagger/Models/EntityType.cs | 41 +- src/IO.Swagger/Models/Extension.cs | 43 +- src/IO.Swagger/Models/File.cs | 31 +- src/IO.Swagger/Models/Formula.cs | 18 +- src/IO.Swagger/Models/GlobalReference.cs | 25 +- src/IO.Swagger/Models/HasDataSpecification.cs | 24 +- src/IO.Swagger/Models/HasExtensions.cs | 24 +- src/IO.Swagger/Models/HasSemantics.cs | 24 +- src/IO.Swagger/Models/Identifiable.cs | 31 +- .../Models/IdentifierKeyValuePair.cs | 37 +- src/IO.Swagger/Models/Key.cs | 29 +- src/IO.Swagger/Models/KeyElements.cs | 255 +++++----- src/IO.Swagger/Models/LangString.cs | 29 +- src/IO.Swagger/Models/LevelType.cs | 61 +-- src/IO.Swagger/Models/Message.cs | 45 +- src/IO.Swagger/Models/ModelEvent.cs | 20 +- src/IO.Swagger/Models/ModelReference.cs | 31 +- src/IO.Swagger/Models/ModelType.cs | 23 +- src/IO.Swagger/Models/ModelTypes.cs | 295 ++++++----- src/IO.Swagger/Models/ModelingKind.cs | 41 +- .../Models/MultiLanguageProperty.cs | 32 +- src/IO.Swagger/Models/ObjectAttributes.cs | 24 +- src/IO.Swagger/Models/OneOfCertificate.cs | 18 +- src/IO.Swagger/Models/OneOfConstraint.cs | 18 +- src/IO.Swagger/Models/OneOfDataElement.cs | 18 +- .../Models/OneOfDataSpecificationContent.cs | 18 +- .../Models/OneOfOperationVariableValue.cs | 18 +- src/IO.Swagger/Models/OneOfReference.cs | 18 +- src/IO.Swagger/Models/OneOfSubmodelElement.cs | 18 +- src/IO.Swagger/Models/Operation.cs | 38 +- src/IO.Swagger/Models/OperationHandle.cs | 19 + src/IO.Swagger/Models/OperationRequest.cs | 42 +- src/IO.Swagger/Models/OperationResult.cs | 51 +- src/IO.Swagger/Models/OperationVariable.cs | 23 +- src/IO.Swagger/Models/Permission.cs | 32 +- src/IO.Swagger/Models/PermissionsPerObject.cs | 36 +- .../Models/PolicyAdministrationPoint.cs | 29 +- src/IO.Swagger/Models/PolicyDecisionPoint.cs | 23 +- .../Models/PolicyEnforcementPoint.cs | 23 +- .../Models/PolicyInformationPoints.cs | 29 +- src/IO.Swagger/Models/Property.cs | 38 +- src/IO.Swagger/Models/Qualifiable.cs | 24 +- src/IO.Swagger/Models/Qualifier.cs | 43 +- src/IO.Swagger/Models/Range.cs | 37 +- src/IO.Swagger/Models/Referable.cs | 49 +- src/IO.Swagger/Models/Reference.cs | 18 +- src/IO.Swagger/Models/ReferenceElement.cs | 26 +- src/IO.Swagger/Models/RelationshipElement.cs | 31 +- src/IO.Swagger/Models/Result.cs | 30 +- src/IO.Swagger/Models/Security.cs | 35 +- src/IO.Swagger/Models/SubjectAttributes.cs | 24 +- src/IO.Swagger/Models/Submodel.cs | 50 +- src/IO.Swagger/Models/SubmodelElement.cs | 44 +- src/IO.Swagger/Models/SubmodelElementList.cs | 44 +- .../Models/SubmodelElementStruct.cs | 26 +- src/IO.Swagger/Models/ValueList.cs | 23 +- src/IO.Swagger/Models/ValueObject.cs | 36 +- .../Models/ValueReferencePairType.cs | 20 +- src/IO.Swagger/Models/ValueTypeEnum.cs | 465 +++++++++--------- src/IO.Swagger/Models/View.cs | 38 +- src/IO.Swagger/Program.cs | 2 +- src/IO.Swagger/Startup.cs | 15 +- 92 files changed, 2062 insertions(+), 2194 deletions(-) create mode 100644 src/IO.Swagger/Models/OperationHandle.cs diff --git a/content-for-demo/aasxs/Example_AAS_ServoDCMotor_21.aasx b/content-for-demo/aasxs/Example_AAS_ServoDCMotor_21.aasx index 1651621154988c2ef92db1f03441ef85158ec45d..cb10a77172e368da1206d16409c940d928af16b4 100644 GIT binary patch delta 4384 zcmV+*5#R2>xeU{~43KIQ*NrVy8#vs0Q4jzC2DAVGRsaB(kQW0hmuVRTEPw4?*>d7Y z7JZ+H`G*Ypr8~k#2+ZP&E;@w4)pU6qpgdDOF;S673FKG{ohjKaKlO)9%)InB^i#k2 zPx?zHQwwNEV8DP?6;)v?7iHdi^5nfY7k&T3qo#s;L?|}&_XV+7D*Vv=>tDWykiKL8 zkbVzX2A#g^cFx`xCZ;)kCw~YJ4-ZACXjng{6Qrs|YzQp5CRS=Cp)8aNZjncd14SMx zMT3lma;YQ=|G2#9%M+x*W2{pX>N4_5!6B5>-o#oZ@I3CDD1JxniY^Qpnsz7B%d%oX zlKRC*s(@_$0p2gX%&eJ^W_VM9$r1oZnv^0_;<+$2iQUvb&rR(t3x6`XdE8uB=}!z| zHam|{o2uy2Fb(p(;7!1CwWU_I-Vqxod)U7?{dt6F_kU43tDUyQv)0MUd8vL{ zsUAolXF3$6daG7$Rm-R6;;C3&4@M&?G(?C76Ytb)W0}(uBp6X3cr-j8@JT$Jo`r@e zKg#d%WZp;Q-e{j?CG%N>SLN*lMqEhQ-9U!R1Z*v0@hsqZ8MCF6`GQ_Jt;M?1?7E}T zt&Ts6040nHAAbZq5C%}-J&XrJuxaa>*A+x%f~Ntcx=AY3$9ta~M~UO5)ODT&8Y`${}*d{Zi&E`{8fc7NLK`Ne`N>pvo4Qt*J*QIW=E zlxU^6>Cv7}i7`dQ46<8n8XrPyFkGU z)a*;XhpL5m)0)&CkxrHKr%6ScXP^3m>&s3Le9(qJ`bx!2!7+FUPPS1btq*7)F0S4- zzCJg^GJnID_}ciwI+Lb1*fRi3EIEI77+W{QP%PPOBZ|j*%Eap{deBh&d!^FY1*pvp zjLc~3o|M2DoWh}sfNfL*+olHJcCNnLVFa?KVyIqO+VHJUqnFicZ4al>8?jtDsn+TZ z2EaArEH-uKQUnsS`xyfyPjqH9t8Hk)ZG{h42!H78p?QD)b4{$WpK1qT-aqyX(}{0P z5mK^q(~Z=VE<1xxZwJZg%nbp}-PFWLM3A0Zk|dT(jGh{=O;5{OVbxM;mn|@cvw=Z= zvCx|bSf^yi1`^`gbFFL|U?bIlW@dPmcN$%1hM}^_oOfX(_=*p&`7*=?*;u=EAY&q1 z*nd0%=+Q((hboYr#wLc?{K89q@&4gnEOYlZcGC2BdB^O&mei_M>q*%6XMGjP){mVA zGRaoJ%A$>H|1KG`Z9}$rJ!_4bzbIB6zp}MqW7cmWzLHHD%5Y|=Dw31v$sAi_<_@TVZq{pDcw~O2>xLmK7Y=6iMRcM-`(9z8Yi;RTpJ5y{3vLbkxenmcv z7fKoieAyD_WnYf)=`7$jxwT25eE1*_tfJVIpq?43+cHZzr;4QK@eXrga#?MqpX=b1wJbzwo zam*$}At0Rt!EdQ@>;*IT9k*9dOZA_8<=-T7=knP->}Fj`2^aQ^GiCwvB^1y?3P!rc z9NBN%ox~Lte`j_d*E2Qtzfu!vImDA89xJNdL;FfhecSGG*}N;4#KztN`>i3&qFbaNf9mfTR7Y4% zY4^;H!((hh^_*q?a??IvHh!FKiPu;1U~%4OWQ7zD?L9OlhQosyubHJTfIrXtD1;WFinD6cheRw+vkZp?OU4FK5YtH0-fZUN^&Z9KhN@~j zv@J&ni26%~ll-M)+ZnrN_X>-;v%pjKJ&LzduPe1KI_qB6&2T6)->3Mh`xIB)q__Yu zOXzTsCe!p8tJURrKJJhwqkna0FG8c!YFBILwbn_c-8fA+MVz4Y1*%^F0AKRzTNh6% z^J)I7qV#owTH;El9QXs822P781;lFn`5&JkcUe_0i^U z@PVkSvsW$aHf3TkU%?G}O-bHCWB3;QySnCWiD+LMu--hFmq zM6l-!Nj!=`kiwS~qc$7QLb>>OaujVmIp(Cx4+WnNf_WmSOnZY}zola{p<#waWOO}h zqY-AAxX}LD?Oy}2S`|-^MZT@0^e^`f(X25Qa>?1lv~xA+4u3v7MQ0D=3M5sRB%5}p z&^%{kiGZamV2li+=!pGxiS#i7_x$Fa=RXKgFao!TJRn`+8?O}B_zAc{gc>^1!H`ve zHH{VP>LY__wvv&4WEZ<<#h_{;(|!X~Dd=E*f|v}S9x%T;Q3oxgTjmoYx}C+@*8`wM z$H-*=%M%kkAb-Lz3+|w<7c*%vK@bl9vj8$7XB6b|5RZ+PEx6Dua};gv`G#(Nj11ZV z(xxg8x<-?{KF9mTu|9EvOhUZ7h(X+WHHkY{V%Dy5%cqzu5!#m?ym`rn__s{Fd{gx{ zsW(2~j6C~;Uia$5h8UIe9>QbRYZWtw1Kwq3ceWO&ZhvVSH^p)u%Xw^x!x?L*rnIvU zZ<(rQg4i5iZHI@LrKKRtWK0CQZJ;0mKJu<1fOW=Cy7&8xnR44I=cHv1-fV@H{I7rG zyyS>tYs~az(37tE7t+89iEV_YE--gMxwA>91j-XQoIL-gkGTN_cn5UwWD(%9auMVt zm6O!!r+=un!dD3`*%Ru@%uR)6u(!bLZt4I{qk^D4LTQ%zoaD3~tciLfT0J29@FUXg zGnIC@kJ*MGRue^V&eMZwjGuMJ+Tga`1$@*1&7u?({D;{Jb{G)pJc#GS@^Vu%XYnPE z46cp2Gn~jfG_K~OeT;_W`8P|RI6Xw2lp|>60#Nc+2F$V>04el(Ncm?A{2M7qn~Bni zMewyQ-+i+*Sk~3hthN*Lj=+GNT)4XhK*@w3MBJ zj**JFX3RX&5gPdWI03AaLesA_*c5jP;eXd27Kw5Tc;3U61J8YX<>@tJ6&X9R2c~g{ z)2*|p#|>iaqhl`&%)kO%k>>=t??&=EIWpzSqV*AE{Ea||$c%3HR;EQ(9;vTLidovf zZ`&REp-m11*isI<068hHCyi5GZ;&c4bj>YLECsL)5I|E+t%jBDIK){yU?*EAj**rcL_{qZ_E>fj^(Q z1+?csD0QAYTcUuc|0j&d5E4LHQW5a=_lT4Lb9GhKbmELy*AbaObvO$yYRu3>^O|SP zpg8Va5aV2uvtrJQk^3b#Oohu`!1yNF(JzE8@Zx!QV?L-IqT}{0c1~$4QGZ$kghAl> zH;w_ufMyX~p`p9PZ46aBh72$60q&djxga^!&6Y|Yn5}8AlJKW|WkesNv0X#HERs98 zA(qSbk>}t+?wj8AO{d3iMF>33#*676RZb%}TUD5v(K|_as<(b9gcAt5$2_I!F6hsG z4+=e@_T8h^j9jCjLQ{i}%zthoXz~Oni(-jM^&q{#K~e<7g$bYzPSzTkjOSy{)J;)f zigD_*e^1C4cLN?E0 zOXRiLlfDMOvc>`DUZac{-pzS1NORlTa25H;>;`u|E%++@24|$;SJ?N)+|F!IyL@iC z(%lx1UunBb;$@M4e}BBPNfPgMq>BwQI9F>dPijb>K%Id}bu}JgNg3*33MmC_R6x^C zPzb(9fKK3O(Y0M^uFePY{QL9&Sc|+yFrURYyHI<2(G2eS9J!MV^-V6&ae1VnJ)6)6 zd$%tfI<5@AkSgczO?d^|bqQ9w!~D>AnGYE0&a`ZlztCpqWPc#ZCjTJOMy>W`LO3Bv zts{t&y9Qfu4J7j}h{+XvfkM;q1~A!Yn>&v^&2p`2$Juu5`;|Udus74o8l&uk>>j~l zZhon`AM@3K-LbUY$#t=9&FyNme#_b;YQS@eOKu{`b0;B~)1AAL*HAoWm1WK3j>Z_7oGY&7c3h;xVR z3k)-3G;)}UFdz5`oD-xecP{UP{blS>g*nOWILRa>@@BZ(9Uw*eee?fNO9KQH00ICA z061y)PJ^HjhoBGvhoBGwx1bOMeFzTMjV)9gINW+s5C8xMw3jOx1Gobv5dfEv7XvYq z;1D{OQ5pj(0)rBleHsH{0koIj8Ut(r#+OVR133Z>PM3!p13v;vPnXCW12+OQQI`Q6 a14IJ`7z3A(7XxCKsvH9l24)!p0001k+FrB( delta 4227 zcmV-}5Pa{`x(vX%43KIOV1f`&9@&$Wz7GHZq^x;*r*^Si4!%r-0FCVe@R%GIDbVrAhMxm|6O{`jf?{EmEO!n4U!WV3pcv^4B^-`rNRZq9De{u2)NYU-1d|p1QOXq*})66@Z-BsZ?5v+6g+;@Mnyi)m-}Dff$mHRyjov7)390IjJJ9mXipO7YXDhht=! zBVyTMHjdzR8WmBrE`ZrtB1{wH^2B+3B+EDDN(IE3pqUbcIzzN`2zZ8=h2(pzIfVD3 z#@rd{RW^B=RHSzPsnfl=YPQjPz4xO~DnXM`nwHAAT*U??b^|MJE=ymN~Q8{tI?0r@yThaT&V&8myEO6)Uitu zO3dzObcr%Fz-ZPQ*v9J$A1)Bk*(~$^;^%*|RDxgS{W0$!+otWsH%5f0*}3VX+?KDJ z-DZ1T13I zAoXOZHwa*T&BS(QcpYyvy3S2g17*&;uo8U5hu4G*u|YOyw}BLDDGs&YAo6Gv%fNpc zQoP0{hSpIk5QK1o7M4O> z`!~s$ZJ3I~>se~d{6(?q_?4~2jakw7+hm(ElHuIcG@>NYQy`-ofDnv`G2p>utYxO? z_^G^R(sS{^_ki51^te(fx;W@**tUPALesDx9IIcrxwEBeK~W0UMoMSC8X{m+VU_Qiw#cxs)WW?kdU7rI!LV;uu z37O_otA|%MA2w!>il7v3`FmggU#g z_${6s1#!=9$L%%NQ~f8gAv=KFNq2VuyIGe~qJ;zF3@l*2go5fsrNnT+k^Q#OOk7bB zd%yX(9?QM+mDxn!BZ$ZLds$I74bcS@N|El_Z`Zqd(y<7ZX}+&)Yf(lyh3#ap?^C7)R!8_U=e%a zOL5!L)?)V(M#I5_orAA$3*UNY7z^QU?f{AxqFZ7ded=r&RQps*Y4_NTqXTMV?E*4? z`PjIaH-4OLiC1j=mf*Yt+(Xm=?QJr$2n*K73c{dmIqr3;djQ9ykrsbAwj;IgyY%Y6QH^ZUK!#>4V-KV(VCdC{gXPL5aE;q5K4x?0$=IL{&W#WvWa zDP^Mfh^m5-9Gy4OsUJ7DVs-Y68xu0>a&g8)u9cZ;MwjR#jaz?p(@DXtHSzN)b}o4j zXLQ#SVl)HrfgMYWQ#pfnMaL?54wHb75ZJjq3_3jp$N3n?7SAJ~E+#RlxMNT|t#;F~ z6mrvVkUoW+u^W5GnWuL5Hk!HGKUh%q4Op5GSm{D*~9O3*E_9*Cjx z#bOouGDIJV#Y}@3s0S5LU58>VqioRc|o z5;}m<)F^Ny3a)UubA`tYN7qyCZJFxn?lWQPR?MZ7TiVvh1KI5p*^NcNO2$jcyl!Fw z<4q-w4b*>xS`DOvU;TlP0729M!ZL!t$5eGN*Rt=sT?%tMQM* ztSLMbdE1t%i1A+m(>L|YwI`pw%6o?P#4i%w*Z zg@xR)4!aBos^pG4%;gm`np@FchzXc_*3B zpTGY1GyHROb#(|N4BmCJ&bPSQ%0R7CVy!n0Rq9{|l1a_u zW-uCet_eukI?!bJLaY^Y<9t_4Z7p3Moa}iRQxyAabLB;A4Q{I&>*KaE_0F!V(^Q8n zm>bW(@yP+KXy?&2>G@0QW>0^k0}K<%Ki2-SaZ!-H>c)#P4`7hG>oEK&UwbhIWZ>3t zSa_N9GnHPIJtdd+!$B$sCSY-HwhqFR_N%asT$Dx=!}u^QpaBCBvcl7Gu*vErAL3DZb5l)ySe`Yu)ntmH+pO|B9=~}W&E@2Veq2|Y7f!FkSarW z8=vkq&q94jOjpW(+}>u-qQR|3Qm_Mu7Jt=r-mmH{Iku)Ei&5F+sIq z&v}x2t}bH_?mlJQ^PD1n;n%imk7ZK-I^CfKub@4|gtj~;G{=;e?`+4Nr!VxdIGxFg z%|ElTCLb$0ljeU6YaM*B?f1cC`z{RL1)Q#2&2zh`wYAR8Quq6= zX{{na;JkdkWN#?#w#n`HJbYC>+t=WJ23fwR5is|nE(Pt)di!3m^|@(k&~=WF^+%GV zWA4r$xOq3Yd7jB@+1_=L&wmUxC-|z_LN0?3U{`Lh6-R&D*3CdaI}GbUoPD5ZenH2* zusO&V4z_H5dAp-~w|8_LWeBF$osKoWX5sJY>5&0UlP7-kMRwQ&n9)4#&g6B!K(rl4 z*Rl1L-x6?-EowT1PafHml)euD0Hm&$z8M3!0+JAuK@n`1mF9Rm;s(-;E)001s>Kk)zn diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs index 07cfabe83..604012536 100644 --- a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -1,9 +1,9 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; +using System.ComponentModel.DataAnnotations; +using System.Reflection; namespace IO.Swagger.Attributes { @@ -26,7 +26,7 @@ public override void OnActionExecuting(ActionExecutingContext context) { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 1d3cd1796..a78908d31 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -7,23 +7,20 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; +using AdminShellNS; using IO.Swagger.Attributes; - -using Microsoft.AspNetCore.Authorization; -using IO.Swagger.Models; using IO.Swagger.Helpers; -using AdminShellNS; +using IO.Swagger.Models; +using Microsoft.AspNetCore.Mvc; using Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; +using Swashbuckle.AspNetCore.Annotations; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; namespace IO.Swagger.Controllers -{ +{ /// /// /// @@ -48,10 +45,10 @@ public AssetAdministrationShellRepositoryApiController() [Route("/shells/{aasIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteAssetAdministrationShellById")] - public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -69,7 +66,7 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ [Route("/concept-descriptions/{cdIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteConceptDescriptionById")] - public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]string cdIdentifier) + public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] string cdIdentifier) { bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); if (deleted) @@ -92,7 +89,7 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]s [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelElementByPath")] - public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -115,7 +112,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]st } var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -134,7 +131,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]st [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] - public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); //Check if submodel exists @@ -151,7 +148,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] } var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -170,7 +167,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelReferenceById")] - public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier) + public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier) { aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); @@ -197,16 +194,16 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]st [ValidateModelState] [SwaggerOperation("GenerateSerializationByIds")] [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] - public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]List aasIds, [FromQuery][Required()]List submodelIds, [FromQuery][Required()]bool? includeConceptDescriptions) - { + public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(byte[])); string exampleJson = null; exampleJson = "\"\""; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(byte[]); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(byte[]); //TODO: Change the data returned return new ObjectResult(example); } @@ -222,7 +219,7 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]L [SwaggerOperation("GetAllAssetAdministrationShells")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Asset Administration Shells")] //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) - public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string assetIds, [FromQuery]string idShort) + public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string assetIds, [FromQuery] string idShort) { //TODO: Consider a case where both assetIds and idShort are present. var aasList = new List(); @@ -267,10 +264,10 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string a [ValidateModelState] [SwaggerOperation("GetAllConceptDescriptions")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] - public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort, [FromQuery]string isCaseOf, [FromQuery]string dataSpecificationRef) - { + public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShort, [FromQuery] string isCaseOf, [FromQuery] string dataSpecificationRef) + { //Return all the concept-descriptions from the server, NO Filter - if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef) ) + if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef)) { var cdList = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) @@ -285,13 +282,13 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort } //CDs filtered with idShort - if(!string.IsNullOrEmpty(idShort)) + if (!string.IsNullOrEmpty(idShort)) { return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); } //CDs filtered with isCaseOfReference - if(!string.IsNullOrEmpty(isCaseOf)) + if (!string.IsNullOrEmpty(isCaseOf)) { var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); @@ -324,13 +321,13 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort [ValidateModelState] [SwaggerOperation("GetAllSubmodelElements")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] - public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { // access AAS and Submodel var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found."); } @@ -341,11 +338,6 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string submodelElements.Add(smeWrapper.submodelElement); } - if(string.IsNullOrEmpty(level) && string.IsNullOrEmpty(content) && string.IsNullOrEmpty(extent)) - { - return new ObjectResult(submodelElements); - } - var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); return new ObjectResult(json); @@ -364,7 +356,7 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("GetAllSubmodelElementsSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] - public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel != null) @@ -392,10 +384,10 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ [ValidateModelState] [SwaggerOperation("GetAllSubmodelReferences")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] - public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] string aasIdentifier) { var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { return new ObjectResult(aasReturn.AAS.submodelRefs); } @@ -417,10 +409,10 @@ public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]strin [ValidateModelState] [SwaggerOperation("GetAllSubmodels")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] - public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [FromQuery]string idShort) - { + public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [FromQuery] string idShort) + { //Fetch all the submodels from the server - if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) { var submodelList = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) @@ -434,7 +426,7 @@ public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [From return new ObjectResult(submodelList); } - if(!string.IsNullOrEmpty(idShort)) + if (!string.IsNullOrEmpty(idShort)) { return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); } @@ -460,13 +452,21 @@ public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [From [ValidateModelState] [SwaggerOperation("GetAssetAdministrationShell")] [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] - public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] string aasIdentifier, [FromQuery] string content) { //TODO: Content ?? var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { - return new ObjectResult(aasReturn.AAS); + //If content is empty or Normal, return the object as it is + if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasReturn.AAS); + } + else if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); + } } return NotFound(); @@ -482,7 +482,7 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]st [ValidateModelState] [SwaggerOperation("GetAssetAdministrationShellById")] [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] - public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS != null) @@ -503,15 +503,15 @@ public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Require [ValidateModelState] [SwaggerOperation("GetAssetInformation")] [SwaggerResponse(statusCode: 200, type: typeof(AssetInformation), description: "Requested Asset Information")] - public virtual IActionResult GetAssetInformation([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAssetInformation([FromRoute][Required] string aasIdentifier) { //TODO:Change to AssetInformation in V3 //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); - if(asset != null) + if (asset != null) { return new ObjectResult(asset); } @@ -531,10 +531,10 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required]string aas [ValidateModelState] [SwaggerOperation("GetConceptDescriptionById")] [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] - public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]string cdIdentifier) + public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] string cdIdentifier) { var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); - if(conceptDescription != null) + if (conceptDescription != null) { return new ObjectResult(conceptDescription); } @@ -556,16 +556,16 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]stri [ValidateModelState] [SwaggerOperation("GetOperationAsyncResult")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) - { + public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(OperationResult)); string exampleJson = null; exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned return new ObjectResult(example); } @@ -582,16 +582,16 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("GetOperationAsyncResultSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) - { + public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(OperationResult)); string exampleJson = null; exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned return new ObjectResult(example); } @@ -609,17 +609,23 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req [ValidateModelState] [SwaggerOperation("GetSubmodel")] [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] - public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider other parameters súch as level, content, & extent var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel != null) + if (submodel == null) { - return new ObjectResult(submodel); + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); } - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Either AAS or Submodel not found"); } /// @@ -637,7 +643,7 @@ public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifi [ValidateModelState] [SwaggerOperation("GetSubmodelElementByPath")] [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] - public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -654,12 +660,18 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]strin } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if(submodelElement != null) + if (submodelElement == null) { - return new ObjectResult(submodelElement); + return NotFound($"Requested submodel element not found."); } - return NotFound($"Requested submodel element not found."); + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); } /// @@ -676,7 +688,7 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]strin [ValidateModelState] [SwaggerOperation("GetSubmodelElementByPathSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] - public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: support for Content, extent and level @@ -688,12 +700,18 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement != null) + if (submodelElement == null) { - return new ObjectResult(submodelElement); + return NotFound($"Requested submodel element not found."); } - return NotFound($"Requested submodel element not found."); + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); } /// @@ -709,16 +727,22 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re [ValidateModelState] [SwaggerOperation("GetSubmodelSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] - public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider rest of the parameters i.e., level, content & extent var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel != null) + if (submodel == null) + { + return NotFound($"The Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) { - return new ObjectResult(submodel); + return new ObjectResult(json); } - return NotFound($"Submodel not found."); + return NotFound($"Submodel not found"); } /// @@ -736,32 +760,55 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("InvokeOperation")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { //Check if aas exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found."); } //Find the operation from the idShortpath var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if(submodelElement == null) + if (submodelElement == null) { return NotFound($"Operation {idShortPath} not found."); } - var output = aasHelper.InvokeOperation(submodelElement); + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } - return NoContent(); + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } /// @@ -778,17 +825,48 @@ public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [F [ValidateModelState] [SwaggerOperation("InvokeOperationSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult InvokeOperationSubmodelRepo([FromBody]OperationRequest body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) - { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationRequest body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } + + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } /// @@ -811,13 +889,13 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV //Check if already exists var aasReturn = aasHelper.FindAas(body.idShort); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { return Conflict($"Asset Administration Shell {body.idShort} already exists."); } bool added = aasHelper.AddAas(body); - if(added) + if (added) { AasxServer.Program.signalNewData(2); return Created($"Asset Administration Shell {body.idShort} created successfully.", body); @@ -873,7 +951,7 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con [SwaggerOperation("PostSubmodel")] [SwaggerResponse(statusCode: 201, type: typeof(Submodel), description: "Submodel created successfully")] //public virtual IActionResult PostSubmodel([FromBody]Submodel body) - public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) + public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -913,33 +991,33 @@ public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) [SwaggerOperation("PostSubmodelElement")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider rest of the parameters, i.e., level, content & extent //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found"); } //Check for idShort in SubmodelElement - if(string.IsNullOrEmpty(body.idShort)) + if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"No IdShort found in the submodel element"); } //Check if submodel element already exists in the submodel var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if(submodelElement != null) + if (submodelElement != null) { return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); } @@ -948,7 +1026,8 @@ public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.Submode if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel Element {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -971,7 +1050,7 @@ public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.Submode [SwaggerOperation("PostSubmodelElementByPath")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -994,25 +1073,27 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.S return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); } - if(string.IsNullOrEmpty(body.idShort)) + if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"IdShort is not set in the submodel element."); } //Check if requested submodel element already exists in the parent SME - if(parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if(existingSME != null) + if (existingSME != null) { return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); } } bool added = aasHelper.AddSubmodelElement(parentSME, body); - if(added) + if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); } //Re-do @@ -1035,7 +1116,7 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.S [SwaggerOperation("PostSubmodelElementByPathSubmodelRepo")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1069,7 +1150,9 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]Adm bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); } //Re-do @@ -1091,7 +1174,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]Adm [SwaggerOperation("PostSubmodelElementSubmodelRepo")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1117,7 +1200,8 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShel if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel Element {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1135,20 +1219,20 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShel [SwaggerOperation("PostSubmodelReference")] [SwaggerResponse(statusCode: 201, type: typeof(Reference), description: "Submodel reference created successfully")] //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) - public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Reference body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Reference body, [FromRoute][Required] string aasIdentifier) { if (body.Count == 0) { return BadRequest($"No references present in the request payload."); } - else if(body.Count != 1) + else if (body.Count != 1) { return BadRequest($"More than one references present in the request payload."); } //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found."); } @@ -1184,7 +1268,7 @@ public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Refer [ValidateModelState] [SwaggerOperation("PutAssetAdministrationShell")] //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) - public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier, [FromQuery] string content) { //TODO: content?? if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) @@ -1192,7 +1276,7 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 return BadRequest($"No Identification found in AAS."); } - if(!aasIdentifier.Equals(body.idShort)) + if (!aasIdentifier.Equals(body.idShort)) { return BadRequest($"idShort {aasIdentifier} and payload do not match"); } @@ -1201,7 +1285,8 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 if (added) { AasxServer.Program.signalNewData(2); - return NoContent(); + object output = aasHelper.HandleOutputModifiers(body, content: content); + return Created($"AAS {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1218,13 +1303,14 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 [ValidateModelState] [SwaggerOperation("PutAssetAdministrationShellById")] //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) - public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in AAS."); } + //TODO: What if iDShort needs to be updated if (!aasIdentifier.Equals(body.idShort)) { return BadRequest($"idShort {aasIdentifier} and payload do not match"); @@ -1250,12 +1336,29 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShel [Route("/shells/{aasIdentifier}/aas/asset-information")] [ValidateModelState] [SwaggerOperation("PutAssetInformation")] - public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) - { - //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(204); + //public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset body, [FromRoute][Required] string aasIdentifier) + { + //Check if identification exists + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Asset."); + } - throw new NotImplementedException(); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + + bool added = aasHelper.AddAsset(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1269,7 +1372,7 @@ public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body [ValidateModelState] [SwaggerOperation("PutConceptDescriptionById")] //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) - public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.ConceptDescription body, [FromRoute][Required]string cdIdentifier) + public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20.ConceptDescription body, [FromRoute][Required] string cdIdentifier) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -1306,7 +1409,7 @@ public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.C [ValidateModelState] [SwaggerOperation("PutSubmodel")] //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider other parameters i.e., level, content, extent @@ -1316,7 +1419,7 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, } var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found."); } @@ -1336,7 +1439,8 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, aasReturn.AAS.submodelRefs.Add(newsmRef); } AasxServer.Program.signalNewData(2); - return NoContent(); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1358,7 +1462,7 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [ValidateModelState] [SwaggerOperation("PutSubmodelElementByPath")] //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -1379,7 +1483,7 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su return BadRequest($"IdShort is not set in the submodel element."); } //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); if (parentSME == null) { @@ -1389,7 +1493,9 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } //Re-do @@ -1411,7 +1517,7 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su [ValidateModelState] [SwaggerOperation("PutSubmodelElementByPathSubmodelRepo")] //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1435,7 +1541,9 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]Admi bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element updated successfully.", output); } //Re-do @@ -1456,7 +1564,7 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]Admi [ValidateModelState] [SwaggerOperation("PutSubmodelSubmodelRepo")] //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -1472,7 +1580,8 @@ public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Sub if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs index c9d95d6d1..a94d6a70c 100644 --- a/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -1,8 +1,7 @@ +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; using System.Linq; using System.Text.RegularExpressions; -using Swashbuckle.AspNetCore.Swagger; -using Swashbuckle.AspNetCore.SwaggerGen; -using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index 1845e56ac..a2138c86c 100644 --- a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -1,8 +1,8 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using System.ComponentModel.DataAnnotations; +using System.Linq; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index fd2f5a87f..55dfe86b2 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -2,9 +2,8 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Linq; using System.Text.RegularExpressions; -using System.Threading.Tasks; +using System.Threading; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers @@ -15,6 +14,10 @@ namespace IO.Swagger.Helpers public class AASHelper { private static AdminShellPackageEnv[] Packages; + /// + /// HandleId to operation result mapping for InvokeAsyncResult + /// + private static Dictionary opResultAsyncDict; /// /// Constructor @@ -22,6 +25,7 @@ public class AASHelper public AASHelper() { Packages = AasxServer.Program.env; + opResultAsyncDict = new Dictionary(); } internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) @@ -102,7 +106,7 @@ internal bool DeleteConceptDescription(string cdIdentifier) { bool deleted = false; var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); - if(conceptDescription != null) + if (conceptDescription != null) { Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); deleted = true; @@ -116,12 +120,12 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int { if (Packages != null) { - for(int i=0; i< Packages.Length;i++) + for (int i = 0; i < Packages.Length; i++) { var env = Packages[i]; if (env != null) { - foreach(var cd in env.AasEnv.ConceptDescriptions) + foreach (var cd in env.AasEnv.ConceptDescriptions) { if (cd.identification.id != null && cd.identification.id.Trim().ToLower() == cdIdentifier.Trim().ToLower()) { @@ -143,7 +147,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) bool success = false; // find the AAS var aasReturn = FindAas(aasIdentifier); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { // find the asset var asset = FindAssetwithReference(aasReturn.AAS.assetRef); @@ -169,7 +173,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) { - if(parent is SubmodelElementCollection parentColl) + if (parent is SubmodelElementCollection parentColl) { parentColl.value.Remove(submodelElement); return true; @@ -187,7 +191,7 @@ internal Asset FindAssetwithReference(AssetRef assetRef) if (env != null) { Asset asset = env.AasEnv.FindAsset(assetRef); - if(asset != null) + if (asset != null) { return asset; } @@ -202,14 +206,14 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod { FindAasReturn aasReturn = FindAas(aasIdentifier); - if (aasReturn.AAS!= null) + if (aasReturn.AAS != null) { SubmodelRef submodelRef = FindSubmodelRefWithinAAS(aasReturn, submodelIdentifier); if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); return true; - } + } } return false; @@ -224,7 +228,7 @@ internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string su var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) return submodelRef; - } + } } return null; @@ -349,7 +353,7 @@ internal List FindAllAasByIdShort(string idShort) { outputShells.Add(aas); } - } + } } } @@ -360,7 +364,7 @@ internal List FindAllAasByAssetIds(List outputShells = new List(); - foreach(IdentifierKeyValuePair_V2 assetId in assetIdList) + foreach (IdentifierKeyValuePair_V2 assetId in assetIdList) { outputShells.AddRange(FindAasByAssetId(assetId.Value)); } @@ -381,7 +385,7 @@ private List FindAasByAssetId(string assetId) { outputShells.Add(aas); } - } + } } } @@ -395,9 +399,9 @@ internal List FindAllConceptDescriptionsByIdShort(string idS { if (env != null) { - foreach(ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) { - if(conceptDescription.idShort.Equals(idShort)) + if (conceptDescription.idShort.Equals(idShort)) { outputCds.Add(conceptDescription); } @@ -417,16 +421,16 @@ internal object FindAllConceptDescriptionsByDataSpecRef(DataSpecificationRef dat { foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) { - if (conceptDescription.embeddedDataSpecification != null ) + if (conceptDescription.embeddedDataSpecification != null) { - foreach(EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) + foreach (EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) { - if(embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + if (embDataSpec.dataSpecification.Matches(dataSpecRefReq)) { outputCds.Add(conceptDescription); } } - + } } } @@ -444,7 +448,7 @@ internal List FindAllConceptDescriptionsByIsCaseOf(List FindAllConceptDescriptionsByIsCaseOf(List isCaseOf1, List isCaseOf2) { - foreach(Reference isCaseOf1_Ref in isCaseOf1) + foreach (Reference isCaseOf1_Ref in isCaseOf1) { - bool found=false; - foreach(Reference isCaseOf2_Ref in isCaseOf2) + bool found = false; + foreach (Reference isCaseOf2_Ref in isCaseOf2) { - if(isCaseOf1_Ref.Matches(isCaseOf2_Ref)) + if (isCaseOf1_Ref.Matches(isCaseOf2_Ref)) { found = true; break; } } - if(!found) + if (!found) { return false; } @@ -480,23 +484,60 @@ private bool CompareIsCaseOf(List isCaseOf1, List isCaseOf internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") { + //TODO: Better way to use default values when null + if (string.IsNullOrEmpty(level)) + { + level = "deep"; + } + + if (string.IsNullOrEmpty(content)) + { + content = "normal"; + } + + if (string.IsNullOrEmpty(extent)) + { + extent = "withoutBlobValue"; + } + + if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) + { + obj = GetObjectReference(obj); + } //Handle Level var json = ApplyLevelModifier(level, obj); return json; } + private object GetObjectReference(object obj) + { + if (obj is AdminShellV20.AdministrationShell aas) + return aas.GetReference(); + else if (obj is Submodel submodel) + return submodel.GetReference(); + else if (obj is SubmodelElement submodelElement) + return submodelElement.GetReference(); + else + { + Console.WriteLine("Error: Object not handled for the Reference type modifier."); + return obj; + } + } + private object ApplyLevelModifier(string level, object obj) { - if(level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); + + if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) { - var contractResolver = new OutputModifierContractResolver(true); - var settings = new JsonSerializerSettings(); - if (contractResolver != null) - settings.ContractResolver = contractResolver; - var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - return json; + contractResolver.Deep = false; } - return null; + + var settings = new JsonSerializerSettings(); + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; } internal bool AddSubmodel(Submodel submodel) @@ -544,12 +585,12 @@ internal Submodel FindSubmodelWithReference(Reference submodelRef) if (submodelRef.Count != 1) return null; - foreach(var env in Packages) + foreach (var env in Packages) { - if(env != null) + if (env != null) { var submodel = env.AasEnv.FindSubmodel(new Identification(submodelRef.First.idType, submodelRef.First.value)); - if(submodel != null) + if (submodel != null) { return submodel; } @@ -603,12 +644,12 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS return FindSubmodelElementByPath(collection, idShorts[1], out parent); } } - } + } } else { var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); - if(smeWrapper != null) + if (smeWrapper != null) return smeWrapper.submodelElement; } @@ -644,7 +685,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) { foreach (Submodel submodel in env.AasEnv.Submodels) { - if(submodel.idShort.Equals(idShort)) + if (submodel.idShort.Equals(idShort)) { outputSubmodels.Add(submodel); } @@ -680,9 +721,71 @@ internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection sme return null; } - internal object InvokeOperation(SubmodelElement submodelElement) + internal object InvokeOperationSync(Operation operation, Models.OperationRequest operationRequest) + { + Models.OperationResult opResult = new Models.OperationResult(); + //Check the qualifier for demo + if (operation.HasQualifierOfType("Demo") != null) + { + opResult.OutputArguments = new List(); + opResult.OutputArguments.Add(new Models.OperationVariable()); + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; + Models.Result result = new Models.Result(); + result.Success = true; + opResult.ExecutionResult = result; + opResult.RequestId = operationRequest.RequestId; + } + + return opResult; + } + + internal Models.OperationHandle InvokeOperationAsync(Operation operation, Models.OperationRequest body) + { + Models.OperationHandle opHandle = new Models.OperationHandle(); + //Check the qualifier for demo + if (operation.HasQualifierOfType("Demo") != null) + { + opHandle.RequestId = body.RequestId; + opHandle.HandleId = Guid.NewGuid().ToString(); + } + + return opHandle; + } + + + //TestOperation invokation for demo + private void InvokeTestOperation(Models.OperationHandle opHandle) { - throw new NotImplementedException(); + //First invokation + Models.OperationResult opResult = new Models.OperationResult(); + opResult.OutputArguments = new List + { + new Models.OperationVariable() + }; + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.InitiatedEnum; + Models.Message message = new Models.Message + { + Code = "xxx", + MessageType = Models.Message.MessageTypeEnum.InfoEnum, + Text = "Initiated the operation", + Timestamp = DateTime.UtcNow.ToString() + }; + Models.Result result = new Models.Result + { + Messages = new List() { message } + }; + opResult.ExecutionResult = result; + opResult.RequestId = opHandle.RequestId; + + opResultAsyncDict.Add(opHandle.HandleId, opResult); + + Thread.Sleep(120000); // Sleep for two min + //Running + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.RunningEnum; + + Thread.Sleep(120000); // Sleep for two min + //Running + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; } /// @@ -693,7 +796,7 @@ internal object InvokeOperation(SubmodelElement submodelElement) /// internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) { - + if (parentSME is SubmodelElementCollection parentSMEColl) { var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); @@ -707,7 +810,7 @@ internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement subm else { parentSMEColl.Add(submodelElement); - + } submodelElement.SetAllTimeStamps(DateTime.UtcNow); @@ -716,6 +819,23 @@ internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement subm return false; } + + internal bool AddAsset(Asset body, FindAasReturn aasReturn) + { + var existingAsset = Packages[aasReturn.IPackage].AasEnv.FindAsset(body.identification); + //asset is already present // Ideal case + if (existingAsset != null) + { + Packages[aasReturn.IPackage].AasEnv.Assets.Remove(existingAsset); + } + Packages[aasReturn.IPackage].AasEnv.Assets.Add(body); + + //Change the assetRef in AAS + aasReturn.AAS.assetRef = new AssetRef(new Reference(new Key("Asset", true, body.identification.idType, body.identification.id))); + return true; + } + + } /// diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs index a5f0b5c4c..372d1ba61 100644 --- a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -1,12 +1,8 @@ using IO.Swagger.Models; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Runtime.Serialization; using System.Text; -using System.Threading.Tasks; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index f77fe899a..94b10fb5a 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,11 +1,7 @@ using AdminShellNS; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; namespace IO.Swagger.Helpers { @@ -20,17 +16,41 @@ public class OutputModifierContractResolver : DefaultContractResolver public bool SubmodelHasElements = true; public bool SmcHasValue = true; public bool OpHasVariables = true; + private bool deep = true; + private string content = "normal"; - public OutputModifierContractResolver(bool deep = true) + + + + /// + /// Default level of the json response. + /// + public bool Deep { - if (!deep) + get => deep; + set { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - this.BlobHasValue = false; - this.AasHasViews = false; + if (value == false) + { + this.SubmodelHasElements = false; + this.SmcHasValue = false; + this.OpHasVariables = false; + this.BlobHasValue = false; + this.AasHasViews = false; + } + } + } + + /// + /// The enumeration Content indicates the kind of the response content’s serialization. + /// + public string Content + { + get => content; + set + { + content = value; } } @@ -61,5 +81,10 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ return property; } + + protected override IValueProvider CreateMemberValueProvider(MemberInfo member) + { + return base.CreateMemberValueProvider(member); + } } } diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs index 1e06c68d5..c774cf18b 100644 --- a/src/IO.Swagger/Models/AccessControl.cs +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessControl : IEquatable - { + { /// /// Gets or Sets AccessPermissionRule /// - [DataMember(Name="accessPermissionRule")] + [DataMember(Name = "accessPermissionRule")] public List AccessPermissionRule { get; set; } /// /// Gets or Sets DefaultEnvironmentAttributes /// - [DataMember(Name="defaultEnvironmentAttributes")] + [DataMember(Name = "defaultEnvironmentAttributes")] //TODO:Uncomment //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultEnvironmentAttributes { get; set; } public Reference DefaultEnvironmentAttributes { get; set; } @@ -46,7 +42,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets DefaultPermissions /// - [DataMember(Name="defaultPermissions")] + [DataMember(Name = "defaultPermissions")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultPermissions { get; set; } public Reference DefaultPermissions { get; set; } @@ -55,7 +51,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets DefaultSubjectAttributes /// - [DataMember(Name="defaultSubjectAttributes")] + [DataMember(Name = "defaultSubjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultSubjectAttributes { get; set; } public Reference DefaultSubjectAttributes { get; set; } @@ -64,7 +60,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectableEnvironmentAttributes /// - [DataMember(Name="selectableEnvironmentAttributes")] + [DataMember(Name = "selectableEnvironmentAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableEnvironmentAttributes { get; set; } public Reference SelectableEnvironmentAttributes { get; set; } @@ -73,7 +69,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectablePermissions /// - [DataMember(Name="selectablePermissions")] + [DataMember(Name = "selectablePermissions")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectablePermissions { get; set; } public Reference SelectablePermissions { get; set; } @@ -82,7 +78,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectableSubjectAttributes /// - [DataMember(Name="selectableSubjectAttributes")] + [DataMember(Name = "selectableSubjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableSubjectAttributes { get; set; } public Reference SelectableSubjectAttributes { get; set; } @@ -137,37 +133,37 @@ public bool Equals(AccessControl other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AccessPermissionRule == other.AccessPermissionRule || AccessPermissionRule != null && AccessPermissionRule.SequenceEqual(other.AccessPermissionRule) - ) && + ) && ( DefaultEnvironmentAttributes == other.DefaultEnvironmentAttributes || DefaultEnvironmentAttributes != null && DefaultEnvironmentAttributes.Equals(other.DefaultEnvironmentAttributes) - ) && + ) && ( DefaultPermissions == other.DefaultPermissions || DefaultPermissions != null && DefaultPermissions.Equals(other.DefaultPermissions) - ) && + ) && ( DefaultSubjectAttributes == other.DefaultSubjectAttributes || DefaultSubjectAttributes != null && DefaultSubjectAttributes.Equals(other.DefaultSubjectAttributes) - ) && + ) && ( SelectableEnvironmentAttributes == other.SelectableEnvironmentAttributes || SelectableEnvironmentAttributes != null && SelectableEnvironmentAttributes.Equals(other.SelectableEnvironmentAttributes) - ) && + ) && ( SelectablePermissions == other.SelectablePermissions || SelectablePermissions != null && SelectablePermissions.Equals(other.SelectablePermissions) - ) && + ) && ( SelectableSubjectAttributes == other.SelectableSubjectAttributes || SelectableSubjectAttributes != null && @@ -185,26 +181,26 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AccessPermissionRule != null) + if (AccessPermissionRule != null) hashCode = hashCode * 59 + AccessPermissionRule.GetHashCode(); - if (DefaultEnvironmentAttributes != null) + if (DefaultEnvironmentAttributes != null) hashCode = hashCode * 59 + DefaultEnvironmentAttributes.GetHashCode(); - if (DefaultPermissions != null) + if (DefaultPermissions != null) hashCode = hashCode * 59 + DefaultPermissions.GetHashCode(); - if (DefaultSubjectAttributes != null) + if (DefaultSubjectAttributes != null) hashCode = hashCode * 59 + DefaultSubjectAttributes.GetHashCode(); - if (SelectableEnvironmentAttributes != null) + if (SelectableEnvironmentAttributes != null) hashCode = hashCode * 59 + SelectableEnvironmentAttributes.GetHashCode(); - if (SelectablePermissions != null) + if (SelectablePermissions != null) hashCode = hashCode * 59 + SelectablePermissions.GetHashCode(); - if (SelectableSubjectAttributes != null) + if (SelectableSubjectAttributes != null) hashCode = hashCode * 59 + SelectableSubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessControl left, AccessControl right) { @@ -216,7 +212,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs index 292864002..c064fb200 100644 --- a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessControlPolicyPoints : IEquatable - { + { /// /// Gets or Sets PolicyAdministrationPoint /// [Required] - [DataMember(Name="policyAdministrationPoint")] + [DataMember(Name = "policyAdministrationPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyAdministrationPoint PolicyAdministrationPoint { get; set; } public PolicyAdministrationPoint PolicyAdministrationPoint { get; set; } @@ -41,7 +36,7 @@ public partial class AccessControlPolicyPoints : IEquatable [Required] - [DataMember(Name="policyDecisionPoint")] + [DataMember(Name = "policyDecisionPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyDecisionPoint PolicyDecisionPoint { get; set; } public PolicyDecisionPoint PolicyDecisionPoint { get; set; } @@ -51,7 +46,7 @@ public partial class AccessControlPolicyPoints : IEquatable [Required] - [DataMember(Name="policyEnforcementPoint")] + [DataMember(Name = "policyEnforcementPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyEnforcementPoint //PolicyEnforcementPoint { get; set; } @@ -62,7 +57,7 @@ public partial class AccessControlPolicyPoints : IEquatable - [DataMember(Name="policyInformationPoints")] + [DataMember(Name = "policyInformationPoints")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyInformationPoints PolicyInformationPoints { get; set; } public PolicyInformationPoints PolicyInformationPoints { get; set; } @@ -114,22 +109,22 @@ public bool Equals(AccessControlPolicyPoints other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( PolicyAdministrationPoint == other.PolicyAdministrationPoint || PolicyAdministrationPoint != null && PolicyAdministrationPoint.Equals(other.PolicyAdministrationPoint) - ) && + ) && ( PolicyDecisionPoint == other.PolicyDecisionPoint || PolicyDecisionPoint != null && PolicyDecisionPoint.Equals(other.PolicyDecisionPoint) - ) && + ) && ( PolicyEnforcementPoint == other.PolicyEnforcementPoint || PolicyEnforcementPoint != null && PolicyEnforcementPoint.Equals(other.PolicyEnforcementPoint) - ) && + ) && ( PolicyInformationPoints == other.PolicyInformationPoints || PolicyInformationPoints != null && @@ -147,20 +142,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (PolicyAdministrationPoint != null) + if (PolicyAdministrationPoint != null) hashCode = hashCode * 59 + PolicyAdministrationPoint.GetHashCode(); - if (PolicyDecisionPoint != null) + if (PolicyDecisionPoint != null) hashCode = hashCode * 59 + PolicyDecisionPoint.GetHashCode(); - if (PolicyEnforcementPoint != null) + if (PolicyEnforcementPoint != null) hashCode = hashCode * 59 + PolicyEnforcementPoint.GetHashCode(); - if (PolicyInformationPoints != null) + if (PolicyInformationPoints != null) hashCode = hashCode * 59 + PolicyInformationPoints.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessControlPolicyPoints left, AccessControlPolicyPoints right) { @@ -172,7 +167,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs index 95a9b18a6..65f630acd 100644 --- a/src/IO.Swagger/Models/AccessPermissionRule.cs +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -7,37 +7,34 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessPermissionRule : Referable, IEquatable - { + { /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets PermissionsPerObject /// - [DataMember(Name="permissionsPerObject")] + [DataMember(Name = "permissionsPerObject")] public List PermissionsPerObject { get; set; } /// @@ -45,7 +42,7 @@ public partial class AccessPermissionRule : Referable, IEquatable [Required] - [DataMember(Name="targetSubjectAttributes")] + [DataMember(Name = "targetSubjectAttributes")] public List TargetSubjectAttributes { get; set; } /// @@ -67,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -94,17 +91,17 @@ public bool Equals(AccessPermissionRule other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( PermissionsPerObject == other.PermissionsPerObject || PermissionsPerObject != null && PermissionsPerObject.SequenceEqual(other.PermissionsPerObject) - ) && + ) && ( TargetSubjectAttributes == other.TargetSubjectAttributes || TargetSubjectAttributes != null && @@ -122,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (PermissionsPerObject != null) + if (PermissionsPerObject != null) hashCode = hashCode * 59 + PermissionsPerObject.GetHashCode(); - if (TargetSubjectAttributes != null) + if (TargetSubjectAttributes != null) hashCode = hashCode * 59 + TargetSubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessPermissionRule left, AccessPermissionRule right) { @@ -145,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs index c106e04bc..aceef7073 100644 --- a/src/IO.Swagger/Models/AdministrativeInformation.cs +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AdministrativeInformation : IEquatable - { + { /// /// Gets or Sets Revision /// - [DataMember(Name="revision")] + [DataMember(Name = "revision")] public string Revision { get; set; } /// /// Gets or Sets Version /// - [DataMember(Name="version")] + [DataMember(Name = "version")] public string Version { get; set; } /// @@ -85,12 +79,12 @@ public bool Equals(AdministrativeInformation other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Revision == other.Revision || Revision != null && Revision.Equals(other.Revision) - ) && + ) && ( Version == other.Version || Version != null && @@ -108,16 +102,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Revision != null) + if (Revision != null) hashCode = hashCode * 59 + Revision.GetHashCode(); - if (Version != null) + if (Version != null) hashCode = hashCode * 59 + Version.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AdministrativeInformation left, AdministrativeInformation right) { @@ -129,7 +123,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs index f3a9b5681..4e0cafe47 100644 --- a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AnnotatedRelationshipElement : RelationshipElement, IEquatable - { + { /// /// Gets or Sets Annotation /// - [DataMember(Name="annotation")] + [DataMember(Name = "annotation")] public List Annotation { get; set; } /// @@ -50,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -77,7 +73,7 @@ public bool Equals(AnnotatedRelationshipElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Annotation == other.Annotation || Annotation != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Annotation != null) + if (Annotation != null) hashCode = hashCode * 59 + Annotation.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs index 930317d36..7c52798be 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShell.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetAdministrationShell : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// @@ -38,35 +35,35 @@ public partial class AssetAdministrationShell : Identifiable, IEquatable [Required] - [DataMember(Name="assetInformation")] + [DataMember(Name = "assetInformation")] public AssetInformation AssetInformation { get; set; } /// /// Gets or Sets DerivedFrom /// - [DataMember(Name="derivedFrom")] + [DataMember(Name = "derivedFrom")] public Reference DerivedFrom { get; set; } /// /// Gets or Sets Security /// - [DataMember(Name="security")] + [DataMember(Name = "security")] public Security Security { get; set; } /// /// Gets or Sets Submodels /// - [DataMember(Name="submodels")] + [DataMember(Name = "submodels")] public List Submodels { get; set; } /// /// Gets or Sets Views /// - [DataMember(Name="views")] + [DataMember(Name = "views")] public List Views { get; set; } /// @@ -91,7 +88,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -118,32 +115,32 @@ public bool Equals(AssetAdministrationShell other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( AssetInformation == other.AssetInformation || AssetInformation != null && AssetInformation.Equals(other.AssetInformation) - ) && + ) && ( DerivedFrom == other.DerivedFrom || DerivedFrom != null && DerivedFrom.Equals(other.DerivedFrom) - ) && + ) && ( Security == other.Security || Security != null && Security.Equals(other.Security) - ) && + ) && ( Submodels == other.Submodels || Submodels != null && Submodels.SequenceEqual(other.Submodels) - ) && + ) && ( Views == other.Views || Views != null && @@ -161,24 +158,24 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (AssetInformation != null) + if (AssetInformation != null) hashCode = hashCode * 59 + AssetInformation.GetHashCode(); - if (DerivedFrom != null) + if (DerivedFrom != null) hashCode = hashCode * 59 + DerivedFrom.GetHashCode(); - if (Security != null) + if (Security != null) hashCode = hashCode * 59 + Security.GetHashCode(); - if (Submodels != null) + if (Submodels != null) hashCode = hashCode * 59 + Submodels.GetHashCode(); - if (Views != null) + if (Views != null) hashCode = hashCode * 59 + Views.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetAdministrationShell left, AssetAdministrationShell right) { @@ -190,7 +187,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs index 3f1819c13..015620adc 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetAdministrationShellEnvironment : IEquatable - { + { /// /// Gets or Sets AssetAdministrationShells /// - [DataMember(Name="assetAdministrationShells")] + [DataMember(Name = "assetAdministrationShells")] public List AssetAdministrationShells { get; set; } /// /// Gets or Sets ConceptDescriptions /// - [DataMember(Name="conceptDescriptions")] + [DataMember(Name = "conceptDescriptions")] public List ConceptDescriptions { get; set; } /// /// Gets or Sets Submodels /// - [DataMember(Name="submodels")] + [DataMember(Name = "submodels")] public List Submodels { get; set; } /// @@ -93,17 +89,17 @@ public bool Equals(AssetAdministrationShellEnvironment other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AssetAdministrationShells == other.AssetAdministrationShells || AssetAdministrationShells != null && AssetAdministrationShells.SequenceEqual(other.AssetAdministrationShells) - ) && + ) && ( ConceptDescriptions == other.ConceptDescriptions || ConceptDescriptions != null && ConceptDescriptions.SequenceEqual(other.ConceptDescriptions) - ) && + ) && ( Submodels == other.Submodels || Submodels != null && @@ -121,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AssetAdministrationShells != null) + if (AssetAdministrationShells != null) hashCode = hashCode * 59 + AssetAdministrationShells.GetHashCode(); - if (ConceptDescriptions != null) + if (ConceptDescriptions != null) hashCode = hashCode * 59 + ConceptDescriptions.GetHashCode(); - if (Submodels != null) + if (Submodels != null) hashCode = hashCode * 59 + Submodels.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) { @@ -144,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs index 8ab61ca3e..82210194d 100644 --- a/src/IO.Swagger/Models/AssetInformation.cs +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetInformation : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetInformation left, AssetInformation right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs index e236f583e..53615779d 100644 --- a/src/IO.Swagger/Models/AssetKind.cs +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets AssetKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AssetKind + { + /// + /// Enum TypeEnum for Type + /// + [EnumMember(Value = "Type")] + TypeEnum = 0, /// - /// Gets or Sets AssetKind + /// Enum InstanceEnum for Instance /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum AssetKind - { - /// - /// Enum TypeEnum for Type - /// - [EnumMember(Value = "Type")] - TypeEnum = 0, - /// - /// Enum InstanceEnum for Instance - /// - [EnumMember(Value = "Instance")] - InstanceEnum = 1 } + [EnumMember(Value = "Instance")] + InstanceEnum = 1 + } } diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs index 318151203..e32d77dff 100644 --- a/src/IO.Swagger/Models/BasicEvent.cs +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class BasicEvent : ModelEvent, IEquatable - { + { /// /// Gets or Sets Observed /// [Required] - [DataMember(Name="observed")] + [DataMember(Name = "observed")] public Reference Observed { get; set; } /// @@ -51,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -78,7 +73,7 @@ public bool Equals(BasicEvent other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Observed == other.Observed || Observed != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Observed != null) + if (Observed != null) hashCode = hashCode * 59 + Observed.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(BasicEvent left, BasicEvent right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs index 100026f1b..b53c09db5 100644 --- a/src/IO.Swagger/Models/Blob.cs +++ b/src/IO.Swagger/Models/Blob.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Blob : SubmodelElement, IEquatable - { + { /// /// Gets or Sets MimeType /// [Required] - [DataMember(Name="mimeType")] + [DataMember(Name = "mimeType")] public string MimeType { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(Blob other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( MimeType == other.MimeType || MimeType != null && MimeType.Equals(other.MimeType) - ) && + ) && ( Value == other.Value || Value != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (MimeType != null) + if (MimeType != null) hashCode = hashCode * 59 + MimeType.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Blob left, Blob right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs index aa57ec7ff..0d13579d2 100644 --- a/src/IO.Swagger/Models/BlobCertificate.cs +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class BlobCertificate : IEquatable - { + { /// /// Gets or Sets _BlobCertificate /// - [DataMember(Name="blobCertificate")] + [DataMember(Name = "blobCertificate")] //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasBlob _BlobCertificate { get; set; } public Blob _BlobCertificate { get; set; } @@ -38,14 +34,14 @@ public partial class BlobCertificate : IEquatable /// Gets or Sets ContainedExtension /// - [DataMember(Name="containedExtension")] + [DataMember(Name = "containedExtension")] public List ContainedExtension { get; set; } /// /// Gets or Sets LastCertificate /// - [DataMember(Name="lastCertificate")] + [DataMember(Name = "lastCertificate")] public bool? LastCertificate { get; set; } /// @@ -94,17 +90,17 @@ public bool Equals(BlobCertificate other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _BlobCertificate == other._BlobCertificate || _BlobCertificate != null && _BlobCertificate.Equals(other._BlobCertificate) - ) && + ) && ( ContainedExtension == other.ContainedExtension || ContainedExtension != null && ContainedExtension.SequenceEqual(other.ContainedExtension) - ) && + ) && ( LastCertificate == other.LastCertificate || LastCertificate != null && @@ -122,18 +118,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_BlobCertificate != null) + if (_BlobCertificate != null) hashCode = hashCode * 59 + _BlobCertificate.GetHashCode(); - if (ContainedExtension != null) + if (ContainedExtension != null) hashCode = hashCode * 59 + ContainedExtension.GetHashCode(); - if (LastCertificate != null) + if (LastCertificate != null) hashCode = hashCode * 59 + LastCertificate.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(BlobCertificate left, BlobCertificate right) { @@ -145,7 +141,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs index a52f19279..afce09069 100644 --- a/src/IO.Swagger/Models/Capability.cs +++ b/src/IO.Swagger/Models/Capability.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Capability : SubmodelElement, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Capability left, Capability right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs index ea6808243..f7421a5e6 100644 --- a/src/IO.Swagger/Models/Certificate.cs +++ b/src/IO.Swagger/Models/Certificate.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Certificate : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Certificate left, Certificate right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs index daee04c35..3aeaf2f3e 100644 --- a/src/IO.Swagger/Models/ConceptDescription.cs +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ConceptDescription : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets IsCaseOf /// - [DataMember(Name="isCaseOf")] + [DataMember(Name = "isCaseOf")] public List IsCaseOf { get; set; } /// @@ -58,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -85,12 +81,12 @@ public bool Equals(ConceptDescription other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( IsCaseOf == other.IsCaseOf || IsCaseOf != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (IsCaseOf != null) + if (IsCaseOf != null) hashCode = hashCode * 59 + IsCaseOf.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ConceptDescription left, ConceptDescription right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs index ec4b27a12..fcaeebc4a 100644 --- a/src/IO.Swagger/Models/Constraint.cs +++ b/src/IO.Swagger/Models/Constraint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Constraint : IEquatable - { + { /// /// Gets or Sets ModelType /// [Required] - [DataMember(Name="modelType")] + [DataMember(Name = "modelType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelType ModelType { get; set; } public ModelType ModelType { get; set; } @@ -80,7 +75,7 @@ public bool Equals(Constraint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ModelType == other.ModelType || ModelType != null && @@ -98,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ModelType != null) + if (ModelType != null) hashCode = hashCode * 59 + ModelType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Constraint left, Constraint right) { @@ -117,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs index 03e2b6ab0..1afee42c4 100644 --- a/src/IO.Swagger/Models/DataElement.cs +++ b/src/IO.Swagger/Models/DataElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataElement left, DataElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs index 73470a843..a8e3dbeb0 100644 --- a/src/IO.Swagger/Models/DataSpecificationContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationContent : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationContent left, DataSpecificationContent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs index 35597f732..770354aae 100644 --- a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -7,44 +7,41 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable - { + { /// /// Gets or Sets DataType /// - [DataMember(Name="dataType")] + [DataMember(Name = "dataType")] public string DataType { get; set; } /// /// Gets or Sets Definition /// - [DataMember(Name="definition")] + [DataMember(Name = "definition")] public List Definition { get; set; } /// /// Gets or Sets LevelType /// - [DataMember(Name="levelType")] + [DataMember(Name = "levelType")] public List LevelType { get; set; } /// @@ -52,56 +49,56 @@ public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable< /// [Required] - [DataMember(Name="preferredName")] + [DataMember(Name = "preferredName")] public List PreferredName { get; set; } /// /// Gets or Sets ShortName /// - [DataMember(Name="shortName")] + [DataMember(Name = "shortName")] public List ShortName { get; set; } /// /// Gets or Sets SourceOfDefinition /// - [DataMember(Name="sourceOfDefinition")] + [DataMember(Name = "sourceOfDefinition")] public string SourceOfDefinition { get; set; } /// /// Gets or Sets Symbol /// - [DataMember(Name="symbol")] + [DataMember(Name = "symbol")] public string Symbol { get; set; } /// /// Gets or Sets Unit /// - [DataMember(Name="unit")] + [DataMember(Name = "unit")] public string Unit { get; set; } /// /// Gets or Sets UnitId /// - [DataMember(Name="unitId")] + [DataMember(Name = "unitId")] public Reference UnitId { get; set; } /// /// Gets or Sets ValueFormat /// - [DataMember(Name="valueFormat")] + [DataMember(Name = "valueFormat")] public string ValueFormat { get; set; } /// /// Gets or Sets ValueList /// - [DataMember(Name="valueList")] + [DataMember(Name = "valueList")] public ValueList ValueList { get; set; } /// @@ -131,7 +128,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -158,57 +155,57 @@ public bool Equals(DataSpecificationIEC61360Content other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( DataType == other.DataType || DataType != null && DataType.Equals(other.DataType) - ) && + ) && ( Definition == other.Definition || Definition != null && Definition.SequenceEqual(other.Definition) - ) && + ) && ( LevelType == other.LevelType || LevelType != null && LevelType.SequenceEqual(other.LevelType) - ) && + ) && ( PreferredName == other.PreferredName || PreferredName != null && PreferredName.SequenceEqual(other.PreferredName) - ) && + ) && ( ShortName == other.ShortName || ShortName != null && ShortName.SequenceEqual(other.ShortName) - ) && + ) && ( SourceOfDefinition == other.SourceOfDefinition || SourceOfDefinition != null && SourceOfDefinition.Equals(other.SourceOfDefinition) - ) && + ) && ( Symbol == other.Symbol || Symbol != null && Symbol.Equals(other.Symbol) - ) && + ) && ( Unit == other.Unit || Unit != null && Unit.Equals(other.Unit) - ) && + ) && ( UnitId == other.UnitId || UnitId != null && UnitId.Equals(other.UnitId) - ) && + ) && ( ValueFormat == other.ValueFormat || ValueFormat != null && ValueFormat.Equals(other.ValueFormat) - ) && + ) && ( ValueList == other.ValueList || ValueList != null && @@ -226,34 +223,34 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (DataType != null) + if (DataType != null) hashCode = hashCode * 59 + DataType.GetHashCode(); - if (Definition != null) + if (Definition != null) hashCode = hashCode * 59 + Definition.GetHashCode(); - if (LevelType != null) + if (LevelType != null) hashCode = hashCode * 59 + LevelType.GetHashCode(); - if (PreferredName != null) + if (PreferredName != null) hashCode = hashCode * 59 + PreferredName.GetHashCode(); - if (ShortName != null) + if (ShortName != null) hashCode = hashCode * 59 + ShortName.GetHashCode(); - if (SourceOfDefinition != null) + if (SourceOfDefinition != null) hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); - if (Symbol != null) + if (Symbol != null) hashCode = hashCode * 59 + Symbol.GetHashCode(); - if (Unit != null) + if (Unit != null) hashCode = hashCode * 59 + Unit.GetHashCode(); - if (UnitId != null) + if (UnitId != null) hashCode = hashCode * 59 + UnitId.GetHashCode(); - if (ValueFormat != null) + if (ValueFormat != null) hashCode = hashCode * 59 + ValueFormat.GetHashCode(); - if (ValueList != null) + if (ValueList != null) hashCode = hashCode * 59 + ValueList.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) { @@ -265,7 +262,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs index f72ad4d3b..e7324e909 100644 --- a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationPhysicalUnitContent : IEquatable - { + { /// /// Gets or Sets ConversionFactor /// - [DataMember(Name="conversionFactor")] + [DataMember(Name = "conversionFactor")] public string ConversionFactor { get; set; } /// @@ -38,70 +35,70 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="definition")] + [DataMember(Name = "definition")] public List Definition { get; set; } /// /// Gets or Sets DinNotation /// - [DataMember(Name="dinNotation")] + [DataMember(Name = "dinNotation")] public string DinNotation { get; set; } /// /// Gets or Sets EceCode /// - [DataMember(Name="eceCode")] + [DataMember(Name = "eceCode")] public string EceCode { get; set; } /// /// Gets or Sets EceName /// - [DataMember(Name="eceName")] + [DataMember(Name = "eceName")] public string EceName { get; set; } /// /// Gets or Sets NistName /// - [DataMember(Name="nistName")] + [DataMember(Name = "nistName")] public string NistName { get; set; } /// /// Gets or Sets RegistrationAuthorityId /// - [DataMember(Name="registrationAuthorityId")] + [DataMember(Name = "registrationAuthorityId")] public string RegistrationAuthorityId { get; set; } /// /// Gets or Sets SiName /// - [DataMember(Name="siName")] + [DataMember(Name = "siName")] public string SiName { get; set; } /// /// Gets or Sets SiNotation /// - [DataMember(Name="siNotation")] + [DataMember(Name = "siNotation")] public string SiNotation { get; set; } /// /// Gets or Sets SourceOfDefinition /// - [DataMember(Name="sourceOfDefinition")] + [DataMember(Name = "sourceOfDefinition")] public string SourceOfDefinition { get; set; } /// /// Gets or Sets Supplier /// - [DataMember(Name="supplier")] + [DataMember(Name = "supplier")] public string Supplier { get; set; } /// @@ -109,7 +106,7 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="unitName")] + [DataMember(Name = "unitName")] public string UnitName { get; set; } /// @@ -117,7 +114,7 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="unitSymbol")] + [DataMember(Name = "unitSymbol")] public string UnitSymbol { get; set; } /// @@ -176,67 +173,67 @@ public bool Equals(DataSpecificationPhysicalUnitContent other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ConversionFactor == other.ConversionFactor || ConversionFactor != null && ConversionFactor.Equals(other.ConversionFactor) - ) && + ) && ( Definition == other.Definition || Definition != null && Definition.SequenceEqual(other.Definition) - ) && + ) && ( DinNotation == other.DinNotation || DinNotation != null && DinNotation.Equals(other.DinNotation) - ) && + ) && ( EceCode == other.EceCode || EceCode != null && EceCode.Equals(other.EceCode) - ) && + ) && ( EceName == other.EceName || EceName != null && EceName.Equals(other.EceName) - ) && + ) && ( NistName == other.NistName || NistName != null && NistName.Equals(other.NistName) - ) && + ) && ( RegistrationAuthorityId == other.RegistrationAuthorityId || RegistrationAuthorityId != null && RegistrationAuthorityId.Equals(other.RegistrationAuthorityId) - ) && + ) && ( SiName == other.SiName || SiName != null && SiName.Equals(other.SiName) - ) && + ) && ( SiNotation == other.SiNotation || SiNotation != null && SiNotation.Equals(other.SiNotation) - ) && + ) && ( SourceOfDefinition == other.SourceOfDefinition || SourceOfDefinition != null && SourceOfDefinition.Equals(other.SourceOfDefinition) - ) && + ) && ( Supplier == other.Supplier || Supplier != null && Supplier.Equals(other.Supplier) - ) && + ) && ( UnitName == other.UnitName || UnitName != null && UnitName.Equals(other.UnitName) - ) && + ) && ( UnitSymbol == other.UnitSymbol || UnitSymbol != null && @@ -254,38 +251,38 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ConversionFactor != null) + if (ConversionFactor != null) hashCode = hashCode * 59 + ConversionFactor.GetHashCode(); - if (Definition != null) + if (Definition != null) hashCode = hashCode * 59 + Definition.GetHashCode(); - if (DinNotation != null) + if (DinNotation != null) hashCode = hashCode * 59 + DinNotation.GetHashCode(); - if (EceCode != null) + if (EceCode != null) hashCode = hashCode * 59 + EceCode.GetHashCode(); - if (EceName != null) + if (EceName != null) hashCode = hashCode * 59 + EceName.GetHashCode(); - if (NistName != null) + if (NistName != null) hashCode = hashCode * 59 + NistName.GetHashCode(); - if (RegistrationAuthorityId != null) + if (RegistrationAuthorityId != null) hashCode = hashCode * 59 + RegistrationAuthorityId.GetHashCode(); - if (SiName != null) + if (SiName != null) hashCode = hashCode * 59 + SiName.GetHashCode(); - if (SiNotation != null) + if (SiNotation != null) hashCode = hashCode * 59 + SiNotation.GetHashCode(); - if (SourceOfDefinition != null) + if (SourceOfDefinition != null) hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); - if (Supplier != null) + if (Supplier != null) hashCode = hashCode * 59 + Supplier.GetHashCode(); - if (UnitName != null) + if (UnitName != null) hashCode = hashCode * 59 + UnitName.GetHashCode(); - if (UnitSymbol != null) + if (UnitSymbol != null) hashCode = hashCode * 59 + UnitSymbol.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) { @@ -297,7 +294,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs index c21e05e0f..ec35e951a 100644 --- a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class EmbeddedDataSpecification : IEquatable - { + { /// /// Gets or Sets DataSpecification /// [Required] - [DataMember(Name="dataSpecification")] + [DataMember(Name = "dataSpecification")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DataSpecification { get; set; } public Reference DataSpecification { get; set; } @@ -41,7 +36,7 @@ public partial class EmbeddedDataSpecification : IEquatable [Required] - [DataMember(Name="dataSpecificationContent")] + [DataMember(Name = "dataSpecificationContent")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasDataSpecificationContent DataSpecificationContent { get; set; } public DataSpecificationContent DataSpecificationContent { get; set; } @@ -91,12 +86,12 @@ public bool Equals(EmbeddedDataSpecification other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( DataSpecification == other.DataSpecification || DataSpecification != null && DataSpecification.Equals(other.DataSpecification) - ) && + ) && ( DataSpecificationContent == other.DataSpecificationContent || DataSpecificationContent != null && @@ -114,16 +109,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (DataSpecification != null) + if (DataSpecification != null) hashCode = hashCode * 59 + DataSpecification.GetHashCode(); - if (DataSpecificationContent != null) + if (DataSpecificationContent != null) hashCode = hashCode * 59 + DataSpecificationContent.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(EmbeddedDataSpecification left, EmbeddedDataSpecification right) { @@ -135,7 +130,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs index 49a3d9a09..0b1046298 100644 --- a/src/IO.Swagger/Models/Entity.cs +++ b/src/IO.Swagger/Models/Entity.cs @@ -7,52 +7,49 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Entity : SubmodelElement, IEquatable - { + { /// /// Gets or Sets EntityType /// [Required] - [DataMember(Name="entityType")] + [DataMember(Name = "entityType")] public EntityType EntityType { get; set; } /// /// Gets or Sets GlobalAssetId /// - [DataMember(Name="globalAssetId")] + [DataMember(Name = "globalAssetId")] public Reference GlobalAssetId { get; set; } /// /// Gets or Sets SpecificAssetIds /// - [DataMember(Name="specificAssetIds")] + [DataMember(Name = "specificAssetIds")] public List SpecificAssetIds { get; set; } /// /// Gets or Sets Statements /// - [DataMember(Name="statements")] + [DataMember(Name = "statements")] public List Statements { get; set; } /// @@ -75,7 +72,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -102,22 +99,22 @@ public bool Equals(Entity other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EntityType == other.EntityType || EntityType != null && EntityType.Equals(other.EntityType) - ) && + ) && ( GlobalAssetId == other.GlobalAssetId || GlobalAssetId != null && GlobalAssetId.Equals(other.GlobalAssetId) - ) && + ) && ( SpecificAssetIds == other.SpecificAssetIds || SpecificAssetIds != null && SpecificAssetIds.SequenceEqual(other.SpecificAssetIds) - ) && + ) && ( Statements == other.Statements || Statements != null && @@ -135,20 +132,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EntityType != null) + if (EntityType != null) hashCode = hashCode * 59 + EntityType.GetHashCode(); - if (GlobalAssetId != null) + if (GlobalAssetId != null) hashCode = hashCode * 59 + GlobalAssetId.GetHashCode(); - if (SpecificAssetIds != null) + if (SpecificAssetIds != null) hashCode = hashCode * 59 + SpecificAssetIds.GetHashCode(); - if (Statements != null) + if (Statements != null) hashCode = hashCode * 59 + Statements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Entity left, Entity right) { @@ -160,7 +157,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs index 569dcd10d..d06093904 100644 --- a/src/IO.Swagger/Models/EntityType.cs +++ b/src/IO.Swagger/Models/EntityType.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets EntityType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum EntityType + { + /// + /// Enum CoManagedEntityEnum for CoManagedEntity + /// + [EnumMember(Value = "CoManagedEntity")] + CoManagedEntityEnum = 0, /// - /// Gets or Sets EntityType + /// Enum SelfManagedEntityEnum for SelfManagedEntity /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum EntityType - { - /// - /// Enum CoManagedEntityEnum for CoManagedEntity - /// - [EnumMember(Value = "CoManagedEntity")] - CoManagedEntityEnum = 0, - /// - /// Enum SelfManagedEntityEnum for SelfManagedEntity - /// - [EnumMember(Value = "SelfManagedEntity")] - SelfManagedEntityEnum = 1 } + [EnumMember(Value = "SelfManagedEntity")] + SelfManagedEntityEnum = 1 + } } diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs index 48d5cad95..509f42692 100644 --- a/src/IO.Swagger/Models/Extension.cs +++ b/src/IO.Swagger/Models/Extension.cs @@ -7,52 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Extension : HasSemantics, IEquatable - { + { /// /// Gets or Sets Name /// [Required] - [DataMember(Name="name")] + [DataMember(Name = "name")] public string Name { get; set; } /// /// Gets or Sets RefersTo /// - [DataMember(Name="refersTo")] + [DataMember(Name = "refersTo")] public Reference RefersTo { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] public ValueTypeEnum ValueType { get; set; } /// @@ -75,7 +70,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -102,22 +97,22 @@ public bool Equals(Extension other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Name == other.Name || Name != null && Name.Equals(other.Name) - ) && + ) && ( RefersTo == other.RefersTo || RefersTo != null && RefersTo.Equals(other.RefersTo) - ) && + ) && ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -135,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Name != null) + if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); - if (RefersTo != null) + if (RefersTo != null) hashCode = hashCode * 59 + RefersTo.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Extension left, Extension right) { @@ -160,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs index 330434ae0..e1a4ce7f8 100644 --- a/src/IO.Swagger/Models/File.cs +++ b/src/IO.Swagger/Models/File.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class File : SubmodelElement, IEquatable - { + { /// /// Gets or Sets MimeType /// [Required] - [DataMember(Name="mimeType")] + [DataMember(Name = "mimeType")] public string MimeType { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(File other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( MimeType == other.MimeType || MimeType != null && MimeType.Equals(other.MimeType) - ) && + ) && ( Value == other.Value || Value != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (MimeType != null) + if (MimeType != null) hashCode = hashCode * 59 + MimeType.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(File left, File right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs index 1214dc664..2e98ffb87 100644 --- a/src/IO.Swagger/Models/Formula.cs +++ b/src/IO.Swagger/Models/Formula.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Formula : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Formula left, Formula right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs index 1b3123530..276ab1d21 100644 --- a/src/IO.Swagger/Models/GlobalReference.cs +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class GlobalReference : Reference, IEquatable - { + { /// /// Gets or Sets Value /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// @@ -51,7 +48,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -78,7 +75,7 @@ public bool Equals(GlobalReference other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -96,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(GlobalReference left, GlobalReference right) { @@ -115,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs index e901e1f31..428b707cf 100644 --- a/src/IO.Swagger/Models/HasDataSpecification.cs +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasDataSpecification : IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(HasDataSpecification other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasDataSpecification left, HasDataSpecification right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs index 3f0120412..2d4b0289b 100644 --- a/src/IO.Swagger/Models/HasExtensions.cs +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasExtensions : IEquatable - { + { /// /// Gets or Sets Extensions /// - [DataMember(Name="extensions")] + [DataMember(Name = "extensions")] public List Extensions { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(HasExtensions other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Extensions == other.Extensions || Extensions != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Extensions != null) + if (Extensions != null) hashCode = hashCode * 59 + Extensions.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasExtensions left, HasExtensions right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs index bfc6dbf15..9f42763ec 100644 --- a/src/IO.Swagger/Models/HasSemantics.cs +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasSemantics : IEquatable - { + { /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -79,7 +73,7 @@ public bool Equals(HasSemantics other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( SemanticId == other.SemanticId || SemanticId != null && @@ -97,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasSemantics left, HasSemantics right) { @@ -116,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs index 486255b3f..c9bccffab 100644 --- a/src/IO.Swagger/Models/Identifiable.cs +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -7,30 +7,25 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Identifiable : Referable, IEquatable - { + { /// /// Gets or Sets Administration /// - [DataMember(Name="administration")] + [DataMember(Name = "administration")] public AdministrativeInformation Administration { get; set; } /// @@ -38,7 +33,7 @@ public partial class Identifiable : Referable, IEquatable /// [Required] - [DataMember(Name="identification")] + [DataMember(Name = "identification")] public string Identification { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(Identifiable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Administration == other.Administration || Administration != null && Administration.Equals(other.Administration) - ) && + ) && ( Identification == other.Identification || Identification != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Administration != null) + if (Administration != null) hashCode = hashCode * 59 + Administration.GetHashCode(); - if (Identification != null) + if (Identification != null) hashCode = hashCode * 59 + Identification.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Identifiable left, Identifiable right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs index e71676d8b..e2f40777b 100644 --- a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class IdentifierKeyValuePair : HasSemantics, IEquatable - { + { /// /// Gets or Sets Key /// [Required] - [DataMember(Name="key")] + [DataMember(Name = "key")] public string Key { get; set; } /// @@ -39,7 +34,7 @@ public partial class IdentifierKeyValuePair : HasSemantics, IEquatable [Required] - [DataMember(Name="subjectId")] + [DataMember(Name = "subjectId")] public Reference SubjectId { get; set; } /// @@ -47,7 +42,7 @@ public partial class IdentifierKeyValuePair : HasSemantics, IEquatable [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -69,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -96,17 +91,17 @@ public bool Equals(IdentifierKeyValuePair other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Key == other.Key || Key != null && Key.Equals(other.Key) - ) && + ) && ( SubjectId == other.SubjectId || SubjectId != null && SubjectId.Equals(other.SubjectId) - ) && + ) && ( Value == other.Value || Value != null && @@ -124,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Key != null) + if (Key != null) hashCode = hashCode * 59 + Key.GetHashCode(); - if (SubjectId != null) + if (SubjectId != null) hashCode = hashCode * 59 + SubjectId.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) { @@ -147,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs index eeed899eb..25c6aae9e 100644 --- a/src/IO.Swagger/Models/Key.cs +++ b/src/IO.Swagger/Models/Key.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Key : IEquatable - { + { /// /// Gets or Sets Type /// [Required] - [DataMember(Name="type")] + [DataMember(Name = "type")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasKeyElements Type { get; set; } public KeyElements Type { get; set; } @@ -41,7 +36,7 @@ public partial class Key : IEquatable /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -89,12 +84,12 @@ public bool Equals(Key other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Type == other.Type || Type != null && Type.Equals(other.Type) - ) && + ) && ( Value == other.Value || Value != null && @@ -112,16 +107,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Type != null) + if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Key left, Key right) { @@ -133,7 +128,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs index ab4fe4203..8411b8dbb 100644 --- a/src/IO.Swagger/Models/KeyElements.cs +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -7,138 +7,131 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets KeyElements - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum KeyElements - { - /// - /// Enum AssetAdministrationShellEnum for AssetAdministrationShell - /// - [EnumMember(Value = "AssetAdministrationShell")] - AssetAdministrationShellEnum = 0, - /// - /// Enum AccessPermissionRuleEnum for AccessPermissionRule - /// - [EnumMember(Value = "AccessPermissionRule")] - AccessPermissionRuleEnum = 1, - /// - /// Enum ConceptDescriptionEnum for ConceptDescription - /// - [EnumMember(Value = "ConceptDescription")] - ConceptDescriptionEnum = 2, - /// - /// Enum SubmodelEnum for Submodel - /// - [EnumMember(Value = "Submodel")] - SubmodelEnum = 3, - /// - /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement - /// - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElementEnum = 4, - /// - /// Enum BasicEventEnum for BasicEvent - /// - [EnumMember(Value = "BasicEvent")] - BasicEventEnum = 5, - /// - /// Enum BlobEnum for Blob - /// - [EnumMember(Value = "Blob")] - BlobEnum = 6, - /// - /// Enum CapabilityEnum for Capability - /// - [EnumMember(Value = "Capability")] - CapabilityEnum = 7, - /// - /// Enum DataElementEnum for DataElement - /// - [EnumMember(Value = "DataElement")] - DataElementEnum = 8, - /// - /// Enum FileEnum for File - /// - [EnumMember(Value = "File")] - FileEnum = 9, - /// - /// Enum EntityEnum for Entity - /// - [EnumMember(Value = "Entity")] - EntityEnum = 10, - /// - /// Enum EventEnum for Event - /// - [EnumMember(Value = "Event")] - EventEnum = 11, - /// - /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty - /// - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguagePropertyEnum = 12, - /// - /// Enum OperationEnum for Operation - /// - [EnumMember(Value = "Operation")] - OperationEnum = 13, - /// - /// Enum PropertyEnum for Property - /// - [EnumMember(Value = "Property")] - PropertyEnum = 14, - /// - /// Enum RangeEnum for Range - /// - [EnumMember(Value = "Range")] - RangeEnum = 15, - /// - /// Enum ReferenceElementEnum for ReferenceElement - /// - [EnumMember(Value = "ReferenceElement")] - ReferenceElementEnum = 16, - /// - /// Enum RelationshipElementEnum for RelationshipElement - /// - [EnumMember(Value = "RelationshipElement")] - RelationshipElementEnum = 17, - /// - /// Enum SubmodelElementEnum for SubmodelElement - /// - [EnumMember(Value = "SubmodelElement")] - SubmodelElementEnum = 18, - /// - /// Enum SubmodelElementListEnum for SubmodelElementList - /// - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementListEnum = 19, - /// - /// Enum SubmodelElementStructEnum for SubmodelElementStruct - /// - [EnumMember(Value = "SubmodelElementStruct")] - SubmodelElementStructEnum = 20, - /// - /// Enum ViewEnum for View - /// - [EnumMember(Value = "View")] - ViewEnum = 21, - /// - /// Enum FragmentReferenceEnum for FragmentReference - /// - [EnumMember(Value = "FragmentReference")] - FragmentReferenceEnum = 22 } +{ + /// + /// Gets or Sets KeyElements + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KeyElements + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum AccessPermissionRuleEnum for AccessPermissionRule + /// + [EnumMember(Value = "AccessPermissionRule")] + AccessPermissionRuleEnum = 1, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 2, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 3, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 4, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 5, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 6, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 7, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 8, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 9, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 10, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 22 + } } diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs index 88d7f5203..436f236cb 100644 --- a/src/IO.Swagger/Models/LangString.cs +++ b/src/IO.Swagger/Models/LangString.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class LangString : IEquatable - { + { /// /// Gets or Sets Language /// [Required] - [DataMember(Name="language")] + [DataMember(Name = "language")] public string Language { get; set; } /// @@ -39,7 +34,7 @@ public partial class LangString : IEquatable /// [Required] - [DataMember(Name="text")] + [DataMember(Name = "text")] public string Text { get; set; } /// @@ -87,12 +82,12 @@ public bool Equals(LangString other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Language == other.Language || Language != null && Language.Equals(other.Language) - ) && + ) && ( Text == other.Text || Text != null && @@ -110,16 +105,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Language != null) + if (Language != null) hashCode = hashCode * 59 + Language.GetHashCode(); - if (Text != null) + if (Text != null) hashCode = hashCode * 59 + Text.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(LangString left, LangString right) { @@ -131,7 +126,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs index a638d02b6..a6ac1fdd5 100644 --- a/src/IO.Swagger/Models/LevelType.cs +++ b/src/IO.Swagger/Models/LevelType.cs @@ -7,43 +7,36 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets LevelType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum LevelType + { + /// + /// Enum MinEnum for Min + /// + [EnumMember(Value = "Min")] + MinEnum = 0, + /// + /// Enum MaxEnum for Max + /// + [EnumMember(Value = "Max")] + MaxEnum = 1, + /// + /// Enum NomEnum for Nom + /// + [EnumMember(Value = "Nom")] + NomEnum = 2, /// - /// Gets or Sets LevelType + /// Enum TypEnum for Typ /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum LevelType - { - /// - /// Enum MinEnum for Min - /// - [EnumMember(Value = "Min")] - MinEnum = 0, - /// - /// Enum MaxEnum for Max - /// - [EnumMember(Value = "Max")] - MaxEnum = 1, - /// - /// Enum NomEnum for Nom - /// - [EnumMember(Value = "Nom")] - NomEnum = 2, - /// - /// Enum TypEnum for Typ - /// - [EnumMember(Value = "Typ")] - TypEnum = 3 } + [EnumMember(Value = "Typ")] + TypEnum = 3 + } } diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs index b83d19d4c..7f8b3e662 100644 --- a/src/IO.Swagger/Models/Message.cs +++ b/src/IO.Swagger/Models/Message.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Message : IEquatable - { + { /// /// Gets or Sets Code /// - [DataMember(Name="code")] + [DataMember(Name = "code")] public string Code { get; set; } /// @@ -63,27 +57,28 @@ public enum MessageTypeEnum /// Enum ExceptionEnum for Exception /// [EnumMember(Value = "Exception")] - ExceptionEnum = 4 } + ExceptionEnum = 4 + } /// /// Gets or Sets MessageType /// - [DataMember(Name="messageType")] + [DataMember(Name = "messageType")] public MessageTypeEnum? MessageType { get; set; } /// /// Gets or Sets Text /// - [DataMember(Name="text")] + [DataMember(Name = "text")] public string Text { get; set; } /// /// Gets or Sets Timestamp /// - [DataMember(Name="timestamp")] + [DataMember(Name = "timestamp")] public string Timestamp { get; set; } /// @@ -133,22 +128,22 @@ public bool Equals(Message other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Code == other.Code || Code != null && Code.Equals(other.Code) - ) && + ) && ( MessageType == other.MessageType || MessageType != null && MessageType.Equals(other.MessageType) - ) && + ) && ( Text == other.Text || Text != null && Text.Equals(other.Text) - ) && + ) && ( Timestamp == other.Timestamp || Timestamp != null && @@ -166,20 +161,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Code != null) + if (Code != null) hashCode = hashCode * 59 + Code.GetHashCode(); - if (MessageType != null) + if (MessageType != null) hashCode = hashCode * 59 + MessageType.GetHashCode(); - if (Text != null) + if (Text != null) hashCode = hashCode * 59 + Text.GetHashCode(); - if (Timestamp != null) + if (Timestamp != null) hashCode = hashCode * 59 + Timestamp.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Message left, Message right) { @@ -191,7 +186,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs index 49065b6ef..d44e568c8 100644 --- a/src/IO.Swagger/Models/ModelEvent.cs +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelEvent : SubmodelElement, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelEvent left, ModelEvent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs index a297f5f82..4bb50c07f 100644 --- a/src/IO.Swagger/Models/ModelReference.cs +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelReference : Reference, IEquatable - { + { /// /// Gets or Sets ReferredSemanticId /// - [DataMember(Name="referredSemanticId")] + [DataMember(Name = "referredSemanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ReferredSemanticId { get; set; } public Reference ReferredSemanticId { get; set; } @@ -40,7 +37,7 @@ public partial class ModelReference : Reference, IEquatable /// [Required] - [DataMember(Name="keys")] + [DataMember(Name = "keys")] public List Keys { get; set; } /// @@ -61,7 +58,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -88,12 +85,12 @@ public bool Equals(ModelReference other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ReferredSemanticId == other.ReferredSemanticId || ReferredSemanticId != null && ReferredSemanticId.Equals(other.ReferredSemanticId) - ) && + ) && ( Keys == other.Keys || Keys != null && @@ -111,16 +108,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ReferredSemanticId != null) + if (ReferredSemanticId != null) hashCode = hashCode * 59 + ReferredSemanticId.GetHashCode(); - if (Keys != null) + if (Keys != null) hashCode = hashCode * 59 + Keys.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelReference left, ModelReference right) { @@ -132,7 +129,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs index b75e6b0f8..6b785aee2 100644 --- a/src/IO.Swagger/Models/ModelType.cs +++ b/src/IO.Swagger/Models/ModelType.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelType : IEquatable - { + { /// /// Gets or Sets Name /// [Required] - [DataMember(Name="name")] + [DataMember(Name = "name")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelTypes Name { get; set; } public ModelTypes Name { get; set; } @@ -80,7 +75,7 @@ public bool Equals(ModelType other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Name == other.Name || Name != null && @@ -98,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Name != null) + if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelType left, ModelType right) { @@ -117,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs index 2a7d418c9..80f71ca5e 100644 --- a/src/IO.Swagger/Models/ModelTypes.cs +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -7,158 +7,151 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets ModelTypes - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ModelTypes - { - /// - /// Enum AssetAdministrationShellEnum for AssetAdministrationShell - /// - [EnumMember(Value = "AssetAdministrationShell")] - AssetAdministrationShellEnum = 0, - /// - /// Enum ConceptDescriptionEnum for ConceptDescription - /// - [EnumMember(Value = "ConceptDescription")] - ConceptDescriptionEnum = 1, - /// - /// Enum SubmodelEnum for Submodel - /// - [EnumMember(Value = "Submodel")] - SubmodelEnum = 2, - /// - /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement - /// - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElementEnum = 3, - /// - /// Enum BasicEventEnum for BasicEvent - /// - [EnumMember(Value = "BasicEvent")] - BasicEventEnum = 4, - /// - /// Enum BlobEnum for Blob - /// - [EnumMember(Value = "Blob")] - BlobEnum = 5, - /// - /// Enum CapabilityEnum for Capability - /// - [EnumMember(Value = "Capability")] - CapabilityEnum = 6, - /// - /// Enum DataElementEnum for DataElement - /// - [EnumMember(Value = "DataElement")] - DataElementEnum = 7, - /// - /// Enum FileEnum for File - /// - [EnumMember(Value = "File")] - FileEnum = 8, - /// - /// Enum EntityEnum for Entity - /// - [EnumMember(Value = "Entity")] - EntityEnum = 9, - /// - /// Enum EventEnum for Event - /// - [EnumMember(Value = "Event")] - EventEnum = 10, - /// - /// Enum ModelReferenceEnum for ModelReference - /// - [EnumMember(Value = "ModelReference")] - ModelReferenceEnum = 11, - /// - /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty - /// - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguagePropertyEnum = 12, - /// - /// Enum OperationEnum for Operation - /// - [EnumMember(Value = "Operation")] - OperationEnum = 13, - /// - /// Enum PropertyEnum for Property - /// - [EnumMember(Value = "Property")] - PropertyEnum = 14, - /// - /// Enum RangeEnum for Range - /// - [EnumMember(Value = "Range")] - RangeEnum = 15, - /// - /// Enum ReferenceElementEnum for ReferenceElement - /// - [EnumMember(Value = "ReferenceElement")] - ReferenceElementEnum = 16, - /// - /// Enum RelationshipElementEnum for RelationshipElement - /// - [EnumMember(Value = "RelationshipElement")] - RelationshipElementEnum = 17, - /// - /// Enum SubmodelElementEnum for SubmodelElement - /// - [EnumMember(Value = "SubmodelElement")] - SubmodelElementEnum = 18, - /// - /// Enum SubmodelElementListEnum for SubmodelElementList - /// - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementListEnum = 19, - /// - /// Enum SubmodelElementStructEnum for SubmodelElementStruct - /// - [EnumMember(Value = "SubmodelElementStruct")] - SubmodelElementStructEnum = 20, - /// - /// Enum ViewEnum for View - /// - [EnumMember(Value = "View")] - ViewEnum = 21, - /// - /// Enum GlobalReferenceEnum for GlobalReference - /// - [EnumMember(Value = "GlobalReference")] - GlobalReferenceEnum = 22, - /// - /// Enum FragmentReferenceEnum for FragmentReference - /// - [EnumMember(Value = "FragmentReference")] - FragmentReferenceEnum = 23, - /// - /// Enum ConstraintEnum for Constraint - /// - [EnumMember(Value = "Constraint")] - ConstraintEnum = 24, - /// - /// Enum FormulaEnum for Formula - /// - [EnumMember(Value = "Formula")] - FormulaEnum = 25, - /// - /// Enum QualifierEnum for Qualifier - /// - [EnumMember(Value = "Qualifier")] - QualifierEnum = 26 } +{ + /// + /// Gets or Sets ModelTypes + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelTypes + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 1, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 2, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 3, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 4, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 5, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 6, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 7, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 8, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 9, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 10, + /// + /// Enum ModelReferenceEnum for ModelReference + /// + [EnumMember(Value = "ModelReference")] + ModelReferenceEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum GlobalReferenceEnum for GlobalReference + /// + [EnumMember(Value = "GlobalReference")] + GlobalReferenceEnum = 22, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 23, + /// + /// Enum ConstraintEnum for Constraint + /// + [EnumMember(Value = "Constraint")] + ConstraintEnum = 24, + /// + /// Enum FormulaEnum for Formula + /// + [EnumMember(Value = "Formula")] + FormulaEnum = 25, + /// + /// Enum QualifierEnum for Qualifier + /// + [EnumMember(Value = "Qualifier")] + QualifierEnum = 26 + } } diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs index 3aaf4f82e..6aa0183e5 100644 --- a/src/IO.Swagger/Models/ModelingKind.cs +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets ModelingKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelingKind + { + /// + /// Enum TemplateEnum for Template + /// + [EnumMember(Value = "Template")] + TemplateEnum = 0, /// - /// Gets or Sets ModelingKind + /// Enum InstanceEnum for Instance /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ModelingKind - { - /// - /// Enum TemplateEnum for Template - /// - [EnumMember(Value = "Template")] - TemplateEnum = 0, - /// - /// Enum InstanceEnum for Instance - /// - [EnumMember(Value = "Instance")] - InstanceEnum = 1 } + [EnumMember(Value = "Instance")] + InstanceEnum = 1 + } } diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs index 952db25c5..18bbd8992 100644 --- a/src/IO.Swagger/Models/MultiLanguageProperty.cs +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class MultiLanguageProperty : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] public Reference ValueId { get; set; } /// @@ -58,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -85,12 +81,12 @@ public bool Equals(MultiLanguageProperty other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.SequenceEqual(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(MultiLanguageProperty left, MultiLanguageProperty right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs index 66fb952f5..3c09f5e23 100644 --- a/src/IO.Swagger/Models/ObjectAttributes.cs +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ObjectAttributes : IEquatable - { + { /// /// Gets or Sets ObjectAttribute /// - [DataMember(Name="objectAttribute")] + [DataMember(Name = "objectAttribute")] public List ObjectAttribute { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(ObjectAttributes other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ObjectAttribute == other.ObjectAttribute || ObjectAttribute != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ObjectAttribute != null) + if (ObjectAttribute != null) hashCode = hashCode * 59 + ObjectAttribute.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ObjectAttributes left, ObjectAttributes right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs index 1f33b2292..1b74da745 100644 --- a/src/IO.Swagger/Models/OneOfCertificate.cs +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfCertificate : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfCertificate left, OneOfCertificate right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs index a26901a55..e1a74771d 100644 --- a/src/IO.Swagger/Models/OneOfConstraint.cs +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfConstraint : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfConstraint left, OneOfConstraint right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs index f898be81d..dee5eafc8 100644 --- a/src/IO.Swagger/Models/OneOfDataElement.cs +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfDataElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfDataElement left, OneOfDataElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs index a7081005a..98c6cda04 100644 --- a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfDataSpecificationContent : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs index 10cded410..eb1d1e3bc 100644 --- a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfOperationVariableValue : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfOperationVariableValue left, OneOfOperationVariableValue right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs index f92a58231..b74711b83 100644 --- a/src/IO.Swagger/Models/OneOfReference.cs +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfReference : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfReference left, OneOfReference right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs index b3c6d1148..4a354c283 100644 --- a/src/IO.Swagger/Models/OneOfSubmodelElement.cs +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfSubmodelElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfSubmodelElement left, OneOfSubmodelElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs index 78b7bd9ce..fe2a28372 100644 --- a/src/IO.Swagger/Models/Operation.cs +++ b/src/IO.Swagger/Models/Operation.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Operation : SubmodelElement, IEquatable - { + { /// /// Gets or Sets InoutputVariable /// - [DataMember(Name="inoutputVariable")] + [DataMember(Name = "inoutputVariable")] public List InoutputVariable { get; set; } /// /// Gets or Sets InputVariable /// - [DataMember(Name="inputVariable")] + [DataMember(Name = "inputVariable")] public List InputVariable { get; set; } /// /// Gets or Sets OutputVariable /// - [DataMember(Name="outputVariable")] + [DataMember(Name = "outputVariable")] public List OutputVariable { get; set; } /// @@ -66,7 +62,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -93,17 +89,17 @@ public bool Equals(Operation other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( InoutputVariable == other.InoutputVariable || InoutputVariable != null && InoutputVariable.SequenceEqual(other.InoutputVariable) - ) && + ) && ( InputVariable == other.InputVariable || InputVariable != null && InputVariable.SequenceEqual(other.InputVariable) - ) && + ) && ( OutputVariable == other.OutputVariable || OutputVariable != null && @@ -121,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (InoutputVariable != null) + if (InoutputVariable != null) hashCode = hashCode * 59 + InoutputVariable.GetHashCode(); - if (InputVariable != null) + if (InputVariable != null) hashCode = hashCode * 59 + InputVariable.GetHashCode(); - if (OutputVariable != null) + if (OutputVariable != null) hashCode = hashCode * 59 + OutputVariable.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Operation left, Operation right) { @@ -144,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationHandle.cs b/src/IO.Swagger/Models/OperationHandle.cs new file mode 100644 index 000000000..a048bff6d --- /dev/null +++ b/src/IO.Swagger/Models/OperationHandle.cs @@ -0,0 +1,19 @@ +namespace IO.Swagger.Models +{ + /// + /// The returned handle of an operation’s asynchronous invocation used to request the current state of the operation’s execution. + /// + public partial class OperationHandle + { + /// + /// Client Request Id + /// + public string RequestId { get; set; } + /// + /// Handle id + /// + public string HandleId { get; set; } + + + } +} diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs index 7201d0be6..6e1536833 100644 --- a/src/IO.Swagger/Models/OperationRequest.cs +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -7,51 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationRequest : IEquatable - { + { /// /// Gets or Sets InoutputArguments /// - [DataMember(Name="inoutputArguments")] + [DataMember(Name = "inoutputArguments")] public List InoutputArguments { get; set; } /// /// Gets or Sets InputArguments /// - [DataMember(Name="inputArguments")] + [DataMember(Name = "inputArguments")] public List InputArguments { get; set; } /// /// Gets or Sets RequestId /// - [DataMember(Name="requestId")] + [DataMember(Name = "requestId")] public string RequestId { get; set; } /// /// Gets or Sets Timeout /// - [DataMember(Name="timeout")] + [DataMember(Name = "timeout")] public int? Timeout { get; set; } /// @@ -101,22 +97,22 @@ public bool Equals(OperationRequest other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( InoutputArguments == other.InoutputArguments || InoutputArguments != null && InoutputArguments.SequenceEqual(other.InoutputArguments) - ) && + ) && ( InputArguments == other.InputArguments || InputArguments != null && InputArguments.SequenceEqual(other.InputArguments) - ) && + ) && ( RequestId == other.RequestId || RequestId != null && RequestId.Equals(other.RequestId) - ) && + ) && ( Timeout == other.Timeout || Timeout != null && @@ -134,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (InoutputArguments != null) + if (InoutputArguments != null) hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); - if (InputArguments != null) + if (InputArguments != null) hashCode = hashCode * 59 + InputArguments.GetHashCode(); - if (RequestId != null) + if (RequestId != null) hashCode = hashCode * 59 + RequestId.GetHashCode(); - if (Timeout != null) + if (Timeout != null) hashCode = hashCode * 59 + Timeout.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationRequest left, OperationRequest right) { @@ -159,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs index a443d7e69..46ac8532d 100644 --- a/src/IO.Swagger/Models/OperationResult.cs +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationResult : IEquatable - { + { /// /// Gets or Sets ExecutionResult /// - [DataMember(Name="executionResult")] + [DataMember(Name = "executionResult")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasResult ExecutionResult { get; set; } public Result ExecutionResult { get; set; } @@ -70,34 +66,35 @@ public enum ExecutionStateEnum /// Enum TimeoutEnum for Timeout /// [EnumMember(Value = "Timeout")] - TimeoutEnum = 5 } + TimeoutEnum = 5 + } /// /// Gets or Sets ExecutionState /// - [DataMember(Name="executionState")] + [DataMember(Name = "executionState")] public ExecutionStateEnum? ExecutionState { get; set; } /// /// Gets or Sets InoutputArguments /// - [DataMember(Name="inoutputArguments")] + [DataMember(Name = "inoutputArguments")] public List InoutputArguments { get; set; } /// /// Gets or Sets OutputArguments /// - [DataMember(Name="outputArguments")] + [DataMember(Name = "outputArguments")] public List OutputArguments { get; set; } /// /// Gets or Sets RequestId /// - [DataMember(Name="requestId")] + [DataMember(Name = "requestId")] public string RequestId { get; set; } /// @@ -148,27 +145,27 @@ public bool Equals(OperationResult other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExecutionResult == other.ExecutionResult || ExecutionResult != null && ExecutionResult.Equals(other.ExecutionResult) - ) && + ) && ( ExecutionState == other.ExecutionState || ExecutionState != null && ExecutionState.Equals(other.ExecutionState) - ) && + ) && ( InoutputArguments == other.InoutputArguments || InoutputArguments != null && InoutputArguments.SequenceEqual(other.InoutputArguments) - ) && + ) && ( OutputArguments == other.OutputArguments || OutputArguments != null && OutputArguments.SequenceEqual(other.OutputArguments) - ) && + ) && ( RequestId == other.RequestId || RequestId != null && @@ -186,22 +183,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExecutionResult != null) + if (ExecutionResult != null) hashCode = hashCode * 59 + ExecutionResult.GetHashCode(); - if (ExecutionState != null) + if (ExecutionState != null) hashCode = hashCode * 59 + ExecutionState.GetHashCode(); - if (InoutputArguments != null) + if (InoutputArguments != null) hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); - if (OutputArguments != null) + if (OutputArguments != null) hashCode = hashCode * 59 + OutputArguments.GetHashCode(); - if (RequestId != null) + if (RequestId != null) hashCode = hashCode * 59 + RequestId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationResult left, OperationResult right) { @@ -213,7 +210,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs index 1bb9242d3..d8a0c2e37 100644 --- a/src/IO.Swagger/Models/OperationVariable.cs +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationVariable : IEquatable - { + { /// /// Gets or Sets Value /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public OneOfOperationVariableValue Value { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(OperationVariable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationVariable left, OperationVariable right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs index 3df8196a2..3215153ba 100644 --- a/src/IO.Swagger/Models/Permission.cs +++ b/src/IO.Swagger/Models/Permission.cs @@ -7,25 +7,20 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Permission : IEquatable - { + { /// /// Gets or Sets KindOfPermission /// @@ -51,14 +46,15 @@ public enum KindOfPermissionEnum /// Enum UndefinedEnum for Undefined /// [EnumMember(Value = "Undefined")] - UndefinedEnum = 3 } + UndefinedEnum = 3 + } /// /// Gets or Sets KindOfPermission /// [Required] - [DataMember(Name="kindOfPermission")] + [DataMember(Name = "kindOfPermission")] public KindOfPermissionEnum? KindOfPermission { get; set; } /// @@ -66,7 +62,7 @@ public enum KindOfPermissionEnum /// [Required] - [DataMember(Name="permission")] + [DataMember(Name = "permission")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Permission { get; set; } public Reference _Permission { get; set; } @@ -116,12 +112,12 @@ public bool Equals(Permission other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( KindOfPermission == other.KindOfPermission || KindOfPermission != null && KindOfPermission.Equals(other.KindOfPermission) - ) && + ) && ( _Permission == other._Permission || _Permission != null && @@ -139,16 +135,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (KindOfPermission != null) + if (KindOfPermission != null) hashCode = hashCode * 59 + KindOfPermission.GetHashCode(); - if (_Permission != null) + if (_Permission != null) hashCode = hashCode * 59 + _Permission.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Permission left, Permission right) { @@ -160,7 +156,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs index e4604d13c..af7c828fd 100644 --- a/src/IO.Swagger/Models/PermissionsPerObject.cs +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PermissionsPerObject : IEquatable - { + { /// /// Gets or Sets _Object /// - [DataMember(Name="object")] + [DataMember(Name = "object")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Object { get; set; } public Reference _Object { get; set; } @@ -39,14 +35,14 @@ public partial class PermissionsPerObject : IEquatable /// Gets or Sets Permission /// - [DataMember(Name="permission")] + [DataMember(Name = "permission")] public List Permission { get; set; } /// /// Gets or Sets TargetObjectAttributes /// - [DataMember(Name="targetObjectAttributes")] + [DataMember(Name = "targetObjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasObjectAttributes TargetObjectAttributes { get; set; } public ObjectAttributes TargetObjectAttributes { get; set; } @@ -97,17 +93,17 @@ public bool Equals(PermissionsPerObject other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _Object == other._Object || _Object != null && _Object.Equals(other._Object) - ) && + ) && ( Permission == other.Permission || Permission != null && Permission.SequenceEqual(other.Permission) - ) && + ) && ( TargetObjectAttributes == other.TargetObjectAttributes || TargetObjectAttributes != null && @@ -125,18 +121,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_Object != null) + if (_Object != null) hashCode = hashCode * 59 + _Object.GetHashCode(); - if (Permission != null) + if (Permission != null) hashCode = hashCode * 59 + Permission.GetHashCode(); - if (TargetObjectAttributes != null) + if (TargetObjectAttributes != null) hashCode = hashCode * 59 + TargetObjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PermissionsPerObject left, PermissionsPerObject right) { @@ -148,7 +144,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs index c5224f43e..a5bad16e1 100644 --- a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyAdministrationPoint : IEquatable - { + { /// /// Gets or Sets ExternalAccessControl /// [Required] - [DataMember(Name="externalAccessControl")] + [DataMember(Name = "externalAccessControl")] public bool? ExternalAccessControl { get; set; } /// /// Gets or Sets LocalAccessControl /// - [DataMember(Name="localAccessControl")] + [DataMember(Name = "localAccessControl")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControl LocalAccessControl { get; set; } public AccessControl LocalAccessControl { get; set; } @@ -88,12 +83,12 @@ public bool Equals(PolicyAdministrationPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalAccessControl == other.ExternalAccessControl || ExternalAccessControl != null && ExternalAccessControl.Equals(other.ExternalAccessControl) - ) && + ) && ( LocalAccessControl == other.LocalAccessControl || LocalAccessControl != null && @@ -111,16 +106,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalAccessControl != null) + if (ExternalAccessControl != null) hashCode = hashCode * 59 + ExternalAccessControl.GetHashCode(); - if (LocalAccessControl != null) + if (LocalAccessControl != null) hashCode = hashCode * 59 + LocalAccessControl.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyAdministrationPoint left, PolicyAdministrationPoint right) { @@ -132,7 +127,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs index 736a37c49..16380b049 100644 --- a/src/IO.Swagger/Models/PolicyDecisionPoint.cs +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyDecisionPoint : IEquatable - { + { /// /// Gets or Sets ExternalPolicyDecisionPoints /// [Required] - [DataMember(Name="externalPolicyDecisionPoints")] + [DataMember(Name = "externalPolicyDecisionPoints")] public bool? ExternalPolicyDecisionPoints { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(PolicyDecisionPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalPolicyDecisionPoints == other.ExternalPolicyDecisionPoints || ExternalPolicyDecisionPoints != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalPolicyDecisionPoints != null) + if (ExternalPolicyDecisionPoints != null) hashCode = hashCode * 59 + ExternalPolicyDecisionPoints.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyDecisionPoint left, PolicyDecisionPoint right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs index 97f2ed0d3..99d4742c2 100644 --- a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyEnforcementPoint : IEquatable - { + { /// /// Gets or Sets ExternalPolicyEnforcementPoint /// [Required] - [DataMember(Name="externalPolicyEnforcementPoint")] + [DataMember(Name = "externalPolicyEnforcementPoint")] public bool? ExternalPolicyEnforcementPoint { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(PolicyEnforcementPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalPolicyEnforcementPoint == other.ExternalPolicyEnforcementPoint || ExternalPolicyEnforcementPoint != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalPolicyEnforcementPoint != null) + if (ExternalPolicyEnforcementPoint != null) hashCode = hashCode * 59 + ExternalPolicyEnforcementPoint.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyEnforcementPoint left, PolicyEnforcementPoint right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs index 6cbe41c71..134741e2a 100644 --- a/src/IO.Swagger/Models/PolicyInformationPoints.cs +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -7,38 +7,35 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyInformationPoints : IEquatable - { + { /// /// Gets or Sets ExternalInformationPoint /// [Required] - [DataMember(Name="externalInformationPoint")] + [DataMember(Name = "externalInformationPoint")] public bool? ExternalInformationPoint { get; set; } /// /// Gets or Sets InternalInformationPoint /// - [DataMember(Name="internalInformationPoint")] + [DataMember(Name = "internalInformationPoint")] public List InternalInformationPoint { get; set; } /// @@ -86,12 +83,12 @@ public bool Equals(PolicyInformationPoints other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalInformationPoint == other.ExternalInformationPoint || ExternalInformationPoint != null && ExternalInformationPoint.Equals(other.ExternalInformationPoint) - ) && + ) && ( InternalInformationPoint == other.InternalInformationPoint || InternalInformationPoint != null && @@ -109,16 +106,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalInformationPoint != null) + if (ExternalInformationPoint != null) hashCode = hashCode * 59 + ExternalInformationPoint.GetHashCode(); - if (InternalInformationPoint != null) + if (InternalInformationPoint != null) hashCode = hashCode * 59 + InternalInformationPoint.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyInformationPoints left, PolicyInformationPoints right) { @@ -130,7 +127,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs index 0c2eef1dd..78b8b316e 100644 --- a/src/IO.Swagger/Models/Property.cs +++ b/src/IO.Swagger/Models/Property.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Property : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +40,7 @@ public partial class Property : SubmodelElement, IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -70,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -97,17 +91,17 @@ public bool Equals(Property other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -125,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Property left, Property right) { @@ -148,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs index 91093fcaf..f2c610ef8 100644 --- a/src/IO.Swagger/Models/Qualifiable.cs +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Qualifiable : IEquatable - { + { /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(Qualifiable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Qualifiers == other.Qualifiers || Qualifiers != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Qualifiable left, Qualifiable right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs index 229d0ab9d..f0c5efae5 100644 --- a/src/IO.Swagger/Models/Qualifier.cs +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -7,37 +7,32 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Qualifier : HasSemantics, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +41,7 @@ public partial class Qualifier : HasSemantics, IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -56,7 +51,7 @@ public partial class Qualifier : HasSemantics, IEquatable /// [Required] - [DataMember(Name="type")] + [DataMember(Name = "type")] public string Type { get; set; } /// @@ -79,7 +74,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -106,22 +101,22 @@ public bool Equals(Qualifier other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && ValueType.Equals(other.ValueType) - ) && + ) && ( Type == other.Type || Type != null && @@ -139,20 +134,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); - if (Type != null) + if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Qualifier left, Qualifier right) { @@ -164,7 +159,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs index db644e080..793b60112 100644 --- a/src/IO.Swagger/Models/Range.cs +++ b/src/IO.Swagger/Models/Range.cs @@ -7,37 +7,32 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Range : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Max /// - [DataMember(Name="max")] + [DataMember(Name = "max")] public string Max { get; set; } /// /// Gets or Sets Min /// - [DataMember(Name="min")] + [DataMember(Name = "min")] public string Min { get; set; } /// @@ -45,7 +40,7 @@ public partial class Range : SubmodelElement, IEquatable /// [Required] - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] public ValueTypeEnum ValueType { get; set; } /// @@ -67,7 +62,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -94,17 +89,17 @@ public bool Equals(Range other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Max == other.Max || Max != null && Max.Equals(other.Max) - ) && + ) && ( Min == other.Min || Min != null && Min.Equals(other.Min) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -122,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Max != null) + if (Max != null) hashCode = hashCode * 59 + Max.GetHashCode(); - if (Min != null) + if (Min != null) hashCode = hashCode * 59 + Min.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Range left, Range right) { @@ -145,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs index 3528845d5..f2f646d3f 100644 --- a/src/IO.Swagger/Models/Referable.cs +++ b/src/IO.Swagger/Models/Referable.cs @@ -7,44 +7,41 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Referable : HasExtensions, IEquatable - { + { /// /// Gets or Sets Category /// - [DataMember(Name="category")] + [DataMember(Name = "category")] public string Category { get; set; } /// /// Gets or Sets Description /// - [DataMember(Name="description")] + [DataMember(Name = "description")] public List Description { get; set; } /// /// Gets or Sets DisplayName /// - [DataMember(Name="displayName")] + [DataMember(Name = "displayName")] public string DisplayName { get; set; } /// @@ -52,7 +49,7 @@ public partial class Referable : HasExtensions, IEquatable /// [Required] - [DataMember(Name="idShort")] + [DataMember(Name = "idShort")] public string IdShort { get; set; } /// @@ -60,7 +57,7 @@ public partial class Referable : HasExtensions, IEquatable /// [Required] - [DataMember(Name="modelType")] + [DataMember(Name = "modelType")] public ModelType ModelType { get; set; } /// @@ -84,7 +81,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -111,27 +108,27 @@ public bool Equals(Referable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Category == other.Category || Category != null && Category.Equals(other.Category) - ) && + ) && ( Description == other.Description || Description != null && Description.SequenceEqual(other.Description) - ) && + ) && ( DisplayName == other.DisplayName || DisplayName != null && DisplayName.Equals(other.DisplayName) - ) && + ) && ( IdShort == other.IdShort || IdShort != null && IdShort.Equals(other.IdShort) - ) && + ) && ( ModelType == other.ModelType || ModelType != null && @@ -149,22 +146,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Category != null) + if (Category != null) hashCode = hashCode * 59 + Category.GetHashCode(); - if (Description != null) + if (Description != null) hashCode = hashCode * 59 + Description.GetHashCode(); - if (DisplayName != null) + if (DisplayName != null) hashCode = hashCode * 59 + DisplayName.GetHashCode(); - if (IdShort != null) + if (IdShort != null) hashCode = hashCode * 59 + IdShort.GetHashCode(); - if (ModelType != null) + if (ModelType != null) hashCode = hashCode * 59 + ModelType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Referable left, Referable right) { @@ -176,7 +173,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs index 8ef828da3..c03e3f40f 100644 --- a/src/IO.Swagger/Models/Reference.cs +++ b/src/IO.Swagger/Models/Reference.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Reference : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Reference left, Reference right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs index 29583b3c2..7d0f2fc80 100644 --- a/src/IO.Swagger/Models/ReferenceElement.cs +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ReferenceElement : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public Reference Value { get; set; } /// @@ -50,7 +44,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -77,7 +71,7 @@ public bool Equals(ReferenceElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -95,14 +89,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ReferenceElement left, ReferenceElement right) { @@ -114,7 +108,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs index 10ae5a544..026c4943b 100644 --- a/src/IO.Swagger/Models/RelationshipElement.cs +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class RelationshipElement : SubmodelElement, IEquatable - { + { /// /// Gets or Sets First /// [Required] - [DataMember(Name="first")] + [DataMember(Name = "first")] public Reference First { get; set; } /// @@ -39,7 +34,7 @@ public partial class RelationshipElement : SubmodelElement, IEquatable [Required] - [DataMember(Name="second")] + [DataMember(Name = "second")] public Reference Second { get; set; } /// @@ -60,7 +55,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,12 +82,12 @@ public bool Equals(RelationshipElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( First == other.First || First != null && First.Equals(other.First) - ) && + ) && ( Second == other.Second || Second != null && @@ -110,16 +105,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (First != null) + if (First != null) hashCode = hashCode * 59 + First.GetHashCode(); - if (Second != null) + if (Second != null) hashCode = hashCode * 59 + Second.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(RelationshipElement left, RelationshipElement right) { @@ -131,7 +126,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs index c5ccfb1ce..bcc0ecab2 100644 --- a/src/IO.Swagger/Models/Result.cs +++ b/src/IO.Swagger/Models/Result.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Result : IEquatable - { + { /// /// Gets or Sets Messages /// - [DataMember(Name="messages")] + [DataMember(Name = "messages")] public List Messages { get; set; } /// /// Gets or Sets Success /// - [DataMember(Name="success")] + [DataMember(Name = "success")] public bool? Success { get; set; } /// @@ -85,12 +81,12 @@ public bool Equals(Result other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Messages == other.Messages || Messages != null && Messages.SequenceEqual(other.Messages) - ) && + ) && ( Success == other.Success || Success != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Messages != null) + if (Messages != null) hashCode = hashCode * 59 + Messages.GetHashCode(); - if (Success != null) + if (Success != null) hashCode = hashCode * 59 + Success.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Result left, Result right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs index 2db4764ee..4b83b4d6e 100644 --- a/src/IO.Swagger/Models/Security.cs +++ b/src/IO.Swagger/Models/Security.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Security : IEquatable - { + { /// /// Gets or Sets AccessControlPolicyPoints /// [Required] - [DataMember(Name="accessControlPolicyPoints")] + [DataMember(Name = "accessControlPolicyPoints")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControlPolicyPoints AccessControlPolicyPoints { get; set; } public AccessControlPolicyPoints AccessControlPolicyPoints { get; set; } @@ -40,14 +37,14 @@ public partial class Security : IEquatable /// Gets or Sets Certificate /// - [DataMember(Name="certificate")] + [DataMember(Name = "certificate")] public List Certificate { get; set; } /// /// Gets or Sets RequiredCertificateExtension /// - [DataMember(Name="requiredCertificateExtension")] + [DataMember(Name = "requiredCertificateExtension")] public List RequiredCertificateExtension { get; set; } /// @@ -96,17 +93,17 @@ public bool Equals(Security other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AccessControlPolicyPoints == other.AccessControlPolicyPoints || AccessControlPolicyPoints != null && AccessControlPolicyPoints.Equals(other.AccessControlPolicyPoints) - ) && + ) && ( Certificate == other.Certificate || Certificate != null && Certificate.SequenceEqual(other.Certificate) - ) && + ) && ( RequiredCertificateExtension == other.RequiredCertificateExtension || RequiredCertificateExtension != null && @@ -124,18 +121,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AccessControlPolicyPoints != null) + if (AccessControlPolicyPoints != null) hashCode = hashCode * 59 + AccessControlPolicyPoints.GetHashCode(); - if (Certificate != null) + if (Certificate != null) hashCode = hashCode * 59 + Certificate.GetHashCode(); - if (RequiredCertificateExtension != null) + if (RequiredCertificateExtension != null) hashCode = hashCode * 59 + RequiredCertificateExtension.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Security left, Security right) { @@ -147,7 +144,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs index 6e30f03b8..2f3470763 100644 --- a/src/IO.Swagger/Models/SubjectAttributes.cs +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubjectAttributes : IEquatable - { + { /// /// Gets or Sets _SubjectAttributes /// - [DataMember(Name="subjectAttributes")] + [DataMember(Name = "subjectAttributes")] public List _SubjectAttributes { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(SubjectAttributes other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _SubjectAttributes == other._SubjectAttributes || _SubjectAttributes != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_SubjectAttributes != null) + if (_SubjectAttributes != null) hashCode = hashCode * 59 + _SubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubjectAttributes left, SubjectAttributes right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs index 6d686a7ff..3daa131ec 100644 --- a/src/IO.Swagger/Models/Submodel.cs +++ b/src/IO.Swagger/Models/Submodel.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Submodel : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -53,14 +49,14 @@ public partial class Submodel : Identifiable, IEquatable /// Gets or Sets Kind /// - [DataMember(Name="kind")] + [DataMember(Name = "kind")] public ModelingKind Kind { get; set; } /// /// Gets or Sets SubmodelElements /// - [DataMember(Name="submodelElements")] + [DataMember(Name = "submodelElements")] public List SubmodelElements { get; set; } /// @@ -84,7 +80,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -111,27 +107,27 @@ public bool Equals(Submodel other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( Kind == other.Kind || Kind != null && Kind.Equals(other.Kind) - ) && + ) && ( SubmodelElements == other.SubmodelElements || SubmodelElements != null && @@ -149,22 +145,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (Kind != null) + if (Kind != null) hashCode = hashCode * 59 + Kind.GetHashCode(); - if (SubmodelElements != null) + if (SubmodelElements != null) hashCode = hashCode * 59 + SubmodelElements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Submodel left, Submodel right) { @@ -176,7 +172,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs index a2f20eb03..4a6af08b9 100644 --- a/src/IO.Swagger/Models/SubmodelElement.cs +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElement : Referable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -46,14 +42,14 @@ public partial class SubmodelElement : Referable, IEquatable /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets Kind /// - [DataMember(Name="kind")] + [DataMember(Name = "kind")] public ModelingKind Kind { get; set; } /// @@ -76,7 +72,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -103,22 +99,22 @@ public bool Equals(SubmodelElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( Kind == other.Kind || Kind != null && @@ -136,20 +132,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (Kind != null) + if (Kind != null) hashCode = hashCode * 59 + Kind.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElement left, SubmodelElement right) { @@ -161,7 +157,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs index 3e2e75550..f6e3d7b80 100644 --- a/src/IO.Swagger/Models/SubmodelElementList.cs +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -7,51 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElementList : SubmodelElement, IEquatable - { + { /// /// Gets or Sets SemanticIdValues /// - [DataMember(Name="semanticIdValues")] + [DataMember(Name = "semanticIdValues")] public Reference SemanticIdValues { get; set; } /// /// Gets or Sets SubmodelElementTypeValues /// - [DataMember(Name="submodelElementTypeValues")] + [DataMember(Name = "submodelElementTypeValues")] public ModelType SubmodelElementTypeValues { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// /// Gets or Sets ValueTypeValues /// - [DataMember(Name="valueTypeValues")] + [DataMember(Name = "valueTypeValues")] public ValueTypeEnum ValueTypeValues { get; set; } /// @@ -74,7 +70,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -101,22 +97,22 @@ public bool Equals(SubmodelElementList other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( SemanticIdValues == other.SemanticIdValues || SemanticIdValues != null && SemanticIdValues.Equals(other.SemanticIdValues) - ) && + ) && ( SubmodelElementTypeValues == other.SubmodelElementTypeValues || SubmodelElementTypeValues != null && SubmodelElementTypeValues.Equals(other.SubmodelElementTypeValues) - ) && + ) && ( Value == other.Value || Value != null && Value.SequenceEqual(other.Value) - ) && + ) && ( ValueTypeValues == other.ValueTypeValues || ValueTypeValues != null && @@ -134,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (SemanticIdValues != null) + if (SemanticIdValues != null) hashCode = hashCode * 59 + SemanticIdValues.GetHashCode(); - if (SubmodelElementTypeValues != null) + if (SubmodelElementTypeValues != null) hashCode = hashCode * 59 + SubmodelElementTypeValues.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueTypeValues != null) + if (ValueTypeValues != null) hashCode = hashCode * 59 + ValueTypeValues.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElementList left, SubmodelElementList right) { @@ -159,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs index a08559806..4c7c99b89 100644 --- a/src/IO.Swagger/Models/SubmodelElementStruct.cs +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElementStruct : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasSubmodelElement Value { get; set; } public SubmodelElement Value { get; set; } @@ -52,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -79,7 +73,7 @@ public bool Equals(SubmodelElementStruct other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -97,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElementStruct left, SubmodelElementStruct right) { @@ -116,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs index 8308d84f8..1c5e676ef 100644 --- a/src/IO.Swagger/Models/ValueList.cs +++ b/src/IO.Swagger/Models/ValueList.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueList : IEquatable - { + { /// /// Gets or Sets ValueReferencePairTypes /// [Required] - [DataMember(Name="valueReferencePairTypes")] + [DataMember(Name = "valueReferencePairTypes")] public List ValueReferencePairTypes { get; set; } /// @@ -78,7 +75,7 @@ public bool Equals(ValueList other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ValueReferencePairTypes == other.ValueReferencePairTypes || ValueReferencePairTypes != null && @@ -96,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ValueReferencePairTypes != null) + if (ValueReferencePairTypes != null) hashCode = hashCode * 59 + ValueReferencePairTypes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueList left, ValueList right) { @@ -115,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs index bbb677815..9cf0ad5ca 100644 --- a/src/IO.Swagger/Models/ValueObject.cs +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueObject : IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +40,7 @@ public partial class ValueObject : IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -97,17 +91,17 @@ public bool Equals(ValueObject other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -125,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueObject left, ValueObject right) { @@ -148,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs index af6705d11..c55a081e6 100644 --- a/src/IO.Swagger/Models/ValueReferencePairType.cs +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueReferencePairType : ValueObject, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueReferencePairType left, ValueReferencePairType right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs index a573295c3..fea2b2eee 100644 --- a/src/IO.Swagger/Models/ValueTypeEnum.cs +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -7,243 +7,236 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets ValueTypeEnum - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ValueTypeEnum - { - /// - /// Enum AnyUriEnum for anyUri - /// - [EnumMember(Value = "anyUri")] - AnyUriEnum = 0, - /// - /// Enum Base64BinaryEnum for base64Binary - /// - [EnumMember(Value = "base64Binary")] - Base64BinaryEnum = 1, - /// - /// Enum BooleanEnum for boolean - /// - [EnumMember(Value = "boolean")] - BooleanEnum = 2, - /// - /// Enum DateEnum for date - /// - [EnumMember(Value = "date")] - DateEnum = 3, - /// - /// Enum DateTimeEnum for dateTime - /// - [EnumMember(Value = "dateTime")] - DateTimeEnum = 4, - /// - /// Enum DateTimeStampEnum for dateTimeStamp - /// - [EnumMember(Value = "dateTimeStamp")] - DateTimeStampEnum = 5, - /// - /// Enum DecimalEnum for decimal - /// - [EnumMember(Value = "decimal")] - DecimalEnum = 6, - /// - /// Enum IntegerEnum for integer - /// - [EnumMember(Value = "integer")] - IntegerEnum = 7, - /// - /// Enum LongEnum for long - /// - [EnumMember(Value = "long")] - LongEnum = 8, - /// - /// Enum IntEnum for int - /// - [EnumMember(Value = "int")] - IntEnum = 9, - /// - /// Enum ShortEnum for short - /// - [EnumMember(Value = "short")] - ShortEnum = 10, - /// - /// Enum ByteEnum for byte - /// - [EnumMember(Value = "byte")] - ByteEnum = 11, - /// - /// Enum NonNegativeIntegerEnum for nonNegativeInteger - /// - [EnumMember(Value = "nonNegativeInteger")] - NonNegativeIntegerEnum = 12, - /// - /// Enum PositiveIntegerEnum for positiveInteger - /// - [EnumMember(Value = "positiveInteger")] - PositiveIntegerEnum = 13, - /// - /// Enum UnsignedLongEnum for unsignedLong - /// - [EnumMember(Value = "unsignedLong")] - UnsignedLongEnum = 14, - /// - /// Enum UnsignedIntEnum for unsignedInt - /// - [EnumMember(Value = "unsignedInt")] - UnsignedIntEnum = 15, - /// - /// Enum UnsignedShortEnum for unsignedShort - /// - [EnumMember(Value = "unsignedShort")] - UnsignedShortEnum = 16, - /// - /// Enum UnsignedByteEnum for unsignedByte - /// - [EnumMember(Value = "unsignedByte")] - UnsignedByteEnum = 17, - /// - /// Enum NonPositiveIntegerEnum for nonPositiveInteger - /// - [EnumMember(Value = "nonPositiveInteger")] - NonPositiveIntegerEnum = 18, - /// - /// Enum NegativeIntegerEnum for negativeInteger - /// - [EnumMember(Value = "negativeInteger")] - NegativeIntegerEnum = 19, - /// - /// Enum DoubleEnum for double - /// - [EnumMember(Value = "double")] - DoubleEnum = 20, - /// - /// Enum DurationEnum for duration - /// - [EnumMember(Value = "duration")] - DurationEnum = 21, - /// - /// Enum DayTimeDurationEnum for dayTimeDuration - /// - [EnumMember(Value = "dayTimeDuration")] - DayTimeDurationEnum = 22, - /// - /// Enum YearMonthDurationEnum for yearMonthDuration - /// - [EnumMember(Value = "yearMonthDuration")] - YearMonthDurationEnum = 23, - /// - /// Enum FloatEnum for float - /// - [EnumMember(Value = "float")] - FloatEnum = 24, - /// - /// Enum GDayEnum for gDay - /// - [EnumMember(Value = "gDay")] - GDayEnum = 25, - /// - /// Enum GMonthEnum for gMonth - /// - [EnumMember(Value = "gMonth")] - GMonthEnum = 26, - /// - /// Enum GMonthDayEnum for gMonthDay - /// - [EnumMember(Value = "gMonthDay")] - GMonthDayEnum = 27, - /// - /// Enum GYearEnum for gYear - /// - [EnumMember(Value = "gYear")] - GYearEnum = 28, - /// - /// Enum GYearMonthEnum for gYearMonth - /// - [EnumMember(Value = "gYearMonth")] - GYearMonthEnum = 29, - /// - /// Enum HexBinaryEnum for hexBinary - /// - [EnumMember(Value = "hexBinary")] - HexBinaryEnum = 30, - /// - /// Enum NOTATIONEnum for NOTATION - /// - [EnumMember(Value = "NOTATION")] - NOTATIONEnum = 31, - /// - /// Enum QNameEnum for QName - /// - [EnumMember(Value = "QName")] - QNameEnum = 32, - /// - /// Enum StringEnum for string - /// - [EnumMember(Value = "string")] - StringEnum = 33, - /// - /// Enum NormalizedStringEnum for normalizedString - /// - [EnumMember(Value = "normalizedString")] - NormalizedStringEnum = 34, - /// - /// Enum TokenEnum for token - /// - [EnumMember(Value = "token")] - TokenEnum = 35, - /// - /// Enum LanguageEnum for language - /// - [EnumMember(Value = "language")] - LanguageEnum = 36, - /// - /// Enum NameEnum for Name - /// - [EnumMember(Value = "Name")] - NameEnum = 37, - /// - /// Enum NCNameEnum for NCName - /// - [EnumMember(Value = "NCName")] - NCNameEnum = 38, - /// - /// Enum ENTITYEnum for ENTITY - /// - [EnumMember(Value = "ENTITY")] - ENTITYEnum = 39, - /// - /// Enum IDEnum for ID - /// - [EnumMember(Value = "ID")] - IDEnum = 40, - /// - /// Enum IDREFEnum for IDREF - /// - [EnumMember(Value = "IDREF")] - IDREFEnum = 41, - /// - /// Enum NMTOKENEnum for NMTOKEN - /// - [EnumMember(Value = "NMTOKEN")] - NMTOKENEnum = 42, - /// - /// Enum TimeEnum for time - /// - [EnumMember(Value = "time")] - TimeEnum = 43 } +{ + /// + /// Gets or Sets ValueTypeEnum + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ValueTypeEnum + { + /// + /// Enum AnyUriEnum for anyUri + /// + [EnumMember(Value = "anyUri")] + AnyUriEnum = 0, + /// + /// Enum Base64BinaryEnum for base64Binary + /// + [EnumMember(Value = "base64Binary")] + Base64BinaryEnum = 1, + /// + /// Enum BooleanEnum for boolean + /// + [EnumMember(Value = "boolean")] + BooleanEnum = 2, + /// + /// Enum DateEnum for date + /// + [EnumMember(Value = "date")] + DateEnum = 3, + /// + /// Enum DateTimeEnum for dateTime + /// + [EnumMember(Value = "dateTime")] + DateTimeEnum = 4, + /// + /// Enum DateTimeStampEnum for dateTimeStamp + /// + [EnumMember(Value = "dateTimeStamp")] + DateTimeStampEnum = 5, + /// + /// Enum DecimalEnum for decimal + /// + [EnumMember(Value = "decimal")] + DecimalEnum = 6, + /// + /// Enum IntegerEnum for integer + /// + [EnumMember(Value = "integer")] + IntegerEnum = 7, + /// + /// Enum LongEnum for long + /// + [EnumMember(Value = "long")] + LongEnum = 8, + /// + /// Enum IntEnum for int + /// + [EnumMember(Value = "int")] + IntEnum = 9, + /// + /// Enum ShortEnum for short + /// + [EnumMember(Value = "short")] + ShortEnum = 10, + /// + /// Enum ByteEnum for byte + /// + [EnumMember(Value = "byte")] + ByteEnum = 11, + /// + /// Enum NonNegativeIntegerEnum for nonNegativeInteger + /// + [EnumMember(Value = "nonNegativeInteger")] + NonNegativeIntegerEnum = 12, + /// + /// Enum PositiveIntegerEnum for positiveInteger + /// + [EnumMember(Value = "positiveInteger")] + PositiveIntegerEnum = 13, + /// + /// Enum UnsignedLongEnum for unsignedLong + /// + [EnumMember(Value = "unsignedLong")] + UnsignedLongEnum = 14, + /// + /// Enum UnsignedIntEnum for unsignedInt + /// + [EnumMember(Value = "unsignedInt")] + UnsignedIntEnum = 15, + /// + /// Enum UnsignedShortEnum for unsignedShort + /// + [EnumMember(Value = "unsignedShort")] + UnsignedShortEnum = 16, + /// + /// Enum UnsignedByteEnum for unsignedByte + /// + [EnumMember(Value = "unsignedByte")] + UnsignedByteEnum = 17, + /// + /// Enum NonPositiveIntegerEnum for nonPositiveInteger + /// + [EnumMember(Value = "nonPositiveInteger")] + NonPositiveIntegerEnum = 18, + /// + /// Enum NegativeIntegerEnum for negativeInteger + /// + [EnumMember(Value = "negativeInteger")] + NegativeIntegerEnum = 19, + /// + /// Enum DoubleEnum for double + /// + [EnumMember(Value = "double")] + DoubleEnum = 20, + /// + /// Enum DurationEnum for duration + /// + [EnumMember(Value = "duration")] + DurationEnum = 21, + /// + /// Enum DayTimeDurationEnum for dayTimeDuration + /// + [EnumMember(Value = "dayTimeDuration")] + DayTimeDurationEnum = 22, + /// + /// Enum YearMonthDurationEnum for yearMonthDuration + /// + [EnumMember(Value = "yearMonthDuration")] + YearMonthDurationEnum = 23, + /// + /// Enum FloatEnum for float + /// + [EnumMember(Value = "float")] + FloatEnum = 24, + /// + /// Enum GDayEnum for gDay + /// + [EnumMember(Value = "gDay")] + GDayEnum = 25, + /// + /// Enum GMonthEnum for gMonth + /// + [EnumMember(Value = "gMonth")] + GMonthEnum = 26, + /// + /// Enum GMonthDayEnum for gMonthDay + /// + [EnumMember(Value = "gMonthDay")] + GMonthDayEnum = 27, + /// + /// Enum GYearEnum for gYear + /// + [EnumMember(Value = "gYear")] + GYearEnum = 28, + /// + /// Enum GYearMonthEnum for gYearMonth + /// + [EnumMember(Value = "gYearMonth")] + GYearMonthEnum = 29, + /// + /// Enum HexBinaryEnum for hexBinary + /// + [EnumMember(Value = "hexBinary")] + HexBinaryEnum = 30, + /// + /// Enum NOTATIONEnum for NOTATION + /// + [EnumMember(Value = "NOTATION")] + NOTATIONEnum = 31, + /// + /// Enum QNameEnum for QName + /// + [EnumMember(Value = "QName")] + QNameEnum = 32, + /// + /// Enum StringEnum for string + /// + [EnumMember(Value = "string")] + StringEnum = 33, + /// + /// Enum NormalizedStringEnum for normalizedString + /// + [EnumMember(Value = "normalizedString")] + NormalizedStringEnum = 34, + /// + /// Enum TokenEnum for token + /// + [EnumMember(Value = "token")] + TokenEnum = 35, + /// + /// Enum LanguageEnum for language + /// + [EnumMember(Value = "language")] + LanguageEnum = 36, + /// + /// Enum NameEnum for Name + /// + [EnumMember(Value = "Name")] + NameEnum = 37, + /// + /// Enum NCNameEnum for NCName + /// + [EnumMember(Value = "NCName")] + NCNameEnum = 38, + /// + /// Enum ENTITYEnum for ENTITY + /// + [EnumMember(Value = "ENTITY")] + ENTITYEnum = 39, + /// + /// Enum IDEnum for ID + /// + [EnumMember(Value = "ID")] + IDEnum = 40, + /// + /// Enum IDREFEnum for IDREF + /// + [EnumMember(Value = "IDREF")] + IDREFEnum = 41, + /// + /// Enum NMTOKENEnum for NMTOKEN + /// + [EnumMember(Value = "NMTOKEN")] + NMTOKENEnum = 42, + /// + /// Enum TimeEnum for time + /// + [EnumMember(Value = "time")] + TimeEnum = 43 + } } diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs index b0016246c..d30d14912 100644 --- a/src/IO.Swagger/Models/View.cs +++ b/src/IO.Swagger/Models/View.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class View : Referable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -46,7 +42,7 @@ public partial class View : Referable, IEquatable /// Gets or Sets ContainedElements /// - [DataMember(Name="containedElements")] + [DataMember(Name = "containedElements")] public List ContainedElements { get; set; } /// @@ -68,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -95,17 +91,17 @@ public bool Equals(View other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( ContainedElements == other.ContainedElements || ContainedElements != null && @@ -123,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (ContainedElements != null) + if (ContainedElements != null) hashCode = hashCode * 59 + ContainedElements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(View left, View right) { @@ -146,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Program.cs b/src/IO.Swagger/Program.cs index cdbbe15a7..6d6775779 100644 --- a/src/IO.Swagger/Program.cs +++ b/src/IO.Swagger/Program.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; namespace IO.Swagger { diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs index 39fcd6c69..32d3f4494 100644 --- a/src/IO.Swagger/Startup.cs +++ b/src/IO.Swagger/Startup.cs @@ -7,9 +7,7 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.IO; -using Microsoft.AspNetCore.Authentication; +using IO.Swagger.Filters; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -19,9 +17,8 @@ using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; -using Swashbuckle.AspNetCore.Swagger; -using Swashbuckle.AspNetCore.SwaggerGen; -using IO.Swagger.Filters; +using System; +using System.IO; namespace IO.Swagger @@ -77,9 +74,9 @@ public void ConfigureServices(IServiceCollection services) Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", Contact = new OpenApiContact() { - Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", - Url = new Uri("https://github.com/swagger-api/swagger-codegen"), - Email = "" + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" }, TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") }); From 784a6200c1d2b8962ac0c744f6dada13de8fd525 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Fri, 21 Jan 2022 13:12:00 +0100 Subject: [PATCH 05/53] Corrected the code formatting --- src/AasxServerStandardBib/AdminShell.cs | 5 ----- src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs | 4 ++-- .../Controllers/AssetAdministrationShellRepositoryApi.cs | 6 +++--- src/IO.Swagger/Filters/BasePathFilter.cs | 4 ++-- .../Filters/GeneratePathParamsValidationFilter.cs | 4 ++-- src/IO.Swagger/Helpers/AASHelper.cs | 6 +++--- src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs | 6 +++--- src/IO.Swagger/Helpers/OutputModifierContractResolver.cs | 4 ++-- src/IO.Swagger/Models/AccessControl.cs | 2 +- src/IO.Swagger/Models/AccessControlPolicyPoints.cs | 2 +- src/IO.Swagger/Models/AccessPermissionRule.cs | 2 +- src/IO.Swagger/Models/AdministrativeInformation.cs | 2 +- src/IO.Swagger/Models/AnnotatedRelationshipElement.cs | 2 +- src/IO.Swagger/Models/AssetAdministrationShell.cs | 2 +- .../Models/AssetAdministrationShellEnvironment.cs | 2 +- src/IO.Swagger/Models/AssetInformation.cs | 2 +- src/IO.Swagger/Models/AssetKind.cs | 2 +- src/IO.Swagger/Models/BasicEvent.cs | 2 +- src/IO.Swagger/Models/Blob.cs | 2 +- src/IO.Swagger/Models/BlobCertificate.cs | 2 +- src/IO.Swagger/Models/Capability.cs | 2 +- src/IO.Swagger/Models/Certificate.cs | 2 +- src/IO.Swagger/Models/ConceptDescription.cs | 2 +- src/IO.Swagger/Models/Constraint.cs | 2 +- src/IO.Swagger/Models/DataElement.cs | 2 +- src/IO.Swagger/Models/DataSpecificationContent.cs | 2 +- src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs | 2 +- .../Models/DataSpecificationPhysicalUnitContent.cs | 2 +- src/IO.Swagger/Models/EmbeddedDataSpecification.cs | 2 +- src/IO.Swagger/Models/Entity.cs | 2 +- src/IO.Swagger/Models/EntityType.cs | 2 +- src/IO.Swagger/Models/Extension.cs | 2 +- src/IO.Swagger/Models/File.cs | 2 +- src/IO.Swagger/Models/Formula.cs | 2 +- src/IO.Swagger/Models/GlobalReference.cs | 2 +- src/IO.Swagger/Models/HasDataSpecification.cs | 2 +- src/IO.Swagger/Models/HasExtensions.cs | 2 +- src/IO.Swagger/Models/HasSemantics.cs | 2 +- src/IO.Swagger/Models/Identifiable.cs | 2 +- src/IO.Swagger/Models/IdentifierKeyValuePair.cs | 2 +- src/IO.Swagger/Models/Key.cs | 2 +- src/IO.Swagger/Models/KeyElements.cs | 2 +- src/IO.Swagger/Models/LangString.cs | 2 +- src/IO.Swagger/Models/LevelType.cs | 2 +- src/IO.Swagger/Models/Message.cs | 2 +- src/IO.Swagger/Models/ModelEvent.cs | 2 +- src/IO.Swagger/Models/ModelReference.cs | 2 +- src/IO.Swagger/Models/ModelType.cs | 2 +- src/IO.Swagger/Models/ModelTypes.cs | 2 +- src/IO.Swagger/Models/ModelingKind.cs | 2 +- src/IO.Swagger/Models/MultiLanguageProperty.cs | 2 +- src/IO.Swagger/Models/ObjectAttributes.cs | 2 +- src/IO.Swagger/Models/OneOfCertificate.cs | 2 +- src/IO.Swagger/Models/OneOfConstraint.cs | 2 +- src/IO.Swagger/Models/OneOfDataElement.cs | 2 +- src/IO.Swagger/Models/OneOfDataSpecificationContent.cs | 2 +- src/IO.Swagger/Models/OneOfOperationVariableValue.cs | 2 +- src/IO.Swagger/Models/OneOfReference.cs | 2 +- src/IO.Swagger/Models/OneOfSubmodelElement.cs | 2 +- src/IO.Swagger/Models/Operation.cs | 2 +- src/IO.Swagger/Models/OperationRequest.cs | 2 +- src/IO.Swagger/Models/OperationResult.cs | 2 +- src/IO.Swagger/Models/OperationVariable.cs | 2 +- src/IO.Swagger/Models/Permission.cs | 2 +- src/IO.Swagger/Models/PermissionsPerObject.cs | 2 +- src/IO.Swagger/Models/PolicyAdministrationPoint.cs | 2 +- src/IO.Swagger/Models/PolicyDecisionPoint.cs | 2 +- src/IO.Swagger/Models/PolicyEnforcementPoint.cs | 2 +- src/IO.Swagger/Models/PolicyInformationPoints.cs | 2 +- src/IO.Swagger/Models/Property.cs | 2 +- src/IO.Swagger/Models/Qualifiable.cs | 2 +- src/IO.Swagger/Models/Qualifier.cs | 2 +- src/IO.Swagger/Models/Range.cs | 2 +- src/IO.Swagger/Models/Referable.cs | 2 +- src/IO.Swagger/Models/Reference.cs | 2 +- src/IO.Swagger/Models/ReferenceElement.cs | 2 +- src/IO.Swagger/Models/RelationshipElement.cs | 2 +- src/IO.Swagger/Models/Result.cs | 2 +- src/IO.Swagger/Models/Security.cs | 2 +- src/IO.Swagger/Models/SubjectAttributes.cs | 2 +- src/IO.Swagger/Models/Submodel.cs | 2 +- src/IO.Swagger/Models/SubmodelElement.cs | 2 +- src/IO.Swagger/Models/SubmodelElementList.cs | 2 +- src/IO.Swagger/Models/SubmodelElementStruct.cs | 2 +- src/IO.Swagger/Models/ValueList.cs | 2 +- src/IO.Swagger/Models/ValueObject.cs | 2 +- src/IO.Swagger/Models/ValueReferencePairType.cs | 2 +- src/IO.Swagger/Models/ValueTypeEnum.cs | 2 +- src/IO.Swagger/Models/View.cs | 2 +- src/IO.Swagger/Startup.cs | 4 ++-- 90 files changed, 100 insertions(+), 105 deletions(-) diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 9ea00ec60..ee5a7d603 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -10,19 +10,14 @@ This source code may use other Open Source software components (see LICENSE.txt) using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Globalization; using System.IO; -using System.IO.Packaging; using System.Linq; using System.Reflection; -using System.Runtime; using System.Text; -using System.Text.RegularExpressions; using System.Xml; using System.Xml.Serialization; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace AdminShellNS { diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs index 604012536..97b193c67 100644 --- a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -1,9 +1,9 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; -using System.ComponentModel.DataAnnotations; -using System.Reflection; namespace IO.Swagger.Attributes { diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index a78908d31..b860ca821 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -7,6 +7,9 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using AdminShellNS; using IO.Swagger.Attributes; using IO.Swagger.Helpers; @@ -15,9 +18,6 @@ using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; namespace IO.Swagger.Controllers { diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs index a94d6a70c..eef6989b3 100644 --- a/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -1,7 +1,7 @@ -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; using System.Linq; using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index a2138c86c..1845e56ac 100644 --- a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -1,8 +1,8 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -using System.ComponentModel.DataAnnotations; -using System.Linq; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 55dfe86b2..a2e3a8c4d 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -1,9 +1,9 @@ -using AdminShellNS; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Threading; +using AdminShellNS; +using Newtonsoft.Json; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs index 372d1ba61..75f3f3e6f 100644 --- a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -1,8 +1,8 @@ -using IO.Swagger.Models; -using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using IO.Swagger.Models; +using Newtonsoft.Json; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index 94b10fb5a..c050ad220 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,7 +1,7 @@ -using AdminShellNS; +using System.Reflection; +using AdminShellNS; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System.Reflection; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs index c774cf18b..10907a021 100644 --- a/src/IO.Swagger/Models/AccessControl.cs +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs index c064fb200..c2460d28d 100644 --- a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs index 65f630acd..dd94cafa3 100644 --- a/src/IO.Swagger/Models/AccessPermissionRule.cs +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs index aceef7073..7d4b2c292 100644 --- a/src/IO.Swagger/Models/AdministrativeInformation.cs +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs index 4e0cafe47..112315725 100644 --- a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs index 7c52798be..458e1f6f6 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShell.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs index 015620adc..88f67df84 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs index 82210194d..46de259e0 100644 --- a/src/IO.Swagger/Models/AssetInformation.cs +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs index 53615779d..71b390e66 100644 --- a/src/IO.Swagger/Models/AssetKind.cs +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs index e32d77dff..bcb4dea85 100644 --- a/src/IO.Swagger/Models/BasicEvent.cs +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs index b53c09db5..b5d431a4b 100644 --- a/src/IO.Swagger/Models/Blob.cs +++ b/src/IO.Swagger/Models/Blob.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs index 0d13579d2..b984cfdbb 100644 --- a/src/IO.Swagger/Models/BlobCertificate.cs +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs index afce09069..5291e1137 100644 --- a/src/IO.Swagger/Models/Capability.cs +++ b/src/IO.Swagger/Models/Capability.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs index f7421a5e6..8b2a9e043 100644 --- a/src/IO.Swagger/Models/Certificate.cs +++ b/src/IO.Swagger/Models/Certificate.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs index 3aeaf2f3e..e56650cf8 100644 --- a/src/IO.Swagger/Models/ConceptDescription.cs +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs index fcaeebc4a..fd02efdd4 100644 --- a/src/IO.Swagger/Models/Constraint.cs +++ b/src/IO.Swagger/Models/Constraint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs index 1afee42c4..fa40c49a6 100644 --- a/src/IO.Swagger/Models/DataElement.cs +++ b/src/IO.Swagger/Models/DataElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs index a8e3dbeb0..a2fd64638 100644 --- a/src/IO.Swagger/Models/DataSpecificationContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs index 770354aae..89c150803 100644 --- a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs index e7324e909..e6cce21df 100644 --- a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs index ec35e951a..1ec412c74 100644 --- a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs index 0b1046298..060f340c1 100644 --- a/src/IO.Swagger/Models/Entity.cs +++ b/src/IO.Swagger/Models/Entity.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs index d06093904..1d4873919 100644 --- a/src/IO.Swagger/Models/EntityType.cs +++ b/src/IO.Swagger/Models/EntityType.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs index 509f42692..7f30262af 100644 --- a/src/IO.Swagger/Models/Extension.cs +++ b/src/IO.Swagger/Models/Extension.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs index e1a4ce7f8..d0e782f38 100644 --- a/src/IO.Swagger/Models/File.cs +++ b/src/IO.Swagger/Models/File.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs index 2e98ffb87..a9f019c1d 100644 --- a/src/IO.Swagger/Models/Formula.cs +++ b/src/IO.Swagger/Models/Formula.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs index 276ab1d21..6bbaf6048 100644 --- a/src/IO.Swagger/Models/GlobalReference.cs +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs index 428b707cf..620fbe985 100644 --- a/src/IO.Swagger/Models/HasDataSpecification.cs +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs index 2d4b0289b..d91f3043d 100644 --- a/src/IO.Swagger/Models/HasExtensions.cs +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs index 9f42763ec..a5b4bee0c 100644 --- a/src/IO.Swagger/Models/HasSemantics.cs +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs index c9bccffab..b275ca9c1 100644 --- a/src/IO.Swagger/Models/Identifiable.cs +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs index e2f40777b..a6fe72e20 100644 --- a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs index 25c6aae9e..ebf984a98 100644 --- a/src/IO.Swagger/Models/Key.cs +++ b/src/IO.Swagger/Models/Key.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs index 8411b8dbb..ca9e15f15 100644 --- a/src/IO.Swagger/Models/KeyElements.cs +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs index 436f236cb..c2c7de816 100644 --- a/src/IO.Swagger/Models/LangString.cs +++ b/src/IO.Swagger/Models/LangString.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs index a6ac1fdd5..f57e17244 100644 --- a/src/IO.Swagger/Models/LevelType.cs +++ b/src/IO.Swagger/Models/LevelType.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs index 7f8b3e662..958130530 100644 --- a/src/IO.Swagger/Models/Message.cs +++ b/src/IO.Swagger/Models/Message.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs index d44e568c8..ce0ac1cd1 100644 --- a/src/IO.Swagger/Models/ModelEvent.cs +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs index 4bb50c07f..c48969a34 100644 --- a/src/IO.Swagger/Models/ModelReference.cs +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs index 6b785aee2..d76707295 100644 --- a/src/IO.Swagger/Models/ModelType.cs +++ b/src/IO.Swagger/Models/ModelType.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs index 80f71ca5e..74241bc09 100644 --- a/src/IO.Swagger/Models/ModelTypes.cs +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs index 6aa0183e5..5748c03df 100644 --- a/src/IO.Swagger/Models/ModelingKind.cs +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs index 18bbd8992..10a361a2a 100644 --- a/src/IO.Swagger/Models/MultiLanguageProperty.cs +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs index 3c09f5e23..f6a602e2e 100644 --- a/src/IO.Swagger/Models/ObjectAttributes.cs +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs index 1b74da745..16ebeaa44 100644 --- a/src/IO.Swagger/Models/OneOfCertificate.cs +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs index e1a74771d..72936972a 100644 --- a/src/IO.Swagger/Models/OneOfConstraint.cs +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs index dee5eafc8..4e5a895dd 100644 --- a/src/IO.Swagger/Models/OneOfDataElement.cs +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs index 98c6cda04..f0c77bc45 100644 --- a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs index eb1d1e3bc..22e9c606e 100644 --- a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs index b74711b83..b53ec7af5 100644 --- a/src/IO.Swagger/Models/OneOfReference.cs +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs index 4a354c283..c82dd42d8 100644 --- a/src/IO.Swagger/Models/OneOfSubmodelElement.cs +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs index fe2a28372..4f821d2bb 100644 --- a/src/IO.Swagger/Models/Operation.cs +++ b/src/IO.Swagger/Models/Operation.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs index 6e1536833..6fe68f239 100644 --- a/src/IO.Swagger/Models/OperationRequest.cs +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs index 46ac8532d..48103ebf4 100644 --- a/src/IO.Swagger/Models/OperationResult.cs +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs index d8a0c2e37..cd09578d4 100644 --- a/src/IO.Swagger/Models/OperationVariable.cs +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs index 3215153ba..0b0b86889 100644 --- a/src/IO.Swagger/Models/Permission.cs +++ b/src/IO.Swagger/Models/Permission.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs index af7c828fd..14f5c6d6c 100644 --- a/src/IO.Swagger/Models/PermissionsPerObject.cs +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs index a5bad16e1..e8d85d230 100644 --- a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs index 16380b049..94e63c455 100644 --- a/src/IO.Swagger/Models/PolicyDecisionPoint.cs +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs index 99d4742c2..cadf0746e 100644 --- a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs index 134741e2a..4cabb3dee 100644 --- a/src/IO.Swagger/Models/PolicyInformationPoints.cs +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs index 78b8b316e..59745986f 100644 --- a/src/IO.Swagger/Models/Property.cs +++ b/src/IO.Swagger/Models/Property.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs index f2c610ef8..192da91e6 100644 --- a/src/IO.Swagger/Models/Qualifiable.cs +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs index f0c5efae5..339c7bdf9 100644 --- a/src/IO.Swagger/Models/Qualifier.cs +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs index 793b60112..027cb9a2b 100644 --- a/src/IO.Swagger/Models/Range.cs +++ b/src/IO.Swagger/Models/Range.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs index f2f646d3f..d5d689834 100644 --- a/src/IO.Swagger/Models/Referable.cs +++ b/src/IO.Swagger/Models/Referable.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs index c03e3f40f..919adbc73 100644 --- a/src/IO.Swagger/Models/Reference.cs +++ b/src/IO.Swagger/Models/Reference.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs index 7d0f2fc80..de80c2cf7 100644 --- a/src/IO.Swagger/Models/ReferenceElement.cs +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs index 026c4943b..3d10e6079 100644 --- a/src/IO.Swagger/Models/RelationshipElement.cs +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs index bcc0ecab2..342f27a50 100644 --- a/src/IO.Swagger/Models/Result.cs +++ b/src/IO.Swagger/Models/Result.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs index 4b83b4d6e..c578671fb 100644 --- a/src/IO.Swagger/Models/Security.cs +++ b/src/IO.Swagger/Models/Security.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs index 2f3470763..10a305f80 100644 --- a/src/IO.Swagger/Models/SubjectAttributes.cs +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs index 3daa131ec..f2bbcaddf 100644 --- a/src/IO.Swagger/Models/Submodel.cs +++ b/src/IO.Swagger/Models/Submodel.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs index 4a6af08b9..0bcebfe49 100644 --- a/src/IO.Swagger/Models/SubmodelElement.cs +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs index f6e3d7b80..bb33d2f35 100644 --- a/src/IO.Swagger/Models/SubmodelElementList.cs +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs index 4c7c99b89..c1bc9f033 100644 --- a/src/IO.Swagger/Models/SubmodelElementStruct.cs +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs index 1c5e676ef..87e8bdcef 100644 --- a/src/IO.Swagger/Models/ValueList.cs +++ b/src/IO.Swagger/Models/ValueList.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs index 9cf0ad5ca..c83fda12e 100644 --- a/src/IO.Swagger/Models/ValueObject.cs +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs index c55a081e6..f21741a11 100644 --- a/src/IO.Swagger/Models/ValueReferencePairType.cs +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs index fea2b2eee..70bf2d1e1 100644 --- a/src/IO.Swagger/Models/ValueTypeEnum.cs +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs index d30d14912..a4c83b19d 100644 --- a/src/IO.Swagger/Models/View.cs +++ b/src/IO.Swagger/Models/View.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs index 32d3f4494..9d5e2d370 100644 --- a/src/IO.Swagger/Startup.cs +++ b/src/IO.Swagger/Startup.cs @@ -7,6 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using System; +using System.IO; using IO.Swagger.Filters; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -17,8 +19,6 @@ using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; -using System; -using System.IO; namespace IO.Swagger From e7fa58de562f4f7997335a9b34830bc4b69525b3 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 31 Jan 2022 07:58:23 +0100 Subject: [PATCH 06/53] Support for "Content" and "Extent" modifiers -Support for Basic Authentication --- src/AasxServerBlazor/AasxServerBlazor.csproj | 1 + src/AasxServerBlazor/Startup.cs | 104 +++++++++- src/AasxServerStandardBib/AdminShell.cs | 71 +++++++ .../ValueOnlyJsonConverter.cs | 74 ++++++++ .../AssetAdministrationShellRepositoryApi.cs | 114 ++++++++--- src/IO.Swagger/Helpers/AASHelper.cs | 178 +++++++++++++++--- .../Helpers/BasicAuthenticationHandler.cs | 95 ++++++++++ .../Helpers/JsonSerializerExtension.cs | 23 +++ .../Helpers/OutputModifierContractResolver.cs | 156 ++++++++++++--- src/IO.Swagger/Services/UserService.cs | 38 ++++ 10 files changed, 763 insertions(+), 91 deletions(-) create mode 100644 src/AasxServerStandardBib/ValueOnlyJsonConverter.cs create mode 100644 src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs create mode 100644 src/IO.Swagger/Helpers/JsonSerializerExtension.cs create mode 100644 src/IO.Swagger/Services/UserService.cs diff --git a/src/AasxServerBlazor/AasxServerBlazor.csproj b/src/AasxServerBlazor/AasxServerBlazor.csproj index 5b5bb5515..747580085 100644 --- a/src/AasxServerBlazor/AasxServerBlazor.csproj +++ b/src/AasxServerBlazor/AasxServerBlazor.csproj @@ -17,6 +17,7 @@ + diff --git a/src/AasxServerBlazor/Startup.cs b/src/AasxServerBlazor/Startup.cs index 1d1621d39..4f8b6430a 100644 --- a/src/AasxServerBlazor/Startup.cs +++ b/src/AasxServerBlazor/Startup.cs @@ -1,8 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using AasxServerBlazor.Data; +using IO.Swagger.Filters; +using IO.Swagger.Helpers; +using IO.Swagger.Services; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Hosting; @@ -10,16 +15,27 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; namespace AasxServerBlazor { public class Startup { + private readonly IWebHostEnvironment _hostingEnv; + + /* public Startup(IConfiguration configuration) { Configuration = configuration; } - + */ + public Startup(IWebHostEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. @@ -30,6 +46,79 @@ public void ConfigureServices(IServiceCollection services) services.AddServerSideBlazor(); services.AddSingleton(); services.AddCors(); + + services.AddControllers(); + + // Add framework services. + services + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); + }) + .AddXmlSerializerFormatters(); + + // configure DI for application services + services.AddScoped(); + // configure basic authentication + services.AddAuthentication("BasicAuthentication") + .AddScheme("BasicAuthentication", null); services.AddAuthentication(); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("Final-Draft", new OpenApiInfo + { + Version = "Final-Draft", + Title = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", + Contact = new OpenApiContact() + { + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" + }, + TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") + }); + + c.AddSecurityDefinition("basic", new OpenApiSecurityScheme + { + Name = "Authorization", + Type = SecuritySchemeType.Http, + Scheme = "basic", + In = ParameterLocation.Header, + Description = "Basic Authorization header using the Bearer scheme." + }); + + c.AddSecurityRequirement(new OpenApiSecurityRequirement + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference + { + Type = ReferenceType.SecurityScheme, + Id = "basic" + } + }, + new string[] {} + } + }); + + c.EnableAnnotations(); + c.CustomSchemaIds(type => type.FullName); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -49,6 +138,18 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseStaticFiles(); app.UseRouting(); + app.UseAuthentication(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/Final-Draft/swagger.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository Original"); + }); app.UseEndpoints(endpoints => { @@ -62,6 +163,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) HttpTransportType.LongPolling; }); endpoints.MapFallbackToPage("/_Host"); + endpoints.MapControllers(); }); app.UseCors(x => x diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index ee5a7d603..92b5885c5 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -10,6 +10,7 @@ This source code may use other Open Source software components (see LICENSE.txt) using System; using System.Collections; using System.Collections.Generic; +using System.Dynamic; using System.Globalization; using System.IO; using System.Linq; @@ -5115,6 +5116,11 @@ public override void Validate(AasValidationRecordList results) ModelingKind.Validate(results, kind, this); KeyList.Validate(results, semanticId?.Keys, this); } + + public virtual object ToValueOnlySerialization() + { + throw new NotImplementedException(); + } } [XmlType(TypeName = "submodelElement")] @@ -6378,6 +6384,7 @@ public JsonValueTypeCast(string name) } } + //[JsonConverter(typeof(IO.Swagger.Helpers.ValueOnlyJsonConverter))] public class Property : DataElement { // for JSON only @@ -6497,6 +6504,14 @@ public bool IsTrue() return null; } + public override object ToValueOnlySerialization() + { + var valueObject = new Dictionary + { + { idShort, value } + }; + return valueObject; + } } public class MultiLanguageProperty : DataElement @@ -6576,6 +6591,18 @@ public override string ValueAsText(string defaultLang = null) return "" + value?.GetDefaultStr(defaultLang); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary(); + foreach (LangStr langStr in value.langString) + { + valueDict.Add(langStr.lang, langStr.str); + } + + output.Add(idShort, valueDict); + return output; + } } public class Range : DataElement @@ -6650,6 +6677,18 @@ public override string ValueAsText(string defaultLang = null) return "" + min + " .. " + max; } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "min", min }, + { "max", max } + }; + + output.Add(idShort, valueDict); + return output; + } } public class Blob : DataElement @@ -6808,6 +6847,19 @@ public override string ValueAsText(string defaultLang = null) { return "" + value; } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + { "value", value } + }; + + output.Add(idShort, valueDict); + return output; + } } public class ReferenceElement : DataElement @@ -6868,6 +6920,24 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("ReferenceElement", "Ref"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var list = new List>(); + foreach (var key in value.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + list.Add(valueDict); + } + + output.Add(idShort, list); + return output; + } } public class RelationshipElement : DataElement @@ -6936,6 +7006,7 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("RelationshipElement", "Rel"); } + } public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren diff --git a/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs b/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs new file mode 100644 index 000000000..12039fcb1 --- /dev/null +++ b/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Newtonsoft.Json; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Helpers +{ + /// + /// This class is responsible for the ValueOnly-Serialization + /// + public class ValueOnlyJsonConverter : JsonConverter + { + private readonly bool IsValueOnly; + private object m_object; + + public ValueOnlyJsonConverter() + { + } + + public ValueOnlyJsonConverter(bool isValueOnly, object obj) + { + this.IsValueOnly = isValueOnly; + m_object = obj; + } + + + + /// + /// Determines whether this instance can convert the specified object type. + /// + /// + /// + public override bool CanConvert(Type objectType) + { + return true; + } + + /// + /// Reads the JSON representation of the object. + /// + /// + /// + /// + /// + /// + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + /// + /// Writes the JSON representation of the object. + /// + /// + /// + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var exists = serializer.Converters.Any(e => e.GetType() == typeof(ValueOnlyJsonConverter) && ((ValueOnlyJsonConverter)e).IsValueOnly == true); + if (exists) + { + if (m_object is Property property) + { + Console.WriteLine($"############### {property.ToValueOnlySerialization()} ########################"); + writer.WriteValue(property.ToValueOnlySerialization()); + } + } + } + + + } +} diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index b860ca821..938928744 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -14,6 +14,7 @@ using IO.Swagger.Attributes; using IO.Swagger.Helpers; using IO.Swagger.Models; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; @@ -24,6 +25,7 @@ namespace IO.Swagger.Controllers /// /// /// + [Authorize] [ApiController] public class AssetAdministrationShellRepositoryApiController : ControllerBase { @@ -196,15 +198,27 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(byte[])); - string exampleJson = null; - exampleJson = "\"\""; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(byte[]); //TODO: Change the data returned - return new ObjectResult(example); + List payload = new List(); + foreach (string aasId in aasIds) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); + if (aasReturn != null) + { + payload.Add(aasReturn.AAS); + } + } + + //TODO: NotSure + foreach (string submodelId in submodelIds) + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + if (submodel != null) + { + payload.Add(submodel); + } + } + + return new ObjectResult(payload); } /// @@ -463,10 +477,8 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] s { return new ObjectResult(aasReturn.AAS); } - else if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) - { - return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); - } + + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); } return NotFound(); @@ -558,15 +570,38 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); } /// @@ -584,15 +619,32 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); } /// diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index a2e3a8c4d..df78178ba 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -1,9 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; using System.Text.RegularExpressions; using System.Threading; using AdminShellNS; using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers @@ -14,10 +18,7 @@ namespace IO.Swagger.Helpers public class AASHelper { private static AdminShellPackageEnv[] Packages; - /// - /// HandleId to operation result mapping for InvokeAsyncResult - /// - private static Dictionary opResultAsyncDict; + private Timer m_simulationTimer; /// /// Constructor @@ -25,7 +26,6 @@ public class AASHelper public AASHelper() { Packages = AasxServer.Program.env; - opResultAsyncDict = new Dictionary(); } internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) @@ -500,15 +500,125 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string extent = "withoutBlobValue"; } + OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); + + if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) + { + contractResolver.Deep = false; + } + + contractResolver.Content = content; + contractResolver.Extent = extent; + if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) { obj = GetObjectReference(obj); } - //Handle Level - var json = ApplyLevelModifier(level, obj); + + if (content.Equals("path", StringComparison.OrdinalIgnoreCase)) + { + List idShortPath = new List(); + GetIdShortPath(obj, level, idShortPath); + return idShortPath; + } + + var settings = new JsonSerializerSettings(); + if (content.Equals("value", StringComparison.OrdinalIgnoreCase)) + { + //settings.Converters.Add(new ValueOnlyJsonConverter(true, obj)); + //var jsonTest = JsonConvert.SerializeObject(obj, settings); + object output = GetValueOnly(obj, level); + var jsonOutput = JsonConvert.SerializeObject(output, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); + return jsonOutput; + } + + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; } + private object GetValueOnly(object obj, string level) + { + try + { + if (obj is Submodel submodel) + { + List values = new List(); + foreach (var smElement in submodel.submodelElements) + { + object value = GetValueOnly(smElement.submodelElement, level); + values.Add(value); + } + return values; + } + else if (obj is SubmodelElementCollection collection) + { + if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + List values = new List(); + foreach (var smElement in collection.value) + { + object value = GetValueOnly(smElement.submodelElement, level); + values.Add(value); + } + return values; + } + } + else if (obj is SubmodelElement submodelElement) + { + return submodelElement.ToValueOnlySerialization(); + } + else + { + Console.WriteLine("Not supported"); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + } + return null; + } + + private void GetIdShortPath(object obj, string level, List idShortPath) + { + if (obj is Submodel submodel) + { + idShortPath.Add(submodel.idShort); + foreach (var smElement in submodel.submodelElements) + { + GetIdShortPath(smElement.submodelElement, level, idShortPath); + } + } + else if (obj is SubmodelElementCollection collection) + { + idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + foreach (var smEle in collection.value) + { + GetIdShortPath(smEle.submodelElement, level, idShortPath); + } + } + } + else if (obj is Entity entity) + { + idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + //TODO: look for definition and children* + } + else if (obj is SubmodelElement smEle) + { + idShortPath.Add(idShortPath.Last() + "." + smEle.idShort); + } + else + { + Console.WriteLine($"Outout modifier pathis not applicable to {obj.GetType()}"); + } + } + private object GetObjectReference(object obj) { if (obj is AdminShellV20.AdministrationShell aas) @@ -524,22 +634,6 @@ private object GetObjectReference(object obj) } } - private object ApplyLevelModifier(string level, object obj) - { - OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); - - if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) - { - contractResolver.Deep = false; - } - - var settings = new JsonSerializerSettings(); - if (contractResolver != null) - settings.ContractResolver = contractResolver; - var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - return json; - } - internal bool AddSubmodel(Submodel submodel) { bool emptyPackageAvailable = false; @@ -676,6 +770,12 @@ internal object FindAllSubmodelsBySemanticId(SemanticId reqSemaniticId) return outputSubmodels; } + internal object GetOperationAsyncResult(string handleId) + { + AsyncOperationResultStorage.opResultAsyncDict.TryGetValue(handleId, out Models.OperationResult opResult); + return opResult; + } + internal List FindAllSubmodelsByIdShort(string idShort) { var outputSubmodels = new List(); @@ -747,6 +847,7 @@ internal Models.OperationHandle InvokeOperationAsync(Operation operation, Models { opHandle.RequestId = body.RequestId; opHandle.HandleId = Guid.NewGuid().ToString(); + InvokeTestOperation(opHandle); } return opHandle; @@ -777,15 +878,21 @@ private void InvokeTestOperation(Models.OperationHandle opHandle) opResult.ExecutionResult = result; opResult.RequestId = opHandle.RequestId; - opResultAsyncDict.Add(opHandle.HandleId, opResult); + AsyncOperationResultStorage.opResultAsyncDict.Add(opHandle.HandleId, opResult); - Thread.Sleep(120000); // Sleep for two min - //Running - opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.RunningEnum; + m_simulationTimer = new Timer(DoSimulation, null, 5000, 5000); + } + + private void DoSimulation(object state) + { + var random = new Random(); + var values = Enum.GetValues(typeof(Models.OperationResult.ExecutionStateEnum)); - Thread.Sleep(120000); // Sleep for two min - //Running - opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; + foreach (var handleId in AsyncOperationResultStorage.opResultAsyncDict.Keys) + { + var value = (Models.OperationResult.ExecutionStateEnum)values.GetValue(random.Next(values.Length)); + AsyncOperationResultStorage.opResultAsyncDict[handleId].ExecutionState = value; + } } /// @@ -846,4 +953,15 @@ public class FindAasReturn public AdminShell.AdministrationShell AAS { get; set; } = null; public int IPackage { get; set; } = -1; } + + /// + /// Test class to store handle id and operation execution results + /// + public static class AsyncOperationResultStorage + { + /// + /// HandleId vs Operation Result of the corresponding Opration + /// + public static Dictionary opResultAsyncDict = new Dictionary(); + } } diff --git a/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs b/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs new file mode 100644 index 000000000..ea0695cc6 --- /dev/null +++ b/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using IO.Swagger.Services; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Helpers +{ + /// + /// + /// + public class BasicAuthenticationHandler : AuthenticationHandler + { + private readonly IUserService _userService; + + /// + /// Constructor + /// + /// + /// + /// + /// + /// + public BasicAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder, + ISystemClock clock, + IUserService userService) + : base(options, logger, encoder, clock) + { + _userService = userService; + } + + protected override Task HandleChallengeAsync(AuthenticationProperties properties) + { + Response.Headers["WWW-Authenticate"] = "Basic"; + return base.HandleChallengeAsync(properties); + } + + + + /// + /// + /// + /// + protected override Task HandleAuthenticateAsync() + { + // skip authentication if endpoint has [AllowAnonymous] attribute + var endpoint = Context.GetEndpoint(); + if (endpoint?.Metadata?.GetMetadata() != null) + return Task.FromResult(AuthenticateResult.NoResult()); + + if (!Request.Headers.ContainsKey("Authorization")) + return Task.FromResult(AuthenticateResult.Fail("Missing Authorization Header")); + bool isAuthenticated; + + string username; + try + { + var authHeader = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]); + var credentialBytes = Convert.FromBase64String(authHeader.Parameter); + var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] { ':' }, 2); + username = credentials[0]; + var password = credentials[1]; + isAuthenticated = _userService.Authenticate(username, password); + } + catch + { + return Task.FromResult(AuthenticateResult.Fail("Invalid Authorization Header")); + } + + if (!isAuthenticated) + return Task.FromResult(AuthenticateResult.Fail("Invalid Username or Password")); + + var claims = new[] { + new Claim(ClaimTypes.Name, username), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return Task.FromResult(AuthenticateResult.Success(ticket)); + } + } +} diff --git a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs b/src/IO.Swagger/Helpers/JsonSerializerExtension.cs new file mode 100644 index 000000000..e20fd9fb7 --- /dev/null +++ b/src/IO.Swagger/Helpers/JsonSerializerExtension.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace IO.Swagger.Helpers +{ + public static class JsonSerializerExtension + { + private static readonly ConditionalWeakTable CwtUseSensitive = new ConditionalWeakTable(); + + public static JsonSerializer UseSensitive(this JsonSerializer options) + { + CwtUseSensitive.AddOrUpdate(options, null); + return options; + } + + public static bool HasSensitive(this JsonSerializer options) => + CwtUseSensitive.TryGetValue(options, out _); + } +} diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index c050ad220..389905057 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,7 +1,11 @@ -using System.Reflection; +using System; +using System.Collections.Generic; +using System.Reflection; using AdminShellNS; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers { @@ -11,13 +15,25 @@ namespace IO.Swagger.Helpers /// public class OutputModifierContractResolver : DefaultContractResolver { - public bool AasHasViews = true; - public bool BlobHasValue = false; // only true, if extent modifier is withBLOBValue - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; private bool deep = true; private string content = "normal"; + private string extent = "withoutBlobValue"; + + /// + /// string: PropertyName to be excluded + /// Type: Class from which property needs to be excluded + /// + private Dictionary> excludingProperties; + + + /// + /// Constructor + /// + public OutputModifierContractResolver() + { + this.excludingProperties = new Dictionary>(); + AddToExcludingProperties(typeof(Blob), "value"); // By Default withoutBLOB + } @@ -31,17 +47,36 @@ public bool Deep get => deep; set { + //Core if (value == false) { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - this.BlobHasValue = false; - this.AasHasViews = false; + AddToExcludingProperties(typeof(AdministrationShell), "views"); + AddToExcludingProperties(typeof(Blob), "value"); + AddToExcludingProperties(typeof(SubmodelElementCollection), "value"); + AddToExcludingProperties(typeof(Operation), "in"); + AddToExcludingProperties(typeof(Operation), "out"); + } } } + + private void AddToExcludingProperties(Type type, string propName) + { + if (excludingProperties.ContainsKey(type)) + { + excludingProperties.TryGetValue(type, out List propNames); + if (!propNames.Contains(propName)) + { + propNames.Add(propName); + } + } + else + { + excludingProperties.Add(type, new List { propName }); + } + } + /// /// The enumeration Content indicates the kind of the response content’s serialization. /// @@ -51,9 +86,61 @@ public string Content set { content = value; + if (value.Equals("trimmed", StringComparison.OrdinalIgnoreCase)) + { + AddToExcludingProperties(typeof(AdministrationShell), "security"); + AddToExcludingProperties(typeof(AdministrationShell), "views"); + AddToExcludingProperties(typeof(AdministrationShell), "asset"); + AddToExcludingProperties(typeof(AdministrationShell), "submodels"); + AddToExcludingProperties(typeof(Submodel), "submodelElements"); + AddToExcludingProperties(typeof(SubmodelElementCollection), "value"); // TODO: Later as per data V3 + AddToExcludingProperties(typeof(Entity), "statements"); + AddToExcludingProperties(typeof(Entity), "asset"); // TODO: Later as per data V3 + AddToExcludingProperties(typeof(BasicEvent), "observed"); + AddToExcludingProperties(typeof(Property), "value"); + AddToExcludingProperties(typeof(Property), "valueId"); + AddToExcludingProperties(typeof(MultiLanguageProperty), "value"); + AddToExcludingProperties(typeof(MultiLanguageProperty), "valueId"); + AddToExcludingProperties(typeof(AdminShellV20.Range), "min"); + AddToExcludingProperties(typeof(AdminShellV20.Range), "max"); + AddToExcludingProperties(typeof(RelationshipElement), "first"); + AddToExcludingProperties(typeof(RelationshipElement), "second"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "first"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "second"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "annotations"); + AddToExcludingProperties(typeof(Blob), "mimeType"); + AddToExcludingProperties(typeof(Blob), "value"); + AddToExcludingProperties(typeof(File), "mimeType"); + AddToExcludingProperties(typeof(File), "value"); + + } + } + } + + /// + /// The enumeration Extent indicates whether to include BLOB or not. + /// + public string Extent + { + get => extent; + set + { + extent = value; + if (value.Equals("WithBLOBValue", StringComparison.OrdinalIgnoreCase)) + { + if (excludingProperties.ContainsKey(typeof(Blob))) + { + excludingProperties.Remove(typeof(Blob)); + } + } } } + /// + /// + /// + public Dictionary> ExcludingProperties { get => excludingProperties; set => excludingProperties = value; } + /// /// /// @@ -63,28 +150,39 @@ public string Content protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { JsonProperty property = base.CreateProperty(member, memberSerialization); + bool excluded = false; + if (excludingProperties.ContainsKey(property.DeclaringType)) + { + excludingProperties.TryGetValue(property.DeclaringType, out List propNames); + foreach (string propName in propNames) + { + if (property.PropertyName == propName) + { + property.ShouldSerialize = + instance => + { + excluded = true; + return false; + }; + } + } + } - if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && property.PropertyName == "submodelElements") - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && (property.PropertyName == "in" || property.PropertyName == "out")) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && property.PropertyName == "views") - property.ShouldSerialize = instance => { return false; }; + //Encode the value + if (!excluded && property.DeclaringType == typeof(Blob)) + { + property.ShouldSerialize = + instance => + { + var value = Base64UrlEncoder.Encode(((Blob)instance).value); + ((Blob)instance).value = value; + return true; + }; + } return property; } - protected override IValueProvider CreateMemberValueProvider(MemberInfo member) - { - return base.CreateMemberValueProvider(member); - } } + } diff --git a/src/IO.Swagger/Services/UserService.cs b/src/IO.Swagger/Services/UserService.cs new file mode 100644 index 000000000..1c2f4eb8d --- /dev/null +++ b/src/IO.Swagger/Services/UserService.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace IO.Swagger.Services +{ + /// + /// + /// + public interface IUserService + { + /// + /// + /// + /// + /// + /// + bool Authenticate(string username, string password); + } + + /// + /// + /// + public class UserService : IUserService + { + /// + /// + /// + /// + /// + /// + public bool Authenticate(string username, string password) + { + return (!AasxServer.Program.noSecurity) || (username.Equals("admin") && password.Equals("admin")); + } + } +} From 8a8e86173dca251e77c3fb0b94525a9dd7b17f05 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 31 Jan 2022 16:08:12 +0100 Subject: [PATCH 07/53] Removing Basic Authentification --- src/AasxServerBlazor/Startup.cs | 60 ++++++++--------- src/AasxServerStandardBib/AdminShell.cs | 66 +++++++++++++++++++ .../AssetAdministrationShellRepositoryApi.cs | 2 +- 3 files changed, 97 insertions(+), 31 deletions(-) diff --git a/src/AasxServerBlazor/Startup.cs b/src/AasxServerBlazor/Startup.cs index 4f8b6430a..7a19223e4 100644 --- a/src/AasxServerBlazor/Startup.cs +++ b/src/AasxServerBlazor/Startup.cs @@ -63,11 +63,11 @@ public void ConfigureServices(IServiceCollection services) }) .AddXmlSerializerFormatters(); - // configure DI for application services - services.AddScoped(); - // configure basic authentication - services.AddAuthentication("BasicAuthentication") - .AddScheme("BasicAuthentication", null); services.AddAuthentication(); + //// configure DI for application services + //services.AddScoped(); + //// configure basic authentication + //services.AddAuthentication("BasicAuthentication") + // .AddScheme("BasicAuthentication", null); services.AddAuthentication(); services @@ -87,29 +87,29 @@ public void ConfigureServices(IServiceCollection services) TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") }); - c.AddSecurityDefinition("basic", new OpenApiSecurityScheme - { - Name = "Authorization", - Type = SecuritySchemeType.Http, - Scheme = "basic", - In = ParameterLocation.Header, - Description = "Basic Authorization header using the Bearer scheme." - }); - - c.AddSecurityRequirement(new OpenApiSecurityRequirement - { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = "basic" - } - }, - new string[] {} - } - }); + //c.AddSecurityDefinition("basic", new OpenApiSecurityScheme + //{ + // Name = "Authorization", + // Type = SecuritySchemeType.Http, + // Scheme = "basic", + // In = ParameterLocation.Header, + // Description = "Basic Authorization header using the Bearer scheme." + //}); + + //c.AddSecurityRequirement(new OpenApiSecurityRequirement + //{ + // { + // new OpenApiSecurityScheme + // { + // Reference = new OpenApiReference + // { + // Type = ReferenceType.SecurityScheme, + // Id = "basic" + // } + // }, + // new string[] {} + // } + //}); c.EnableAnnotations(); c.CustomSchemaIds(type => type.FullName); @@ -138,8 +138,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseStaticFiles(); app.UseRouting(); - app.UseAuthentication(); - app.UseAuthorization(); + //app.UseAuthentication(); + //app.UseAuthorization(); app.UseSwagger(); app.UseSwaggerUI(c => diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 92b5885c5..23f9d174c 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -7007,6 +7007,38 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("RelationshipElement", "Rel"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var listFirst = new List>(); + foreach (var key in first.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listFirst.Add(valueDict); + } + + var listSecond = new List>(); + foreach (var key in second.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listSecond.Add(valueDict); + } + + dynamic relObj = new ExpandoObject(); + relObj.first = listFirst; + relObj.second = listSecond; + output.Add(idShort, relObj); + return output; + } } public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren @@ -7131,6 +7163,40 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var listFirst = new List>(); + foreach (var key in first.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listFirst.Add(valueDict); + } + + var listSecond = new List>(); + foreach (var key in second.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listSecond.Add(valueDict); + } + + dynamic relObj = new ExpandoObject(); + relObj.first = listFirst; + relObj.second = listSecond; + relObj.annotation = annotations; + output.Add(idShort, relObj); + return output; + } } public class Capability : SubmodelElement diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 938928744..3895fe4a4 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -25,7 +25,7 @@ namespace IO.Swagger.Controllers /// /// /// - [Authorize] + //[Authorize] [ApiController] public class AssetAdministrationShellRepositoryApiController : ControllerBase { From 74cceae881e120d807be852d7989d705b0274442 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Wed, 2 Feb 2022 11:46:57 +0100 Subject: [PATCH 08/53] Wrapping Server Side exception --- .../AssetAdministrationShellRepositoryApi.cs | 1617 ++++++++++------- src/IO.Swagger/Helpers/AASHelper.cs | 92 +- 2 files changed, 991 insertions(+), 718 deletions(-) diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 3895fe4a4..4c0c7396d 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; using AdminShellNS; using IO.Swagger.Attributes; using IO.Swagger.Helpers; @@ -49,14 +50,21 @@ public AssetAdministrationShellRepositoryApiController() [SwaggerOperation("DeleteAssetAdministrationShellById")] public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { - var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); - if (deleted) + try { - AasxServer.Program.signalNewData(2); - return NoContent(); - } + var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - return NotFound($"Could not delete the AAS"); + return NotFound($"AAS not "); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -70,14 +78,21 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ [SwaggerOperation("DeleteConceptDescriptionById")] public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] string cdIdentifier) { - bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); - if (deleted) + try { - AasxServer.Program.signalNewData(2); - return NoContent(); - } + bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - return NotFound($"Could not delete the concept description {cdIdentifier}"); + return NotFound($"Could not delete the concept description. Please check the identifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -93,34 +108,41 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] [SwaggerOperation("DeleteSubmodelElementByPath")] public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out AdminShellV20.SubmodelElement parent); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if (deleted) + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); } /// @@ -135,28 +157,34 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { - submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, Base64UrlEncoder.Decode(idShortPath), out AdminShellV20.SubmodelElement parent); - if (submodelElement != null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if (deleted) + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); } /// @@ -171,17 +199,21 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] [SwaggerOperation("DeleteSubmodelReferenceById")] public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier) { - aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); - submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + try + { + bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (deleted) + { - bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (deleted) + return NoContent(); + } + + return NotFound($"Could not delete the submodel reference from AAS"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return NotFound($"Could not delete the submodel reference {submodelIdentifier} from AAS {aasIdentifier}"); } /// @@ -198,27 +230,34 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) { - List payload = new List(); - foreach (string aasId in aasIds) + try { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); - if (aasReturn != null) + //TODO: One of the open questions + List payload = new List(); + foreach (string aasId in aasIds) { - payload.Add(aasReturn.AAS); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); + if (aasReturn != null) + { + payload.Add(aasReturn.AAS); + } } - } - //TODO: NotSure - foreach (string submodelId in submodelIds) - { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); - if (submodel != null) + foreach (string submodelId in submodelIds) { - payload.Add(submodel); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + if (submodel != null) + { + payload.Add(submodel); + } } - } - return new ObjectResult(payload); + return new ObjectResult(payload); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -235,10 +274,10 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string assetIds, [FromQuery] string idShort) { - //TODO: Consider a case where both assetIds and idShort are present. - var aasList = new List(); - if (string.IsNullOrEmpty(assetIds) && string.IsNullOrEmpty(idShort)) + try { + var aasList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) @@ -247,23 +286,26 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string } } - return new ObjectResult(aasList); - } + //Filter w.r.t assetIds + if (!string.IsNullOrEmpty(assetIds)) + { + assetIds = Base64UrlEncoder.Decode(assetIds); + var assetIdList = JsonConvert.DeserializeObject>(assetIds); + aasList = aasHelper.FindAllAasByAssetIds(assetIdList); + } - if (!string.IsNullOrEmpty(assetIds)) - { - assetIds = Base64UrlEncoder.Decode(assetIds); - var assetIdList = JsonConvert.DeserializeObject>(assetIds); - return new ObjectResult(aasHelper.FindAllAasByAssetIds(assetIdList)); - } + //Filter w.r.t idShort + if (!string.IsNullOrEmpty(idShort)) + { + aasList = aasList.Where(x => (x.idShort != null) && x.idShort.Equals(idShort)).ToList(); + } - if (!string.IsNullOrEmpty(idShort)) + return new ObjectResult(aasList); + } + catch (Exception ex) { - return new ObjectResult(aasHelper.FindAllAasByIdShort(idShort)); + return BadRequest(ex.Message); } - - - return new ObjectResult(aasList); } /// @@ -280,45 +322,45 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShort, [FromQuery] string isCaseOf, [FromQuery] string dataSpecificationRef) { - //Return all the concept-descriptions from the server, NO Filter - if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef)) + try { - var cdList = new List(); + var output = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) { - cdList.AddRange(env.AasEnv.ConceptDescriptions); + output.AddRange(env.AasEnv.ConceptDescriptions); } } - return new ObjectResult(cdList); - } + //Filter a list w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } - //CDs filtered with idShort - if (!string.IsNullOrEmpty(idShort)) - { - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); - } + //Filter the list w.r.t. IsCaseOf + if (!string.IsNullOrEmpty(isCaseOf)) + { + var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); + output = output.Where(x => (x.IsCaseOf != null) && aasHelper.CompareIsCaseOf(x.IsCaseOf, isCaseOfObj)).ToList(); + } - //CDs filtered with isCaseOfReference - if (!string.IsNullOrEmpty(isCaseOf)) - { - var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); - } + //Filter the list w.r.t. dataSpecificationRef + if (!string.IsNullOrEmpty(dataSpecificationRef)) + { + var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); + output = output.Where(x => (x.embeddedDataSpecification != null) && aasHelper.CompareDataSpecification(x.embeddedDataSpecification, dataSpecRefReq)).ToList(); + } + + return new ObjectResult(output); - //CDs filtered with isCaseOfReference - if (!string.IsNullOrEmpty(dataSpecificationRef)) + } + catch (Exception ex) { - var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByDataSpecRef(dataSpecRefReq)); + return BadRequest(ex.Message); } - - //TODO:Re-do - return NoContent(); - } /// @@ -338,23 +380,30 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShor public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - // access AAS and Submodel - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - - if (submodel == null) + try { - return NotFound($"Submodel not found."); - } + // access AAS and Submodel + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - List submodelElements = new List(); - foreach (var smeWrapper in submodel.submodelElements) - { - submodelElements.Add(smeWrapper.submodelElement); - } + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } - var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); - return new ObjectResult(json); + return new ObjectResult(json); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -372,19 +421,25 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel != null) + try { - List submodelElements = new List(); - foreach (var smeWrapper in submodel.submodelElements) + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel != null) { - submodelElements.Add(smeWrapper.submodelElement); + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + + return new ObjectResult(json); } - return new ObjectResult(submodelElements); + return NotFound($"Submodel not found."); } - else + catch (Exception ex) { - return NotFound($"Submodel not found."); + return BadRequest(ex.Message); } } @@ -400,14 +455,18 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] string aasIdentifier) { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - return new ObjectResult(aasReturn.AAS.submodelRefs); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS.submodelRefs); + } + return NotFound($"AAS not found."); } - else + catch (Exception ex) { - return NotFound($"AAS not found."); + return BadRequest(ex.Message); } } @@ -425,34 +484,36 @@ public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] stri [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [FromQuery] string idShort) { - //Fetch all the submodels from the server - if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + try { - var submodelList = new List(); + var output = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) { - submodelList.AddRange(env.AasEnv.Submodels); + output.AddRange(env.AasEnv.Submodels); } } - return new ObjectResult(submodelList); - } + //Filter w.r.t. semanticId + if (!string.IsNullOrEmpty(semanticId)) + { + var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); + output = output.Where(x => (x.semanticId != null) && x.semanticId.Matches(reqSemaniticId)).ToList(); + } - if (!string.IsNullOrEmpty(idShort)) - { - return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); - } + //Filter w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } - if (!string.IsNullOrEmpty(semanticId)) + return new ObjectResult(output); + } + catch (Exception ex) { - var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); - return new ObjectResult(aasHelper.FindAllSubmodelsBySemanticId(reqSemaniticId)); + return BadRequest(ex.Message); } - - //TODO: Re-Do - return NoContent(); } /// @@ -468,20 +529,26 @@ public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [Fro [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] string aasIdentifier, [FromQuery] string content) { - //TODO: Content ?? - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - //If content is empty or Normal, return the object as it is - if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) { - return new ObjectResult(aasReturn.AAS); + //If content is empty or Normal, return the object as it is + if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasReturn.AAS); + } + + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); } - return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); + return NotFound(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); } - - return NotFound(); } /// @@ -496,13 +563,21 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - return new ObjectResult(aasReturn.AAS); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } - return NotFound(); + return NotFound($"Please check aasIdentifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } } /// @@ -519,17 +594,24 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required] string aa { //TODO:Change to AssetInformation in V3 //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); - if (asset != null) + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) { - return new ObjectResult(asset); + var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); + if (asset != null) + { + return new ObjectResult(asset); + } } - } - return NotFound(); + return NotFound(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } @@ -545,13 +627,21 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required] string aa [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] string cdIdentifier) { - var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); - if (conceptDescription != null) + try { - return new ObjectResult(conceptDescription); - } + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); + if (conceptDescription != null) + { + return new ObjectResult(conceptDescription); + } - return NotFound($"Concept Description {cdIdentifier} not found"); + return NotFound($"Could not delete the concept description. Please check the identifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } } /// @@ -570,38 +660,45 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - if (string.IsNullOrEmpty(handleId)) + try { - return BadRequest($"Invalid HandleId."); - } - //Check if aas exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found"); - } + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } - var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); - if (opResult != null) + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); + } + catch (Exception ex) { - return new ObjectResult(opResult); + return BadRequest(ex.Message); } - - return NotFound($"Operation with the handle id not found"); } /// @@ -619,32 +716,39 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - if (string.IsNullOrEmpty(handleId)) + try { - return BadRequest($"Invalid HandleId."); - } + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } - var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); - if (opResult != null) + return NotFound($"Operation with the handle id not found"); + } + catch (Exception ex) { - return new ObjectResult(opResult); + return BadRequest(ex.Message); } - - return NotFound($"Operation with the handle id not found"); } /// @@ -663,21 +767,26 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider other parameters súch as level, content, & extent - - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); - } + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } - var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); - if (json != null) + return NotFound($"Either AAS or Submodel not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Either AAS or Submodel not found"); } /// @@ -697,33 +806,40 @@ public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentif [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found. Please check the identifier."); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found. Please check the identifier."); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); - if (json != null) + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel Element not found"); } /// @@ -742,28 +858,33 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] stri [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: support for Content, extent and level - - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); - if (json != null) + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel Element not found"); } /// @@ -781,20 +902,26 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider rest of the parameters i.e., level, content & extent - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"The Submodel {submodelIdentifier} not found"); - } + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"The Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } - var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); - if (json != null) + return NotFound($"Submodel not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel not found"); } /// @@ -814,52 +941,59 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { - //Check if aas exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found"); - } - - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } - - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } - - if (submodelElement is AdminShellV20.Operation operation) + try { - //Primary checks for inout and input variables - if (operation.inputVariable.Count != body.InputArguments.Count) + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) { - return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + return NotFound($"AAS not found"); } - if (operation.inoutputVariable.Count != body.InputArguments.Count) + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) { - return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + return NotFound($"Submodel not found."); } - if ((_async != null) && (!(bool)_async)) + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) { - return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + return NotFound($"Operation {idShortPath} not found."); } - var opHandle = aasHelper.InvokeOperationAsync(operation, body); - var json = JsonConvert.SerializeObject(opHandle); - return new ObjectResult(json); - } - else + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } + + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } + } + catch (Exception ex) { - return NotFound($"Element in the IdShortPath is not an Operation."); + return BadRequest(ex.Message); } } @@ -879,45 +1013,52 @@ public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [ [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationRequest body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } - - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) + try { - return NotFound($"Operation {idShortPath} not found."); - } - - if (submodelElement is AdminShellV20.Operation operation) - { - //Primary checks for inout and input variables - if (operation.inputVariable.Count != body.InputArguments.Count) + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) { - return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + return NotFound($"Submodel not found."); } - if (operation.inoutputVariable.Count != body.InputArguments.Count) + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) { - return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + return NotFound($"Operation {idShortPath} not found."); } - if ((_async != null) && (!(bool)_async)) + if (submodelElement is AdminShellV20.Operation operation) { - return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); - } + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } - var opHandle = aasHelper.InvokeOperationAsync(operation, body); - var json = JsonConvert.SerializeObject(opHandle); - return new ObjectResult(json); + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } - else + catch (Exception ex) { - return NotFound($"Element in the IdShortPath is not an Operation."); + return BadRequest(ex.Message); } } @@ -931,29 +1072,37 @@ public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationReq [ValidateModelState] [SwaggerOperation("PostAssetAdministrationShell")] [SwaggerResponse(statusCode: 201, type: typeof(AssetAdministrationShell), description: "Asset Administration Shell created successfully")] - //public virtual IActionResult PostAssetAdministrationShell([FromBody]AssetAdministrationShell body) + //public virtual IActionResult PostAssetAdministrationShell([FromBody] AssetAdministrationShell body) public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - //Check if already exists - var aasReturn = aasHelper.FindAas(body.idShort); - if (aasReturn.AAS != null) - { - return Conflict($"Asset Administration Shell {body.idShort} already exists."); - } + //Check if already exists + var aasReturn = aasHelper.FindAas(body.identification.id); + if (aasReturn.AAS != null) + { + return Conflict($"Asset Administration Shell already exists."); + } - bool added = aasHelper.AddAas(body); - if (added) + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + return BadRequest(ex.Message); + throw; } - - return Ok($"Error: not added since datastructure completely filled already"); } @@ -970,26 +1119,34 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV //public virtual IActionResult PostConceptDescription([FromBody]ConceptDescription body) public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.ConceptDescription body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Concept Description."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } - //Check if already exists - var conceptDescription = aasHelper.FindConceptDescription(body.idShort, out _); - if (conceptDescription != null) - { - return Conflict($"Concept Description {body.idShort} already exists."); - } + //Check if already exists + var conceptDescription = aasHelper.FindConceptDescription(body.identification.id, out _); + if (conceptDescription != null) + { + return Conflict($"Concept Description {body.idShort} already exists."); + } - bool added = aasHelper.AddConceptDescription(body); - if (added) + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(1); + return Created($"Concept Description {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Concept Description {body.idShort} created successfully.", body); + return BadRequest(ex.Message); + throw; } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1005,26 +1162,33 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con //public virtual IActionResult PostSubmodel([FromBody]Submodel body) public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - //Check if already exists - var submodel = aasHelper.FindSubmodel(body.idShort); - if (submodel != null) - { - return Conflict($"Submodel {body.idShort} already exists."); - } + //Check if already exists + var submodel = aasHelper.FindSubmodel(body.identification.id); + if (submodel != null) + { + return Conflict($"Submodel {body.idShort} already exists."); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel created successfully.", body); + } - bool added = aasHelper.AddSubmodel(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Submodel {body.idShort} created successfully.", body); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1045,44 +1209,48 @@ public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider rest of the parameters, i.e., level, content & extent - - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - //Check for idShort in SubmodelElement - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"No IdShort found in the submodel element"); - } + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } - //Check if submodel element already exists in the submodel - var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if (submodelElement != null) - { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); - } + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(submodel, body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1104,52 +1272,60 @@ public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.Submod //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - //IdShortPath is a path to the parent element - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (parentSME == null) - { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); - } + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } - //Check if requested submodel element already exists in the parent SME - if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) - { - var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if (existingSME != null) + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } } - } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element created successfully", output); + return BadRequest(ex.Message); + throw; } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1170,45 +1346,52 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - //IdShortPath is a path to the parent element - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (parentSME == null) - { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); - } + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } - //Check if requested submodel element already exists in the parent SME - if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) - { - var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if (existingSME != null) + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } } - } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element created successfully", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1228,35 +1411,42 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - //Check for idShort in SubmodelElement - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"No IdShort found in the submodel element"); - } + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } - //Check if submodel element already exists in the submodel - var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if (submodelElement != null) - { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); - } + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(submodel, body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1273,39 +1463,46 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Reference body, [FromRoute][Required] string aasIdentifier) { - if (body.Count == 0) + try { - return BadRequest($"No references present in the request payload."); - } - else if (body.Count != 1) - { - return BadRequest($"More than one references present in the request payload."); - } + if (body.Count == 0) + { + return BadRequest($"No references present in the request payload."); + } + else if (body.Count != 1) + { + return BadRequest($"More than one references present in the request payload."); + } - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS {aasIdentifier} not found."); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - //Check if Submodel with this reference exists - var submodel = aasHelper.FindSubmodelWithReference(body); - if (submodel == null) - { - return BadRequest($"No Submodel with this reference present in the server"); - } + //Check if Submodel with this reference exists + var submodel = aasHelper.FindSubmodelWithReference(body); + if (submodel == null) + { + return BadRequest($"No Submodel with this reference present in the server"); + } - //Check if reference already exists with the AAS - if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + //Check if reference already exists with the AAS + if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + { + return Conflict($"The Submodel Reference already exists in AAS"); + } + + aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); + AasxServer.Program.signalNewData(1); + return Created($"Submodel reference created successfully.", body); + } + catch (Exception ex) { - return Conflict($"The Submodel Reference already exists in AAS {aasIdentifier}"); + return BadRequest(ex.Message); } - aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); - AasxServer.Program.signalNewData(1); - return Created($"Submodel reference created successfully.", body); - } /// @@ -1322,26 +1519,27 @@ public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Refe //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier, [FromQuery] string content) { - //TODO: content?? - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - if (!aasIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {aasIdentifier} and payload do not match"); - } + bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, content: content); + return Created($"AAS updated successfully.", output); + } - bool added = aasHelper.AddAas(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, content: content); - return Created($"AAS {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1357,25 +1555,26 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV2 //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - //TODO: What if iDShort needs to be updated - if (!aasIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {aasIdentifier} and payload do not match"); - } + bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(1); + return NoContent(); + } - bool added = aasHelper.AddAas(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1391,26 +1590,33 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShe //public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset body, [FromRoute][Required] string aasIdentifier) { - //Check if identification exists - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Asset."); - } + //Check if identification exists + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Asset."); + } - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found."); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - bool added = aasHelper.AddAsset(body, aasReturn); - if (added) + bool added = aasHelper.AddAsset(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1426,24 +1632,26 @@ public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20.ConceptDescription body, [FromRoute][Required] string cdIdentifier) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Concept Description."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } - if (!cdIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {cdIdentifier} and payload do not match"); - } + bool added = aasHelper.AddConceptDescription(body, Base64UrlEncoder.Decode(cdIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(1); + return NoContent(); + } - bool added = aasHelper.AddConceptDescription(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1463,39 +1671,39 @@ public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20. //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider other parameters i.e., level, content, extent - - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } - - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS {aasIdentifier} not found."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - if (!submodelIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {submodelIdentifier} and payload do not match"); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - bool added = aasHelper.AddSubmodel(body); - if (added) - { - //Check if AAS has the submodelRef, if not create one. - var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); - if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + if (added) { - aasReturn.AAS.submodelRefs.Add(newsmRef); + //Check if AAS has the submodelRef, if not create one. + var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); + if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + { + aasReturn.AAS.submodelRefs.Add(newsmRef); + } + AasxServer.Program.signalNewData(1); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); - } - return Ok($"Error: not added since datastructure completely filled already"); + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -1516,42 +1724,54 @@ public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } - //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) - { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + if (!idShortPath.Contains('.')) + { + return BadRequest($"Please check the idShortPath again."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1571,35 +1791,42 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } - //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) - { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element updated successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element updated successfully.", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1618,25 +1845,27 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] Adm //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - if (!submodelIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {submodelIdentifier} and payload do not match"); - } + bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); + } - bool added = aasHelper.AddSubmodel(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } } } diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index df78178ba..271a92d7f 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -141,6 +141,7 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int return null; } + //One of the open Questions //TODO: Check if asset needs to be deleted? an asset can be referenced in many shells. internal bool DeleteAASAndAsset(string aasIdentifier) { @@ -171,13 +172,18 @@ internal bool DeleteAASAndAsset(string aasIdentifier) return success; } - internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, object parent) { if (parent is SubmodelElementCollection parentColl) { parentColl.value.Remove(submodelElement); return true; } + else if (parent is Submodel parentSm) + { + parentSm.Remove(submodelElement); + return true; + } return false; } @@ -212,6 +218,7 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); + AasxServer.Program.signalNewData(1); return true; } } @@ -239,14 +246,6 @@ internal Submodel FindSubmodel(string submodelIdentifier) if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) return null; - //TODO: Check again - // via handle - //var specialHandles = CreateHandlesFromRawUrl(rawUrl); - //var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); - //if (handleId != null && handleId.identification != null) - // return Packages[0].AasEnv.FindSubmodel(handleId.identification); - - // no, iterate & find foreach (var submodel in Packages[0].AasEnv.Submodels) { if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) @@ -263,7 +262,7 @@ internal Submodel FindSubmodel(string submodelIdentifier) /// /// /// - internal bool AddAas(AdministrationShell aas) + internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; @@ -271,11 +270,13 @@ internal bool AddAas(AdministrationShell aas) { if (Packages[envi] != null) { - var existingAas = Packages[envi].AasEnv.FindAAS(aas.identification); - if (existingAas != null) + aasIdentifier ??= aas.identification.id; + var existingAas = FindAas(aasIdentifier); + if (existingAas.AAS != null) { - Packages[envi].AasEnv.AdministrationShells.Remove(existingAas); + Packages[envi].AasEnv.AdministrationShells.Remove(existingAas.AAS); Packages[envi].AasEnv.AdministrationShells.Add(aas); + AasxServer.Program.signalNewData(1); return true; } } @@ -295,25 +296,27 @@ internal bool AddAas(AdministrationShell aas) { Packages[emptyPackageIndex] = new AdminShellPackageEnv(); Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); + AasxServer.Program.signalNewData(1); return true; } return false; } - internal bool AddConceptDescription(ConceptDescription conceptDescription) + internal bool AddConceptDescription(ConceptDescription conceptDescription, string cdIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + cdIdentifier ??= conceptDescription.identification.id; for (int envi = 0; envi < Packages.Length; envi++) { if (Packages[envi] != null) { - var existingCD = Packages[envi].AasEnv.FindConceptDescription(conceptDescription.identification); + var existingCD = FindConceptDescription(cdIdentifier, out int packageIndex); if (existingCD != null) { - Packages[envi].AasEnv.ConceptDescriptions.Remove(existingCD); - Packages[envi].AasEnv.ConceptDescriptions.Add(conceptDescription); + Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(existingCD); + Packages[packageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); return true; } } @@ -459,7 +462,23 @@ internal List FindAllConceptDescriptionsByIsCaseOf(List isCaseOf1, List isCaseOf2) + internal bool CompareDataSpecification(HasDataSpecification embeddedDataSpecification, DataSpecificationRef dataSpecRefReq) + { + if (embeddedDataSpecification != null) + { + foreach (EmbeddedDataSpecification embDataSpec in embeddedDataSpecification) + { + if (embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + { + return true; + } + } + } + + return false; + } + + internal bool CompareIsCaseOf(List isCaseOf1, List isCaseOf2) { foreach (Reference isCaseOf1_Ref in isCaseOf1) { @@ -570,6 +589,16 @@ private object GetValueOnly(object obj, string level) { return submodelElement.ToValueOnlySerialization(); } + else if (obj is List smEleList) + { + List values = new List(); + foreach (var smElement in smEleList) + { + object value = GetValueOnly(smElement, level); + values.Add(value); + } + return values; + } else { Console.WriteLine("Not supported"); @@ -627,6 +656,16 @@ private object GetObjectReference(object obj) return submodel.GetReference(); else if (obj is SubmodelElement submodelElement) return submodelElement.GetReference(); + else if (obj is List smEleList) + { + List values = new List(); + foreach (var smElement in smEleList) + { + object value = GetObjectReference(smElement); + values.Add(value); + } + return values; + } else { Console.WriteLine("Error: Object not handled for the Reference type modifier."); @@ -634,15 +673,16 @@ private object GetObjectReference(object obj) } } - internal bool AddSubmodel(Submodel submodel) + internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + submodelIdentifier ??= submodel.identification.id; for (int envi = 0; envi < Packages.Length; envi++) { if (Packages[envi] != null) { - var existingSubmodel = Packages[envi].AasEnv.FindSubmodel(submodel.identification); + var existingSubmodel = FindSubmodel(submodelIdentifier); if (existingSubmodel != null) { Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); @@ -722,7 +762,7 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// e.g. SMEColl_idShort.SME_idShort /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out SubmodelElement parent) + internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out object parent) { parent = null; if (idShortPath.Contains('.')) @@ -735,7 +775,7 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS { if (submodelElement is SubmodelElementCollection collection) { - return FindSubmodelElementByPath(collection, idShorts[1], out parent); + return FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); } } } @@ -744,7 +784,11 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS { var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); if (smeWrapper != null) + { + parent = submodel; return smeWrapper.submodelElement; + } + } return null; @@ -796,7 +840,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) return outputSubmodels; } - internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection smeColl, string idShortPath, out SubmodelElement parent) + internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) { parent = null; string[] idShorts = idShortPath.Split('.', 2); @@ -808,7 +852,7 @@ internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection sme if (submodelElement is SubmodelElementCollection collection) { parent = collection; - FindSubmodelElementByPath(collection, idShorts[1], out parent); + FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); } else if (submodelElement is SubmodelElement) { From 21b3d0d080c4545d90bbc655fdfeaa6c361469b3 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed, 9 Feb 2022 08:51:12 +0100 Subject: [PATCH 09/53] Swagger Project path fixed, Swagger Test Project added (#93) Swagger Project path fixed, Swagger Test Project added (#93) --- src/IO.Swagger/IO.Swagger.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj index 4aa64e512..0f5fb677b 100644 --- a/src/IO.Swagger/IO.Swagger.csproj +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -19,6 +19,6 @@ - + From 3c47de10f1c904980b0f574de8a595d3c92d90ce Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed, 9 Feb 2022 09:58:55 +0100 Subject: [PATCH 10/53] added test project (#94) added test project (#94) --- src/AasxServer.sln | 18 +++++++- src/IO.Swagger.Test/AASHelperTest.cs | 36 ++++++++++++++++ src/IO.Swagger.Test/IO.Swagger.Test.csproj | 21 ++++++++++ src/IO.Swagger/Helpers/AASHelper.cs | 2 +- src/IO.Swagger/IO.Swagger.csproj | 49 ++++++++++++---------- 5 files changed, 101 insertions(+), 25 deletions(-) create mode 100644 src/IO.Swagger.Test/AASHelperTest.cs create mode 100644 src/IO.Swagger.Test/IO.Swagger.Test.csproj diff --git a/src/AasxServer.sln b/src/AasxServer.sln index ec3f4c8a7..2020ab76a 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29306.81 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerCore", "AasxServerCore\AasxServerCore.csproj", "{7C0704A8-85C7-4FC9-B12D-C7B9E63EF7B6}" EndProject @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxSer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "IO.Swagger\IO.Swagger.csproj", "{478697A0-89E4-4039-902E-0F13EA4EAD72}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "IO.Swagger.Test\IO.Swagger.Test.csproj", "{1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -89,6 +91,18 @@ Global {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.Build.0 = Release|Any CPU {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.ActiveCfg = Release|Any CPU {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x64.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x86.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|Any CPU.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x64.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x64.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x86.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/IO.Swagger.Test/AASHelperTest.cs b/src/IO.Swagger.Test/AASHelperTest.cs new file mode 100644 index 000000000..5ba34ed4b --- /dev/null +++ b/src/IO.Swagger.Test/AASHelperTest.cs @@ -0,0 +1,36 @@ +using IO.Swagger.Helpers; +using NUnit.Framework; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Test +{ + public class AASHelperTest + { + + + + private AASHelper? _helper; + + [SetUp] + public void Setup() + { + _helper = new AASHelper(); + } + + [Test] + public void Test1() + { + var sm = new Submodel(); + var l1 = new SubmodelElementCollection { idShort = "level1" }; + var l2 = new SubmodelElementCollection { idShort = "level2" }; + var l3 = new SubmodelElementCollection { idShort = "level3" }; + var l4 = new SubmodelElementCollection { idShort = "level4" }; + l3.Add(l4); + l2.Add(l3); + l1.Add(l2); + sm.Add(l1); + var found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); + Assert.AreEqual(found.idShort, "level2"); + } + } +} \ No newline at end of file diff --git a/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/src/IO.Swagger.Test/IO.Swagger.Test.csproj new file mode 100644 index 000000000..97c7a63d5 --- /dev/null +++ b/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 271a92d7f..13df820b6 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -843,7 +843,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) { parent = null; - string[] idShorts = idShortPath.Split('.', 2); + string[] idShorts = idShortPath.Split('.', 2); // idShortPath might be empty or without '.' foreach (var smeWrapper in smeColl.value) { var submodelElement = smeWrapper.submodelElement; diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj index 0f5fb677b..33b969f78 100644 --- a/src/IO.Swagger/IO.Swagger.csproj +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -1,24 +1,29 @@  - - IO.Swagger - IO.Swagger - netcoreapp3.1 - true - true - IO.Swagger - IO.Swagger - - - - - - - - - - - - - - + + IO.Swagger + IO.Swagger + netcoreapp3.1 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + + + + + + + + <_Parameter1>IO.Swagger.Test + + From bdaaad1c776882933cb61b3ad315fc206efaa728 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Wed, 9 Feb 2022 13:58:00 +0100 Subject: [PATCH 11/53] BugFix:DotSeperated IdShortPath --- src/IO.Swagger/Helpers/AASHelper.cs | 93 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 13df820b6..257a92f1f 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -172,6 +172,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) return success; } + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, object parent) { if (parent is SubmodelElementCollection parentColl) @@ -261,6 +262,7 @@ internal Submodel FindSubmodel(string submodelIdentifier) /// Similar to HTTP PUT /// /// + /// /// internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { @@ -624,7 +626,14 @@ private void GetIdShortPath(object obj, string level, List idShortPath) } else if (obj is SubmodelElementCollection collection) { - idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + if (idShortPath.Count == 0) + { + idShortPath.Add(collection.idShort); + } + else + { + idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + } if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) { foreach (var smEle in collection.value) @@ -635,7 +644,14 @@ private void GetIdShortPath(object obj, string level, List idShortPath) } else if (obj is Entity entity) { - idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + if (idShortPath.Count == 0) + { + idShortPath.Add(entity.idShort); + } + else + { + idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + } //TODO: look for definition and children* } else if (obj is SubmodelElement smEle) @@ -758,39 +774,53 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// /// /// - /// + /// /// e.g. SMEColl_idShort.SME_idShort - /// Parent of SME, bzw. SMEColl + /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out object parent) + + internal SubmodelElement FindSubmodelElementByPath(object parent, string idShortPath, out object outParent) { - parent = null; + outParent = parent; if (idShortPath.Contains('.')) { string[] idShorts = idShortPath.Split('.', 2); - foreach (var smeWrapper in submodel.submodelElements) + if (parent is Submodel submodel) { - var submodelElement = smeWrapper.submodelElement; - if (submodelElement.idShort.Equals(idShorts[0])) + var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]).submodelElement; + if (submodelElement != null) { - if (submodelElement is SubmodelElementCollection collection) - { - return FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); - } + return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + } + } + else if (parent is SubmodelElementCollection collection) + { + var submodelElement = collection.FindFirstIdShort(idShorts[0]).submodelElement; + if (submodelElement != null) + { + return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); } } } else { - var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); - if (smeWrapper != null) + if (parent is Submodel submodel) + { + var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath).submodelElement; + if (submodelElement != null) + { + return submodelElement; + } + } + else if (parent is SubmodelElementCollection collection) { - parent = submodel; - return smeWrapper.submodelElement; + var submodelElement = collection.FindFirstIdShort(idShortPath).submodelElement; + if (submodelElement != null) + { + return submodelElement; + } } - } - return null; } @@ -840,31 +870,6 @@ internal List FindAllSubmodelsByIdShort(string idShort) return outputSubmodels; } - internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) - { - parent = null; - string[] idShorts = idShortPath.Split('.', 2); // idShortPath might be empty or without '.' - foreach (var smeWrapper in smeColl.value) - { - var submodelElement = smeWrapper.submodelElement; - if (submodelElement.idShort.Equals(idShorts[0])) - { - if (submodelElement is SubmodelElementCollection collection) - { - parent = collection; - FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); - } - else if (submodelElement is SubmodelElement) - { - parent = smeColl; - return submodelElement; - } - } - } - - return null; - } - internal object InvokeOperationSync(Operation operation, Models.OperationRequest operationRequest) { Models.OperationResult opResult = new Models.OperationResult(); From 12a3f8afcb187fd50e257326558bafbe8e798b69 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu, 10 Feb 2022 08:47:25 +0100 Subject: [PATCH 12/53] test for fixing blob modifier (#95) test for fixing blob modifier (#95) --- src/IO.Swagger.Test/AASHelperTest.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/IO.Swagger.Test/AASHelperTest.cs b/src/IO.Swagger.Test/AASHelperTest.cs index 5ba34ed4b..348c8315e 100644 --- a/src/IO.Swagger.Test/AASHelperTest.cs +++ b/src/IO.Swagger.Test/AASHelperTest.cs @@ -18,7 +18,7 @@ public void Setup() } [Test] - public void Test1() + public void TestFindByPath() { var sm = new Submodel(); var l1 = new SubmodelElementCollection { idShort = "level1" }; @@ -29,8 +29,28 @@ public void Test1() l2.Add(l3); l1.Add(l2); sm.Add(l1); - var found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); + var found = _helper!.FindSubmodelElementByPath(sm, "level1", out _); + Assert.AreEqual(found.idShort, "level1"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); Assert.AreEqual(found.idShort, "level2"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2.level3", out _); + Assert.AreEqual(found.idShort, "level3"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2.level3.level4", out _); + Assert.AreEqual(found.idShort, "level4"); + } + + + [Test] + public void TestOutputModifier() + { + var sm = new Submodel(); + var l1 = new SubmodelElementCollection { idShort = "level1" }; + var blob = new Blob { idShort = "blob", value = "ABCD" }; + l1.Add(blob); + sm.Add(l1); + + var jsonString = _helper!.HandleOutputModifiers(blob, "deep", "normal", "withoutBlobValue"); + Assert.IsFalse(jsonString.ToString().Contains("value")); } } } \ No newline at end of file From 26c9cd50e19b92ed8661484da1a27d5845140f82 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 10 Feb 2022 09:11:35 +0100 Subject: [PATCH 13/53] BugFix: Corrected "WithoutBlobValue" modifier --- src/IO.Swagger/Helpers/OutputModifierContractResolver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index 389905057..47a59e8be 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -158,10 +158,10 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ { if (property.PropertyName == propName) { + excluded = true; property.ShouldSerialize = instance => { - excluded = true; return false; }; } @@ -169,7 +169,7 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ } //Encode the value - if (!excluded && property.DeclaringType == typeof(Blob)) + if (!excluded && (property.DeclaringType == typeof(Blob)) && property.PropertyName.Equals("value")) { property.ShouldSerialize = instance => From 7c7ef090e14bb58211169851ba118f64334d6f67 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 14 Feb 2022 13:54:52 +0100 Subject: [PATCH 14/53] Validation against applicable output modifiers, PUT vs POST --- src/AasxServerStandardBib/AdminShell.cs | 82 +++- .../AssetAdministrationShellRepositoryApi.cs | 193 ++++++--- .../JsonSerializerExtension.cs | 2 +- src/IO.Swagger/Extensions/StringExtension.cs | 26 ++ src/IO.Swagger/Helpers/AASHelper.cs | 397 ++++++++++++------ 5 files changed, 495 insertions(+), 205 deletions(-) rename src/IO.Swagger/{Helpers => Extensions}/JsonSerializerExtension.cs (95%) create mode 100644 src/IO.Swagger/Extensions/StringExtension.cs diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 23f9d174c..9e970597c 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -18,6 +18,7 @@ This source code may use other Open Source software components (see LICENSE.txt) using System.Text; using System.Xml; using System.Xml.Serialization; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; namespace AdminShellNS @@ -6757,6 +6758,30 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("Blob", "Blob"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + }; + + output.Add(idShort, valueDict); + return output; + } + + public object ToWithBlobOnlyValue() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + { "value", Base64UrlEncoder.Encode(value) } + }; + + output.Add(idShort, valueDict); + return output; + } } public class File : DataElement @@ -7009,7 +7034,7 @@ public override AasElementSelfDescription GetSelfDescription() public override object ToValueOnlySerialization() { - var output = new Dictionary>>(); + var output = new Dictionary(); var listFirst = new List>(); foreach (var key in first.Keys) @@ -7166,7 +7191,7 @@ public override AasElementSelfDescription GetSelfDescription() public override object ToValueOnlySerialization() { - var output = new Dictionary>>(); + var output = new Dictionary(); var listFirst = new List>(); foreach (var key in first.Keys) @@ -7190,10 +7215,17 @@ public override object ToValueOnlySerialization() listSecond.Add(valueDict); } + List valueOnlyAnnotations = new List(); + + foreach (var sme in annotations) + { + valueOnlyAnnotations.Add(sme.submodelElement.ToValueOnlySerialization()); + } + dynamic relObj = new ExpandoObject(); relObj.first = listFirst; relObj.second = listSecond; - relObj.annotation = annotations; + relObj.annotation = valueOnlyAnnotations; output.Add(idShort, relObj); return output; } @@ -7754,6 +7786,27 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("Entity", "Ent"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary(); + List valueOnlyStatements = new List(); + + foreach (var sme in statements) + { + valueOnlyStatements.Add(sme.submodelElement.ToValueOnlySerialization()); + } + + var valueDict = new Dictionary + { + { "statements", valueOnlyStatements }, + { "entityType", entityType}, + { "assetId", assetRef.First.value }, + }; + + output.Add(idShort, valueDict); + return output; + } } public class BasicEvent : SubmodelElement @@ -7798,8 +7851,31 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("BasicEvent", "Evt"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary(); + var list = new List>(); + foreach (var key in observed.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + list.Add(valueDict); + } + + var observedDict = new Dictionary>>(); + observedDict.Add("observed", list); + output.Add(idShort, observedDict); + + return output; + } } + + // // Handling of packages // diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 4c0c7396d..b0609e50d 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -59,7 +59,7 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ return NoContent(); } - return NotFound($"AAS not "); + return NotFound($"AAS not Found"); } catch (Exception ex) { @@ -80,10 +80,16 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] { try { - bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out int packageIndex); + if (conceptDescription == null) + { + return NotFound($"Concept Description not found."); + } + + bool deleted = aasHelper.DeleteConceptDescription(conceptDescription, packageIndex); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1);//same tree return NoContent(); } @@ -114,14 +120,14 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); @@ -133,7 +139,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //Same tree, structure changed return NoContent(); } @@ -160,10 +166,10 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); @@ -175,7 +181,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); // Same tree, structure may change return NoContent(); } @@ -204,7 +210,7 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (deleted) { - + AasxServer.Program.signalNewData(1);//same tree structute may change return NoContent(); } @@ -245,7 +251,7 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] foreach (string submodelId in submodelIds) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId), out _); if (submodel != null) { payload.Add(submodel); @@ -423,7 +429,7 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ { try { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel != null) { List submodelElements = new List(); @@ -571,7 +577,7 @@ public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Require return new ObjectResult(aasReturn.AAS); } - return NotFound($"Please check aasIdentifier again."); + return NotFound($"Asset Administration Shell not found."); } catch (Exception ex) { @@ -635,7 +641,7 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str return new ObjectResult(conceptDescription); } - return NotFound($"Could not delete the concept description. Please check the identifier again."); + return NotFound($"Concept Description not found."); } catch (Exception ex) { @@ -724,7 +730,7 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req } //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found."); @@ -772,7 +778,7 @@ public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentif var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + return NotFound($"Either AAS or Submodel not found"); } var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); @@ -861,7 +867,7 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found"); @@ -904,10 +910,10 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] strin { try { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"The Submodel {submodelIdentifier} not found"); + return NotFound($"The Submodel not found"); } var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); @@ -1016,7 +1022,7 @@ public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationReq try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found."); @@ -1089,11 +1095,11 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV return Conflict($"Asset Administration Shell already exists."); } - bool added = aasHelper.AddAas(body); + bool added = aasHelper.PostAAS(body); if (added) { AasxServer.Program.signalNewData(2); - return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + return Created($"Asset Administration Shell created successfully.", body); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1130,10 +1136,10 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con var conceptDescription = aasHelper.FindConceptDescription(body.identification.id, out _); if (conceptDescription != null) { - return Conflict($"Concept Description {body.idShort} already exists."); + return Conflict($"Concept Description already exists."); } - bool added = aasHelper.AddConceptDescription(body); + bool added = aasHelper.PostConceptDescription(body); if (added) { AasxServer.Program.signalNewData(1); @@ -1170,16 +1176,16 @@ public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body } //Check if already exists - var submodel = aasHelper.FindSubmodel(body.identification.id); + var submodel = aasHelper.FindSubmodel(body.identification.id, out _); if (submodel != null) { - return Conflict($"Submodel {body.idShort} already exists."); + return Conflict($"Submodel already exists."); } - bool added = aasHelper.AddSubmodel(body); + bool added = aasHelper.PostSubmodel(body); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, structure may change return Created($"Submodel created successfully.", body); } @@ -1238,11 +1244,12 @@ public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.Submod return Conflict($"Submodel element {body.idShort} already exists in submodel"); } - bool added = aasHelper.AddSubmodelElement(submodel, body); + bool added = aasHelper.PostSubmodelElement(submodel, body); if (added) { object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + AasxServer.Program.signalNewData(1); //Same tree, structure changed + return Created($"Submodel Element created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1278,21 +1285,21 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } //IdShortPath is a path to the parent element var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); if (parentSME == null) { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel element {idShortPath} not found in submodel."); } if (string.IsNullOrEmpty(body.idShort)) @@ -1306,14 +1313,14 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); if (existingSME != null) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + return Conflict($"SubmodelElement already exists in {idShortPath}."); } } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PostSubmodelElementByPath(parentSME, body); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, structure may change object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel element created successfully", output); } @@ -1349,7 +1356,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found"); @@ -1359,7 +1366,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); if (parentSME == null) { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel element {idShortPath} not found in submodel."); } if (string.IsNullOrEmpty(body.idShort)) @@ -1373,11 +1380,11 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); if (existingSME != null) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + return Conflict($"SubmodelElement already exists in {idShortPath}."); } } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PostSubmodelElementByPath(parentSME, body); if (added) { AasxServer.Program.signalNewData(2); @@ -1414,10 +1421,10 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } //Check for idShort in SubmodelElement @@ -1430,10 +1437,10 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); if (submodelElement != null) { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + return Conflict($"Submodel element {body.idShort} already exists in submodel"); } - bool added = aasHelper.AddSubmodelElement(submodel, body); + bool added = aasHelper.PostSubmodelElement(submodel, body); if (added) { AasxServer.Program.signalNewData(2); @@ -1526,10 +1533,16 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV2 return BadRequest($"No Identification found in AAS."); } - bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + + bool added = aasHelper.PutAAS(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); // same tree, structure may change object output = aasHelper.HandleOutputModifiers(body, content: content); return Created($"AAS updated successfully.", output); } @@ -1557,15 +1570,21 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShe { try { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in AAS."); } - bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + bool added = aasHelper.PutAAS(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(1); + AasxServer.Program.signalNewData(1); //Same tree, structure/values may change (e.g., submodelRefs may be added or deleted, hence 1) return NoContent(); } @@ -1607,7 +1626,7 @@ public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset bool added = aasHelper.AddAsset(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //Same tree, strcture may change return NoContent(); } @@ -1634,15 +1653,21 @@ public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20. { try { + var existingCD = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out int packageIndex); + if (existingCD == null) + { + return NotFound($"Concept Description not found."); + } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in Concept Description."); } - bool added = aasHelper.AddConceptDescription(body, Base64UrlEncoder.Decode(cdIdentifier)); + bool added = aasHelper.PutConceptDescription(body, existingCD, packageIndex); if (added) { - AasxServer.Program.signalNewData(1); + AasxServer.Program.signalNewData(0); //Same tree, same structure, only values modified return NoContent(); } @@ -1684,7 +1709,14 @@ public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, return NotFound($"AAS not found."); } - bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + //Check if submodel exists + var existingSubmodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out int packageIndex); + if (existingSubmodel == null) + { + return NotFound($"Submodel not found."); + } + + bool added = aasHelper.PutSubmodel(body, existingSubmodel, packageIndex); if (added) { //Check if AAS has the submodelRef, if not create one. @@ -1730,14 +1762,14 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } if (string.IsNullOrEmpty(body.idShort)) @@ -1750,17 +1782,23 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S return BadRequest($"Please check the idShortPath again."); } //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel Element not found."); } + //TODO: Remove + //string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + //var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + //if (parentSME == null) + //{ + // return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + //} - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PutSubmodelElementByPath(parent, body, existingSME); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //TODO: change 0, however, value doesn't reflect automatically with 0. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel updated successfully.", output); } @@ -1794,28 +1832,36 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] Adm try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"IdShort is not set in the submodel element."); } + //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel Element not found."); } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + //TODO: Remove + //string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + //var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + //if (parentSME == null) + //{ + // return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + //} + + bool added = aasHelper.PutSubmodelElementByPath(parent, body, existingSME); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //TODO:0, however, values change is reflected automaticcally with 0. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel element updated successfully.", output); } @@ -1852,10 +1898,17 @@ public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Su return BadRequest($"No Identification found in Submodel."); } - bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + //Check if submodel exists + var existingSubmodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out int packageIndex); + if (existingSubmodel == null) + { + return NotFound($"Submodel not found."); + } + + bool added = aasHelper.PutSubmodel(body, existingSubmodel, packageIndex); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, but strcture may change, e.g. new SMEs may get added. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel updated successfully.", output); } diff --git a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs b/src/IO.Swagger/Extensions/JsonSerializerExtension.cs similarity index 95% rename from src/IO.Swagger/Helpers/JsonSerializerExtension.cs rename to src/IO.Swagger/Extensions/JsonSerializerExtension.cs index e20fd9fb7..4fe9f3897 100644 --- a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs +++ b/src/IO.Swagger/Extensions/JsonSerializerExtension.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Newtonsoft.Json; -namespace IO.Swagger.Helpers +namespace IO.Swagger.Extensions { public static class JsonSerializerExtension { diff --git a/src/IO.Swagger/Extensions/StringExtension.cs b/src/IO.Swagger/Extensions/StringExtension.cs new file mode 100644 index 000000000..167360b5f --- /dev/null +++ b/src/IO.Swagger/Extensions/StringExtension.cs @@ -0,0 +1,26 @@ +namespace IO.Swagger.Extensions +{ + /// + /// Provides Extension Methods over String Class + /// + public static class StringExtension + { + /// + /// Single string value can be compared with multiple values + /// + /// + /// + /// + public static bool CompareMultiple(this string data, params string[] compareValues) + { + foreach (string s in compareValues) + { + if (data.Equals(s, System.StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + return false; + } + } +} diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 257a92f1f..3b0d074de 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -6,6 +6,7 @@ using System.Text.RegularExpressions; using System.Threading; using AdminShellNS; +using IO.Swagger.Extensions; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; @@ -101,18 +102,21 @@ public FindAasReturn FindAas(string aasIdentifier) return findAasReturn; } - //TODO: delete the cd Ref from corresponding AAS - internal bool DeleteConceptDescription(string cdIdentifier) + /// + /// Deletes a concept description + /// + /// Concept Description Object + /// Package Index of the CD from the server + /// + internal bool DeleteConceptDescription(ConceptDescription conceptDescription, int packageIndex) { - bool deleted = false; - var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); if (conceptDescription != null) { Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); - deleted = true; + return true; } - return deleted; + return false; } @@ -137,7 +141,7 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int } } - packageIndex = 0; + packageIndex = -1; return null; } @@ -219,7 +223,7 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); - AasxServer.Program.signalNewData(1); + return true; } } @@ -242,15 +246,32 @@ internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string su return null; } - internal Submodel FindSubmodel(string submodelIdentifier) + /// + /// Finds the submodel from the server + /// + /// submodelIdentifier + /// The Package index of the found submodel from the server + /// + internal Submodel FindSubmodel(string submodelIdentifier, out int packageIndex) { + packageIndex = -1; if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) return null; - foreach (var submodel in Packages[0].AasEnv.Submodels) + for (int envi = 0; envi < Packages.Length; envi++) { - if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) - return submodel; + var env = Packages[envi]; + if (env != null) + { + foreach (var submodel in env.AasEnv.Submodels) + { + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + { + packageIndex = envi; + return submodel; + } + } + } } // no @@ -258,39 +279,22 @@ internal Submodel FindSubmodel(string submodelIdentifier) } /// - /// If AAS exists, it is updated. If not, added. - /// Similar to HTTP PUT + /// Creates a new Asset Administration Shell /// - /// - /// - /// - internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) + /// Requested AAS to be added in the server + /// If AAS was successfully added + internal bool PostAAS(AdministrationShell aas) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) + if (Packages[envi] == null) { - aasIdentifier ??= aas.identification.id; - var existingAas = FindAas(aasIdentifier); - if (existingAas.AAS != null) - { - Packages[envi].AasEnv.AdministrationShells.Remove(existingAas.AAS); - Packages[envi].AasEnv.AdministrationShells.Add(aas); - AasxServer.Program.signalNewData(1); - return true; - } - } - else - { - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -298,40 +302,46 @@ internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { Packages[emptyPackageIndex] = new AdminShellPackageEnv(); Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); - AasxServer.Program.signalNewData(1); return true; } return false; } - internal bool AddConceptDescription(ConceptDescription conceptDescription, string cdIdentifier = null) + /// + /// Updates the Asset Administration Shell + /// + /// Requested AAS to be updated in the server + /// Existing AAS from the server + /// If AAS was successfully modified + internal bool PutAAS(AdministrationShell aas, FindAasReturn aasReturn) + { + if (aasReturn.AAS != null) + { + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Remove(aasReturn.AAS); + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Add(aas); + return true; + } + return false; + } + + /// + /// Creates a new Concept Description + /// + /// Concept Description object + /// If the concept description was successfully added + internal bool PostConceptDescription(ConceptDescription conceptDescription) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; - cdIdentifier ??= conceptDescription.identification.id; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) - { - var existingCD = FindConceptDescription(cdIdentifier, out int packageIndex); - if (existingCD != null) - { - Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(existingCD); - Packages[packageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); - return true; - } - } - else + if (Packages[envi] == null) { - //TODO: This logic is not in the old server. - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -341,7 +351,25 @@ internal bool AddConceptDescription(ConceptDescription conceptDescription, strin Packages[emptyPackageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); return true; } + return false; + } + /// + /// Updates an existing Concept Description + /// + /// Concept Description object + /// Existing Concept Description object from the server + /// Package Index of the existingCD + /// + internal bool PutConceptDescription(ConceptDescription conceptDescription, ConceptDescription existingCD, int packageIndex) + { + if (packageIndex != -1) + { + int indexExistingCd = Packages[packageIndex].AasEnv.ConceptDescriptions.IndexOf(existingCD); + Packages[packageIndex].AasEnv.ConceptDescriptions.RemoveAt(indexExistingCd); + Packages[packageIndex].AasEnv.ConceptDescriptions.Insert(indexExistingCd, conceptDescription); + return true; + } return false; } @@ -505,6 +533,9 @@ internal bool CompareIsCaseOf(List isCaseOf1, List isCaseO internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") { + //Validate requested modifiers against applicable modifiers as per specifications + ValidateOutputModifiers(obj, level, content, extent); + //TODO: Better way to use default values when null if (string.IsNullOrEmpty(level)) { @@ -548,7 +579,7 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string { //settings.Converters.Add(new ValueOnlyJsonConverter(true, obj)); //var jsonTest = JsonConvert.SerializeObject(obj, settings); - object output = GetValueOnly(obj, level); + object output = GetValueOnly(obj, level, extent); var jsonOutput = JsonConvert.SerializeObject(output, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); return jsonOutput; } @@ -560,35 +591,109 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string return json; } - private object GetValueOnly(object obj, string level) + /// + /// Validates the output modifiers as per specifications, (Refer Details of Asset Administration Shell Part 2, Section 9.3) + /// + /// + /// + /// + /// + private void ValidateOutputModifiers(object obj, string level, string content, string extent) + { + if (obj is AdministrationShell) + { + //No level or extent applicable, bzw., not even in the API + if ((content != null) && !content.CompareMultiple("normal", "reference", "trimmed")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + } + else if (obj is SubmodelElementCollection) + { + //Do nothing, everything is applicable. Added the clause, as SMEColl is also an SME, hence below conditions could have been applied + } + else if (obj is SubmodelElement) + { + //Level and extent are not applicable. + if (level != null) + { + throw new Exception($"Invalid Output Modifier {level}"); + } + + //Conditions on Content + if (obj is Capability || obj is Operation) + { + if ((content != null) && !content.CompareMultiple("normal", "reference")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + } + + if ((content != null) && !content.CompareMultiple("normal", "reference", "value", "trimmed")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + + //Conditions on Extent + if (extent != null) + { + if (obj is Blob) + { + if (!extent.CompareMultiple("withoutBlobValue", "withBlobValue")) + { + throw new Exception($"Invalid Output Modifier {extent}"); + } + } + else + { + throw new Exception($"Invalid Output Modifier {extent}"); + } + } + } + } + + private object GetValueOnly(object obj, string level, string extent) { try { if (obj is Submodel submodel) { + //Submodel is serialized as an unnamed JSON object List values = new List(); foreach (var smElement in submodel.submodelElements) { - object value = GetValueOnly(smElement.submodelElement, level); + object value = GetValueOnly(smElement.submodelElement, level, extent); values.Add(value); } return values; } else if (obj is SubmodelElementCollection collection) { - if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + //SMECollection is serialized as named JSON Object + Dictionary> output = new Dictionary>(); + List values = new List(); + foreach (var smElement in collection.value) { - List values = new List(); - foreach (var smElement in collection.value) + //When core, should only include direct child elements. SMEs of child collection cannot be considered as direct child + if ((smElement.submodelElement is SubmodelElementCollection) && level.Equals("core", StringComparison.OrdinalIgnoreCase)) { - object value = GetValueOnly(smElement.submodelElement, level); - values.Add(value); + continue; } - return values; + object value = GetValueOnly(smElement.submodelElement, level, extent); + values.Add(value); } + output.Add(collection.idShort, values); + return output; } else if (obj is SubmodelElement submodelElement) { + if (obj is Blob blob) + { + if (extent.Equals("withBlobValue", StringComparison.OrdinalIgnoreCase)) + { + return blob.ToWithBlobOnlyValue(); + } + } return submodelElement.ToValueOnlySerialization(); } else if (obj is List smEleList) @@ -596,7 +701,7 @@ private object GetValueOnly(object obj, string level) List values = new List(); foreach (var smElement in smEleList) { - object value = GetValueOnly(smElement, level); + object value = GetValueOnly(smElement, level, extent); values.Add(value); } return values; @@ -689,33 +794,23 @@ private object GetObjectReference(object obj) } } - internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) + /// + /// Creates a new Submodel + /// + /// Submodel object + /// + internal bool PostSubmodel(Submodel submodel) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; - submodelIdentifier ??= submodel.identification.id; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) - { - var existingSubmodel = FindSubmodel(submodelIdentifier); - if (existingSubmodel != null) - { - Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); - Packages[envi].AasEnv.Submodels.Add(submodel); - return true; - } - } - else + if (Packages[envi] == null) { - //TODO: This logic is not in the old server. - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -729,6 +824,24 @@ internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) return false; } + /// + /// Updates the Submodel + /// + /// Submodel object + /// Existing Submodel object from the server + /// The package index of the existing Submodel object + /// + internal bool PutSubmodel(Submodel submodel, Submodel existingSubmodel, int packageIndex) + { + if (packageIndex != -1) + { + Packages[packageIndex].AasEnv.Submodels.Remove(existingSubmodel); + Packages[packageIndex].AasEnv.Submodels.Add(submodel); + return true; + } + return false; + } + internal Submodel FindSubmodelWithReference(Reference submodelRef) { //There should be exactly one key @@ -750,25 +863,21 @@ internal Submodel FindSubmodelWithReference(Reference submodelRef) return null; } - internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElement) + /// + /// Creates a new submodel element + /// + /// Parent Submodel + /// New Submodel Element to be added + /// + internal bool PostSubmodelElement(Submodel submodel, SubmodelElement submodelElement) { - var existingSmEle = submodel.FindSubmodelElementWrapper(submodelElement.idShort); - //Check if submodel element already exists in the submodel - if (existingSmEle != null) - { - int indexOfExistingSmw = submodel.submodelElements.IndexOf(existingSmEle); - submodel.submodelElements.RemoveAt(indexOfExistingSmw); - submodel.Insert(indexOfExistingSmw, submodelElement); - submodel.SetAllParents(DateTime.UtcNow); - return true; - } - else + if (submodel != null) { submodel.Add(submodelElement); submodel.SetAllParents(DateTime.UtcNow); return true; } - + return false; } /// @@ -778,7 +887,6 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// e.g. SMEColl_idShort.SME_idShort /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(object parent, string idShortPath, out object outParent) { outParent = parent; @@ -787,18 +895,18 @@ internal SubmodelElement FindSubmodelElementByPath(object parent, string idShort string[] idShorts = idShortPath.Split('.', 2); if (parent is Submodel submodel) { - var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]).submodelElement; + var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]); if (submodelElement != null) { - return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); } } else if (parent is SubmodelElementCollection collection) { - var submodelElement = collection.FindFirstIdShort(idShorts[0]).submodelElement; + var submodelElement = collection.FindFirstIdShort(idShorts[0]); if (submodelElement != null) { - return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); } } } @@ -806,18 +914,18 @@ internal SubmodelElement FindSubmodelElementByPath(object parent, string idShort { if (parent is Submodel submodel) { - var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath).submodelElement; + var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath); if (submodelElement != null) { - return submodelElement; + return submodelElement.submodelElement; } } else if (parent is SubmodelElementCollection collection) { - var submodelElement = collection.FindFirstIdShort(idShortPath).submodelElement; + var submodelElement = collection.FindFirstIdShort(idShortPath); if (submodelElement != null) { - return submodelElement; + return submodelElement.submodelElement; } } } @@ -944,35 +1052,62 @@ private void DoSimulation(object state) } } + /// - /// Adds the submodel element to the SMECollection + /// Creates a new submodel element at a specified path within submodel elements hierarchy /// - /// - /// - /// - internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) + /// Parent Submodel Element + /// Requested Submodel Element to be added + /// Returns true, if successfully added + internal bool PostSubmodelElementByPath(SubmodelElement parentSME, SubmodelElement submodelElement) { - if (parentSME is SubmodelElementCollection parentSMEColl) { - var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); - //Check if submodel element already exists in the collection - if (existingSmEle != null) + parentSMEColl.Add(submodelElement); + return true; + } + return false; + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Parent SME or Submodel + /// Submodel Element to be updated + /// Existing submodel element from the server, that needs to be updated + /// + internal bool PutSubmodelElementByPath(object parent, SubmodelElement submodelElement, SubmodelElement existingSME) + { + if (parent is SubmodelElementCollection parentSMEColl) + { + int indexOfExistingSME = -1; + for (int i = 0; i < parentSMEColl.value.Count; i++) { - int indexOfExistingSmw = parentSMEColl.value.IndexOf(existingSmEle); - parentSMEColl.value.RemoveAt(indexOfExistingSmw); - parentSMEColl.Insert(indexOfExistingSmw, submodelElement); + if (existingSME.Equals(parentSMEColl.value[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } } - else + parentSMEColl.value.RemoveAt(indexOfExistingSME); + parentSMEColl.Insert(indexOfExistingSME, submodelElement); + return true; + } + else if (parent is Submodel submodel) + { + int indexOfExistingSME = -1; + for (int i = 0; i < submodel.submodelElements.Count; i++) { - parentSMEColl.Add(submodelElement); - + if (existingSME.Equals(submodel.submodelElements[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } } - - submodelElement.SetAllTimeStamps(DateTime.UtcNow); + submodel.submodelElements.RemoveAt(indexOfExistingSME); + submodel.Insert(indexOfExistingSME, submodelElement); return true; } - return false; } From 87161df1e9494ffe7d8db81e96a33e557fe530e3 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 21 Feb 2022 13:19:31 +0100 Subject: [PATCH 15/53] Support for GetSerialization API --- .../AssetAdministrationShellRepositoryApi.cs | 33 ++- src/IO.Swagger/Helpers/AASHelper.cs | 193 ++++++++++++++++++ 2 files changed, 209 insertions(+), 17 deletions(-) diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index b0609e50d..d1cead5d8 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -238,27 +238,26 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] { try { - //TODO: One of the open questions - List payload = new List(); - foreach (string aasId in aasIds) - { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); - if (aasReturn != null) - { - payload.Add(aasReturn.AAS); - } - } + AdminShellV20.AdministrationShellEnv outputEnv = new AdminShellV20.AdministrationShellEnv(); + + //Fetch AASs for the requested aasIds + var aaslist = aasHelper.FindAllAasByAASIds(aasIds); + outputEnv.AdministrationShells = aaslist; - foreach (string submodelId in submodelIds) + //Fetch Submodels for the requested submodelIds + var submodellist = aasHelper.FindAllSubmodelsBySubmodelIds(submodelIds); + outputEnv.Submodels = submodellist; + + //Fetch Concept Descriptions used in AAS/Submodels + if ((bool)includeConceptDescriptions) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId), out _); - if (submodel != null) - { - payload.Add(submodel); - } + var conceptDescriptionList = aasHelper.FindConceptDescriptionInAASs(aasIds); + aasHelper.FindAllConceptDescriptionsInSubmodels(submodelIds, conceptDescriptionList); + outputEnv.ConceptDescriptions.AddRange(conceptDescriptionList); } - return new ObjectResult(payload); + return new ObjectResult(outputEnv); + } catch (Exception ex) { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 3b0d074de..6ae26d170 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -7,6 +7,7 @@ using System.Threading; using AdminShellNS; using IO.Swagger.Extensions; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; @@ -308,6 +309,192 @@ internal bool PostAAS(AdministrationShell aas) return false; } + internal List FindAllAasByAASIds(List aasIds) + { + var aasList = new List(); + foreach (string aasId in aasIds) + { + string aasIdDecoded = Base64UrlEncoder.Decode(aasId); + var aasReturn = FindAas(aasIdDecoded); + if (aasReturn != null) + { + aasList.Add(aasReturn.AAS); + } + } + return aasList; + } + + internal void FindAllConceptDescriptionsInSubmodels(List submodelIds, List conceptDescriptionList) + { + foreach (string submodelId in submodelIds) + { + string submodelIdDecoded = Base64UrlEncoder.Decode(submodelId); + var submodel = FindSubmodel(submodelIdDecoded, out _); + FindAllConceptDescriptionsInSubmodel(submodel, conceptDescriptionList); + } + } + + internal List FindConceptDescriptionInAASs(List aasIds) + { + var conceptDescriptionList = new List(); + foreach (var aasId in aasIds) + { + string aasIdDecoded = Base64UrlEncoder.Decode(aasId); + var aasReturn = FindAas(aasIdDecoded); + if (aasReturn != null) + { + //Find direct concept descriptions + foreach (ConceptDictionary conceptDictionary in aasReturn.AAS.conceptDictionaries) + { + var cds = FindConceptDescriptionByReference(conceptDictionary.conceptDescriptionsRefs); + conceptDescriptionList.AddRange(cds); + } + + //Find concept descriptions from the submodels of the AAS + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = FindSubmodelWithReference(submodelRef); + if (submodel != null) + { + var conceptDescriptions = new List(); + FindAllConceptDescriptionsInSubmodel(submodel, conceptDescriptions); + conceptDescriptionList.AddRange(conceptDescriptions); + } + } + } + } + return conceptDescriptionList; + } + + /// + /// All the concept descriptions from the submodel, including submodel elements. The method is recursive. + /// + /// Submodel or Submodel Element + /// A list of found concept descriptions + public void FindAllConceptDescriptionsInSubmodel(object obj, List conceptDescriptions) + { + //Concept description of the submodel + if (obj is Submodel submodel) + { + if (submodel.semanticId != null) + { + var cd = FindConceptDescriptionByReference(submodel.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in submodel.submodelElements) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is SubmodelElementCollection collection) + { + if (collection.semanticId != null) + { + var cd = FindConceptDescriptionByReference(collection.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in collection.value) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is Entity entity) + { + if (entity.semanticId != null) + { + var cd = FindConceptDescriptionByReference(entity.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in entity.statements) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is SubmodelElement submodelElement) + { + var cd = FindConceptDescriptionByReference(submodelElement.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + } + + } + + private List FindConceptDescriptionByReference(ConceptDescriptionRefs conceptDescriptionsRefs) + { + var conceptDescriptions = new List(); + if (conceptDescriptionsRefs != null && conceptDescriptionsRefs.conceptDescriptions != null) + { + foreach (var cdr in conceptDescriptionsRefs.conceptDescriptions) + { + var cd = FindConceptDescriptionByReference(cdr); + if (cd != null) + { + conceptDescriptions.Add(cd); + } + } + } + + return conceptDescriptions; + } + + private ConceptDescription FindConceptDescriptionByReference(Reference cdr) + { + if (cdr == null) + return null; + + var keys = cdr.Keys; + + if (keys == null) + return null; + + // can only refs with 1 key + if (keys.Count != 1) + return null; + + var key = keys[0]; + if (!key.local || key.type.ToLower().Trim() != "conceptdescription") + return null; + + var conceptDescription = FindConceptDescription(key.value, out _); + if (conceptDescription != null) + return conceptDescription; + + return null; + } + + internal List FindAllSubmodelsBySubmodelIds(List submodelIds) + { + var submodelList = new List(); + foreach (string submodelId in submodelIds) + { + string submodelIdDecoded = Base64UrlEncoder.Decode(submodelId); + var submodel = FindSubmodel(submodelIdDecoded, out _); + if (submodel != null) + { + submodelList.Add(submodel); + } + } + + return submodelList; + } + /// /// Updates the Asset Administration Shell /// @@ -1134,7 +1321,13 @@ internal bool AddAsset(Asset body, FindAasReturn aasReturn) /// public class FindAasReturn { + /// + /// Asset Administration Shell + /// public AdminShell.AdministrationShell AAS { get; set; } = null; + /// + /// The package index of the AAS + /// public int IPackage { get; set; } = -1; } From 2b46b5b41b4f5b61941adf6d74ccbac0614d04ef Mon Sep 17 00:00:00 2001 From: aorzelskiGH <48956800+aorzelskiGH@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:22:33 +0100 Subject: [PATCH 16/53] License of spec changed Platform Industrie 4.0 changed license to Creative Commons CC BY 4.0 --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 9b98c5c00..5b19e6209 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -7,7 +7,7 @@ The AASX Server is licensed under the Apache License 2.0 (Apache-2.0, see below) The AASX Server is a sample application for demonstration of the features of the Asset Administration Shell. The implementation uses the concepts of the document "Details of the Asset Administration Shell" -published on www.plattform-i40.de which is licensed under Creative Commons CC BY-ND 3.0 DE. +published on www.plattform-i40.de which is licensed under Creative Commons CC BY 4.0. -------------------------------------------------------------------------------------------------------------- From f9bc48bb4e5960c917a74fa2cefa88a7c34e8945 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 13 Jan 2022 09:43:43 +0100 Subject: [PATCH 17/53] Initial Commit for REST API ASP.NET --- src/AasxServer.sln | 16 +++++++++++++++- .../Properties/launchSettings.json | 2 +- src/AasxServerStandardBib/AasxRestServer.cs | 2 +- src/AasxServerStandardBib/AdminShell.cs | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/AasxServer.sln b/src/AasxServer.sln index af858d897..891b05f48 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29306.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerCore", "AasxServerCore\AasxServerCore.csproj", "{7C0704A8-85C7-4FC9-B12D-C7B9E63EF7B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AasxServerWindows", "AasxServerWindows\AasxServerWindows.csproj", "{2315B8C5-B648-4730-8C2E-1346E4C4BADD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerWindows", "AasxServerWindows\AasxServerWindows.csproj", "{2315B8C5-B648-4730-8C2E-1346E4C4BADD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerStandardBib", "AasxServerStandardBib\AasxServerStandardBib.csproj", "{6D8FAFA1-0BA5-4E52-87D2-E4E37FC6D95F}" EndProject @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxServerBlazor\AasxServerBlazor.csproj", "{53165247-64F7-4151-A1DA-347780E0A538}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "..\..\aspnetcore-server-generated\src\IO.Swagger\IO.Swagger.csproj", "{51CE9584-07E9-4340-A7C0-29BD4E48653D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,6 +77,18 @@ Global {53165247-64F7-4151-A1DA-347780E0A538}.Release|x64.Build.0 = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.ActiveCfg = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.ActiveCfg = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.Build.0 = Debug|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.Build.0 = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.ActiveCfg = Release|Any CPU + {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index 3086014ce..f76e1b5c1 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -18,7 +18,7 @@ }, "AasxServerBlazor": { "commandName": "Project", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\PCF\" --edit", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/src/AasxServerStandardBib/AasxRestServer.cs b/src/AasxServerStandardBib/AasxRestServer.cs index 7f81424ca..e1337bfe6 100644 --- a/src/AasxServerStandardBib/AasxRestServer.cs +++ b/src/AasxServerStandardBib/AasxRestServer.cs @@ -1041,7 +1041,7 @@ public IHttpContext GetAuthserver(IHttpContext context) } // Basic AAS + Asset - + //TODO:Imp [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))(|/core|/complete|/thumbnail|/aasenv)(/|)$")] public IHttpContext GetAasAndAsset(IHttpContext context) diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index ef8215665..844ccb5be 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -4916,6 +4916,7 @@ public override string ToString() // ReSharper enable RedundantArgumentDefaultValue } + [JsonConverter(typeof(AdminShellConverters.JsonAasxConverter))] public class SubmodelElement : Referable, System.IDisposable, IGetReference, IGetSemanticId { // constants From b7979e5561ef3a17850379c0785ad50431e2357d Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 13 Jan 2022 10:07:36 +0100 Subject: [PATCH 18/53] Add Generated Swagger Code for Asp.Net core Rest APIs --- src/AasxServer.sln | 26 +- src/IO.Swagger/.gitignore | 208 + .../Attributes/ValidateModelStateAttribute.cs | 61 + .../AssetAdministrationShellRepositoryApi.cs | 1481 ++++++++ src/IO.Swagger/Dockerfile | 19 + src/IO.Swagger/Filters/BasePathFilter.cs | 51 + .../GeneratePathParamsValidationFilter.cs | 96 + src/IO.Swagger/Helpers/AASHelper.cs | 729 ++++ .../Helpers/IdentifierKeyValuePair_V2.cs | 127 + .../Helpers/OutputModifierContractResolver.cs | 65 + src/IO.Swagger/IO.Swagger.csproj | 24 + src/IO.Swagger/Models/AccessControl.cs | 222 ++ .../Models/AccessControlPolicyPoints.cs | 178 + src/IO.Swagger/Models/AccessPermissionRule.cs | 151 + .../Models/AdministrativeInformation.cs | 135 + .../Models/AnnotatedRelationshipElement.cs | 120 + .../Models/AssetAdministrationShell.cs | 196 + .../AssetAdministrationShellEnvironment.cs | 150 + src/IO.Swagger/Models/AssetInformation.cs | 105 + src/IO.Swagger/Models/AssetKind.cs | 39 + src/IO.Swagger/Models/BasicEvent.cs | 121 + src/IO.Swagger/Models/Blob.cs | 136 + src/IO.Swagger/Models/BlobCertificate.cs | 151 + src/IO.Swagger/Models/Capability.cs | 105 + src/IO.Swagger/Models/Certificate.cs | 105 + src/IO.Swagger/Models/ConceptDescription.cs | 135 + src/IO.Swagger/Models/Constraint.cs | 123 + src/IO.Swagger/Models/DataElement.cs | 105 + .../Models/DataSpecificationContent.cs | 105 + .../DataSpecificationIEC61360Content.cs | 271 ++ .../DataSpecificationPhysicalUnitContent.cs | 303 ++ .../Models/EmbeddedDataSpecification.cs | 141 + src/IO.Swagger/Models/Entity.cs | 166 + src/IO.Swagger/Models/EntityType.cs | 39 + src/IO.Swagger/Models/Extension.cs | 166 + src/IO.Swagger/Models/File.cs | 136 + src/IO.Swagger/Models/Formula.cs | 105 + src/IO.Swagger/Models/GlobalReference.cs | 121 + src/IO.Swagger/Models/HasDataSpecification.cs | 120 + src/IO.Swagger/Models/HasExtensions.cs | 120 + src/IO.Swagger/Models/HasSemantics.cs | 122 + src/IO.Swagger/Models/Identifiable.cs | 136 + .../Models/IdentifierKeyValuePair.cs | 153 + src/IO.Swagger/Models/Key.cs | 139 + src/IO.Swagger/Models/KeyElements.cs | 144 + src/IO.Swagger/Models/LangString.cs | 137 + src/IO.Swagger/Models/LevelType.cs | 49 + src/IO.Swagger/Models/Message.cs | 197 + src/IO.Swagger/Models/ModelEvent.cs | 105 + src/IO.Swagger/Models/ModelReference.cs | 138 + src/IO.Swagger/Models/ModelType.cs | 123 + src/IO.Swagger/Models/ModelTypes.cs | 164 + src/IO.Swagger/Models/ModelingKind.cs | 39 + .../Models/MultiLanguageProperty.cs | 135 + src/IO.Swagger/Models/ObjectAttributes.cs | 120 + src/IO.Swagger/Models/OneOfCertificate.cs | 105 + src/IO.Swagger/Models/OneOfConstraint.cs | 105 + src/IO.Swagger/Models/OneOfDataElement.cs | 105 + .../Models/OneOfDataSpecificationContent.cs | 105 + .../Models/OneOfOperationVariableValue.cs | 105 + src/IO.Swagger/Models/OneOfReference.cs | 105 + src/IO.Swagger/Models/OneOfSubmodelElement.cs | 105 + src/IO.Swagger/Models/Operation.cs | 150 + src/IO.Swagger/Models/OperationRequest.cs | 165 + src/IO.Swagger/Models/OperationResult.cs | 219 ++ src/IO.Swagger/Models/OperationVariable.cs | 121 + src/IO.Swagger/Models/Permission.cs | 166 + src/IO.Swagger/Models/PermissionsPerObject.cs | 154 + .../Models/PolicyAdministrationPoint.cs | 138 + src/IO.Swagger/Models/PolicyDecisionPoint.cs | 121 + .../Models/PolicyEnforcementPoint.cs | 121 + .../Models/PolicyInformationPoints.cs | 136 + src/IO.Swagger/Models/Property.cs | 154 + src/IO.Swagger/Models/Qualifiable.cs | 120 + src/IO.Swagger/Models/Qualifier.cs | 170 + src/IO.Swagger/Models/Range.cs | 151 + src/IO.Swagger/Models/Referable.cs | 182 + src/IO.Swagger/Models/Reference.cs | 105 + src/IO.Swagger/Models/ReferenceElement.cs | 120 + src/IO.Swagger/Models/RelationshipElement.cs | 137 + src/IO.Swagger/Models/Result.cs | 135 + src/IO.Swagger/Models/Security.cs | 153 + src/IO.Swagger/Models/SubjectAttributes.cs | 120 + src/IO.Swagger/Models/Submodel.cs | 182 + src/IO.Swagger/Models/SubmodelElement.cs | 167 + src/IO.Swagger/Models/SubmodelElementList.cs | 165 + .../Models/SubmodelElementStruct.cs | 122 + src/IO.Swagger/Models/ValueList.cs | 121 + src/IO.Swagger/Models/ValueObject.cs | 154 + .../Models/ValueReferencePairType.cs | 105 + src/IO.Swagger/Models/ValueTypeEnum.cs | 249 ++ src/IO.Swagger/Models/View.cs | 152 + src/IO.Swagger/Program.cs | 34 + src/IO.Swagger/Properties/launchSettings.json | 37 + src/IO.Swagger/Startup.cs | 141 + src/IO.Swagger/appsettings.json | 10 + src/IO.Swagger/web.config | 12 + src/IO.Swagger/wwwroot/README.md | 42 + src/IO.Swagger/wwwroot/index.html | 1 + src/IO.Swagger/wwwroot/swagger-original.json | 3341 +++++++++++++++++ src/IO.Swagger/wwwroot/web.config | 9 + 101 files changed, 17662 insertions(+), 13 deletions(-) create mode 100644 src/IO.Swagger/.gitignore create mode 100644 src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs create mode 100644 src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs create mode 100644 src/IO.Swagger/Dockerfile create mode 100644 src/IO.Swagger/Filters/BasePathFilter.cs create mode 100644 src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs create mode 100644 src/IO.Swagger/Helpers/AASHelper.cs create mode 100644 src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs create mode 100644 src/IO.Swagger/Helpers/OutputModifierContractResolver.cs create mode 100644 src/IO.Swagger/IO.Swagger.csproj create mode 100644 src/IO.Swagger/Models/AccessControl.cs create mode 100644 src/IO.Swagger/Models/AccessControlPolicyPoints.cs create mode 100644 src/IO.Swagger/Models/AccessPermissionRule.cs create mode 100644 src/IO.Swagger/Models/AdministrativeInformation.cs create mode 100644 src/IO.Swagger/Models/AnnotatedRelationshipElement.cs create mode 100644 src/IO.Swagger/Models/AssetAdministrationShell.cs create mode 100644 src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs create mode 100644 src/IO.Swagger/Models/AssetInformation.cs create mode 100644 src/IO.Swagger/Models/AssetKind.cs create mode 100644 src/IO.Swagger/Models/BasicEvent.cs create mode 100644 src/IO.Swagger/Models/Blob.cs create mode 100644 src/IO.Swagger/Models/BlobCertificate.cs create mode 100644 src/IO.Swagger/Models/Capability.cs create mode 100644 src/IO.Swagger/Models/Certificate.cs create mode 100644 src/IO.Swagger/Models/ConceptDescription.cs create mode 100644 src/IO.Swagger/Models/Constraint.cs create mode 100644 src/IO.Swagger/Models/DataElement.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationContent.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs create mode 100644 src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs create mode 100644 src/IO.Swagger/Models/EmbeddedDataSpecification.cs create mode 100644 src/IO.Swagger/Models/Entity.cs create mode 100644 src/IO.Swagger/Models/EntityType.cs create mode 100644 src/IO.Swagger/Models/Extension.cs create mode 100644 src/IO.Swagger/Models/File.cs create mode 100644 src/IO.Swagger/Models/Formula.cs create mode 100644 src/IO.Swagger/Models/GlobalReference.cs create mode 100644 src/IO.Swagger/Models/HasDataSpecification.cs create mode 100644 src/IO.Swagger/Models/HasExtensions.cs create mode 100644 src/IO.Swagger/Models/HasSemantics.cs create mode 100644 src/IO.Swagger/Models/Identifiable.cs create mode 100644 src/IO.Swagger/Models/IdentifierKeyValuePair.cs create mode 100644 src/IO.Swagger/Models/Key.cs create mode 100644 src/IO.Swagger/Models/KeyElements.cs create mode 100644 src/IO.Swagger/Models/LangString.cs create mode 100644 src/IO.Swagger/Models/LevelType.cs create mode 100644 src/IO.Swagger/Models/Message.cs create mode 100644 src/IO.Swagger/Models/ModelEvent.cs create mode 100644 src/IO.Swagger/Models/ModelReference.cs create mode 100644 src/IO.Swagger/Models/ModelType.cs create mode 100644 src/IO.Swagger/Models/ModelTypes.cs create mode 100644 src/IO.Swagger/Models/ModelingKind.cs create mode 100644 src/IO.Swagger/Models/MultiLanguageProperty.cs create mode 100644 src/IO.Swagger/Models/ObjectAttributes.cs create mode 100644 src/IO.Swagger/Models/OneOfCertificate.cs create mode 100644 src/IO.Swagger/Models/OneOfConstraint.cs create mode 100644 src/IO.Swagger/Models/OneOfDataElement.cs create mode 100644 src/IO.Swagger/Models/OneOfDataSpecificationContent.cs create mode 100644 src/IO.Swagger/Models/OneOfOperationVariableValue.cs create mode 100644 src/IO.Swagger/Models/OneOfReference.cs create mode 100644 src/IO.Swagger/Models/OneOfSubmodelElement.cs create mode 100644 src/IO.Swagger/Models/Operation.cs create mode 100644 src/IO.Swagger/Models/OperationRequest.cs create mode 100644 src/IO.Swagger/Models/OperationResult.cs create mode 100644 src/IO.Swagger/Models/OperationVariable.cs create mode 100644 src/IO.Swagger/Models/Permission.cs create mode 100644 src/IO.Swagger/Models/PermissionsPerObject.cs create mode 100644 src/IO.Swagger/Models/PolicyAdministrationPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyDecisionPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyEnforcementPoint.cs create mode 100644 src/IO.Swagger/Models/PolicyInformationPoints.cs create mode 100644 src/IO.Swagger/Models/Property.cs create mode 100644 src/IO.Swagger/Models/Qualifiable.cs create mode 100644 src/IO.Swagger/Models/Qualifier.cs create mode 100644 src/IO.Swagger/Models/Range.cs create mode 100644 src/IO.Swagger/Models/Referable.cs create mode 100644 src/IO.Swagger/Models/Reference.cs create mode 100644 src/IO.Swagger/Models/ReferenceElement.cs create mode 100644 src/IO.Swagger/Models/RelationshipElement.cs create mode 100644 src/IO.Swagger/Models/Result.cs create mode 100644 src/IO.Swagger/Models/Security.cs create mode 100644 src/IO.Swagger/Models/SubjectAttributes.cs create mode 100644 src/IO.Swagger/Models/Submodel.cs create mode 100644 src/IO.Swagger/Models/SubmodelElement.cs create mode 100644 src/IO.Swagger/Models/SubmodelElementList.cs create mode 100644 src/IO.Swagger/Models/SubmodelElementStruct.cs create mode 100644 src/IO.Swagger/Models/ValueList.cs create mode 100644 src/IO.Swagger/Models/ValueObject.cs create mode 100644 src/IO.Swagger/Models/ValueReferencePairType.cs create mode 100644 src/IO.Swagger/Models/ValueTypeEnum.cs create mode 100644 src/IO.Swagger/Models/View.cs create mode 100644 src/IO.Swagger/Program.cs create mode 100644 src/IO.Swagger/Properties/launchSettings.json create mode 100644 src/IO.Swagger/Startup.cs create mode 100644 src/IO.Swagger/appsettings.json create mode 100644 src/IO.Swagger/web.config create mode 100644 src/IO.Swagger/wwwroot/README.md create mode 100644 src/IO.Swagger/wwwroot/index.html create mode 100644 src/IO.Swagger/wwwroot/swagger-original.json create mode 100644 src/IO.Swagger/wwwroot/web.config diff --git a/src/AasxServer.sln b/src/AasxServer.sln index 891b05f48..ec3f4c8a7 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -17,7 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxServerBlazor\AasxServerBlazor.csproj", "{53165247-64F7-4151-A1DA-347780E0A538}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "..\..\aspnetcore-server-generated\src\IO.Swagger\IO.Swagger.csproj", "{51CE9584-07E9-4340-A7C0-29BD4E48653D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "IO.Swagger\IO.Swagger.csproj", "{478697A0-89E4-4039-902E-0F13EA4EAD72}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -77,18 +77,18 @@ Global {53165247-64F7-4151-A1DA-347780E0A538}.Release|x64.Build.0 = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.ActiveCfg = Release|Any CPU {53165247-64F7-4151-A1DA-347780E0A538}.Release|x86.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x64.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.ActiveCfg = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Debug|x86.Build.0 = Debug|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|Any CPU.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x64.Build.0 = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.ActiveCfg = Release|Any CPU - {51CE9584-07E9-4340-A7C0-29BD4E48653D}.Release|x86.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x64.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x64.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x86.ActiveCfg = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Debug|x86.Build.0 = Debug|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|Any CPU.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.Build.0 = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.ActiveCfg = Release|Any CPU + {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/IO.Swagger/.gitignore b/src/IO.Swagger/.gitignore new file mode 100644 index 000000000..cd9b840e5 --- /dev/null +++ b/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 000000000..07cfabe83 --- /dev/null +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace IO.Swagger.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs new file mode 100644 index 000000000..1d3cd1796 --- /dev/null +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -0,0 +1,1481 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; + +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; +using IO.Swagger.Helpers; +using AdminShellNS; +using Microsoft.IdentityModel.Tokens; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class AssetAdministrationShellRepositoryApiController : ControllerBase + { + private static AASHelper aasHelper; + /// + /// Constructor + /// + public AssetAdministrationShellRepositoryApiController() + { + aasHelper = new AASHelper(); + } + + /// + /// Deletes an Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Administration Shell deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteAssetAdministrationShellById")] + public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + { + var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the AAS"); + } + + /// + /// Deletes a Concept Description + /// + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Concept Description deleted successfully + [HttpDelete] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteConceptDescriptionById")] + public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]string cdIdentifier) + { + bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the concept description {cdIdentifier}"); + } + + /// + /// Deletes a submodel element at a specified path within the submodel elements hierarchy + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Submodel element deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelElementByPath")] + public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out AdminShellV20.SubmodelElement parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + + /// + /// Deletes a submodel element at a specified path within the submodel elements hierarchy + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Submodel element deleted successfully + [HttpDelete] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] + public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + { + submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, Base64UrlEncoder.Decode(idShortPath), out AdminShellV20.SubmodelElement parent); + if (submodelElement != null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if(deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + + /// + /// Deletes the submodel reference from the Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Submodel reference deleted successfully + [HttpDelete] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}")] + [ValidateModelState] + [SwaggerOperation("DeleteSubmodelReferenceById")] + public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier) + { + aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); + submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + + bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"Could not delete the submodel reference {submodelIdentifier} from AAS {aasIdentifier}"); + } + + /// + /// Returns an appropriate serialization based on the specified format (see SerializationFormat) + /// + /// The Asset Administration Shells' unique ids (BASE64-URL-encoded) + /// The Submodels' unique ids (BASE64-URL-encoded) + /// Include Concept Descriptions? + /// Requested serialization based on SerializationFormat + [HttpGet] + [Route("/serialization")] + [ValidateModelState] + [SwaggerOperation("GenerateSerializationByIds")] + [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] + public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]List aasIds, [FromQuery][Required()]List submodelIds, [FromQuery][Required()]bool? includeConceptDescriptions) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(byte[])); + string exampleJson = null; + exampleJson = "\"\""; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(byte[]); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns all Asset Administration Shells + /// + /// The key-value-pair of an Asset identifier + /// The Asset Administration Shell’s IdShort + /// Requested Asset Administration Shells + [HttpGet] + [Route("/shells")] + [ValidateModelState] + [SwaggerOperation("GetAllAssetAdministrationShells")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Asset Administration Shells")] + //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) + public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string assetIds, [FromQuery]string idShort) + { + //TODO: Consider a case where both assetIds and idShort are present. + var aasList = new List(); + if (string.IsNullOrEmpty(assetIds) && string.IsNullOrEmpty(idShort)) + { + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + aasList.Add(env.AasEnv.AdministrationShells[0]); + } + } + + return new ObjectResult(aasList); + } + + if (!string.IsNullOrEmpty(assetIds)) + { + assetIds = Base64UrlEncoder.Decode(assetIds); + var assetIdList = JsonConvert.DeserializeObject>(assetIds); + return new ObjectResult(aasHelper.FindAllAasByAssetIds(assetIdList)); + } + + if (!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllAasByIdShort(idShort)); + } + + + return new ObjectResult(aasList); + } + + /// + /// Returns all Concept Descriptions + /// + /// The Concept Description’s IdShort + /// IsCaseOf reference (BASE64-URL-encoded) + /// DataSpecification reference (BASE64-URL-encoded) + /// Requested Concept Descriptions + [HttpGet] + [Route("/concept-descriptions")] + [ValidateModelState] + [SwaggerOperation("GetAllConceptDescriptions")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] + public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort, [FromQuery]string isCaseOf, [FromQuery]string dataSpecificationRef) + { + //Return all the concept-descriptions from the server, NO Filter + if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef) ) + { + var cdList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + cdList.AddRange(env.AasEnv.ConceptDescriptions); + } + } + + return new ObjectResult(cdList); + } + + //CDs filtered with idShort + if(!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); + } + + //CDs filtered with isCaseOfReference + if(!string.IsNullOrEmpty(isCaseOf)) + { + var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); + } + + //CDs filtered with isCaseOfReference + if (!string.IsNullOrEmpty(dataSpecificationRef)) + { + var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); + return new ObjectResult(aasHelper.FindAllConceptDescriptionsByDataSpecRef(dataSpecRefReq)); + } + + + //TODO:Re-do + return NoContent(); + + } + + /// + /// Returns all submodel elements including their hierarchy + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// List of found submodel elements + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelElements")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] + public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + + // access AAS and Submodel + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + + if(submodel == null) + { + return NotFound($"Submodel not found."); + } + + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + + if(string.IsNullOrEmpty(level) && string.IsNullOrEmpty(content) && string.IsNullOrEmpty(extent)) + { + return new ObjectResult(submodelElements); + } + + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + + return new ObjectResult(json); + } + + /// + /// Returns all submodel elements including their hierarchy + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// List of found submodel elements + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelElementsSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] + public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel != null) + { + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + return new ObjectResult(submodelElements); + } + else + { + return NotFound($"Submodel not found."); + } + } + + /// + /// Returns all submodel references + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested submodel references + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodelReferences")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] + public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]string aasIdentifier) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS.submodelRefs); + } + else + { + return NotFound($"AAS not found."); + } + + } + + /// + /// Returns all Submodels + /// + /// The value of the semantic id reference (BASE64-URL-encoded) + /// The Submodel’s idShort + /// Requested Submodels + [HttpGet] + [Route("/submodels")] + [ValidateModelState] + [SwaggerOperation("GetAllSubmodels")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] + public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [FromQuery]string idShort) + { + //Fetch all the submodels from the server + if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + { + var submodelList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + submodelList.AddRange(env.AasEnv.Submodels); + } + } + + return new ObjectResult(submodelList); + } + + if(!string.IsNullOrEmpty(idShort)) + { + return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); + } + + if (!string.IsNullOrEmpty(semanticId)) + { + var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); + return new ObjectResult(aasHelper.FindAllSubmodelsBySemanticId(reqSemaniticId)); + } + + //TODO: Re-Do + return NoContent(); + } + + /// + /// Returns the Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Determines the request or response kind of the resource + /// Requested Asset Administration Shell + [HttpGet] + [Route("/shells/{aasIdentifier}/aas")] + [ValidateModelState] + [SwaggerOperation("GetAssetAdministrationShell")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] + public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]string aasIdentifier, [FromQuery]string content) + { + //TODO: Content ?? + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } + + return NotFound(); + } + + /// + /// Returns a specific Asset Administration Shell + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested Asset Administration Shell + [HttpGet] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("GetAssetAdministrationShellById")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] + public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } + + return NotFound(); + } + + /// + /// Returns the Asset Information + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Requested Asset Information + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/asset-information")] + [ValidateModelState] + [SwaggerOperation("GetAssetInformation")] + [SwaggerResponse(statusCode: 200, type: typeof(AssetInformation), description: "Requested Asset Information")] + public virtual IActionResult GetAssetInformation([FromRoute][Required]string aasIdentifier) + { + //TODO:Change to AssetInformation in V3 + //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS != null) + { + var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); + if(asset != null) + { + return new ObjectResult(asset); + } + } + + return NotFound(); + + } + + /// + /// Returns a specific Concept Description + /// + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Requested Concept Description + [HttpGet] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("GetConceptDescriptionById")] + [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] + public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]string cdIdentifier) + { + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); + if(conceptDescription != null) + { + return new ObjectResult(conceptDescription); + } + + return NotFound($"Concept Description {cdIdentifier} not found"); + } + + /// + /// Returns the Operation result of an asynchronous invoked Operation + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded) + /// + /// Operation result object + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}")] + [ValidateModelState] + [SwaggerOperation("GetOperationAsyncResult")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns the Operation result of an asynchronous invoked Operation + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded) + /// + /// Operation result object + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}")] + [ValidateModelState] + [SwaggerOperation("GetOperationAsyncResultSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Returns the Submodel + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested Submodel + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("GetSubmodel")] + [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] + public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider other parameters súch as level, content, & extent + + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel != null) + { + return new ObjectResult(submodel); + } + + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + } + + /// + /// Returns a specific submodel element from the Submodel at a specified path + /// + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested submodel element + [HttpGet] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelElementByPath")] + [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] + public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if(submodelElement != null) + { + return new ObjectResult(submodelElement); + } + + return NotFound($"Requested submodel element not found."); + } + + /// + /// Returns a specific submodel element from the Submodel at a specified path + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested submodel element + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelElementByPathSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] + public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: support for Content, extent and level + + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } + + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement != null) + { + return new ObjectResult(submodelElement); + } + + return NotFound($"Requested submodel element not found."); + } + + /// + /// Returns the Submodel + /// + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Requested Submodel + [HttpGet] + [Route("/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("GetSubmodelSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] + public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider rest of the parameters i.e., level, content & extent + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel != null) + { + return new ObjectResult(submodel); + } + + return NotFound($"Submodel not found."); + } + + /// + /// Synchronously or asynchronously invokes an Operation at a specified path + /// + /// Operation request object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// Determines whether an operation invocation is performed asynchronously or synchronously + /// Determines the request or response kind of the resource + /// Operation result object + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke")] + [ValidateModelState] + [SwaggerOperation("InvokeOperation")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + { + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if(submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var output = aasHelper.InvokeOperation(submodelElement); + + return NoContent(); + } + + /// + /// Synchronously or asynchronously invokes an Operation at a specified path + /// + /// Operation request object + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated), in this case an operation + /// Determines whether an operation invocation is performed asynchronously or synchronously + /// Determines the request or response kind of the resource + /// Operation result object + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke")] + [ValidateModelState] + [SwaggerOperation("InvokeOperationSubmodelRepo")] + [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] + public virtual IActionResult InvokeOperationSubmodelRepo([FromBody]OperationRequest body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(OperationResult)); + string exampleJson = null; + exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Creates a new Asset Administration Shell + /// + /// Asset Administration Shell object + /// Asset Administration Shell created successfully + [HttpPost] + [Route("/shells")] + [ValidateModelState] + [SwaggerOperation("PostAssetAdministrationShell")] + [SwaggerResponse(statusCode: 201, type: typeof(AssetAdministrationShell), description: "Asset Administration Shell created successfully")] + //public virtual IActionResult PostAssetAdministrationShell([FromBody]AssetAdministrationShell body) + public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + //Check if already exists + var aasReturn = aasHelper.FindAas(body.idShort); + if(aasReturn.AAS != null) + { + return Conflict($"Asset Administration Shell {body.idShort} already exists."); + } + + bool added = aasHelper.AddAas(body); + if(added) + { + AasxServer.Program.signalNewData(2); + return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + + /// + /// Creates a new Concept Description + /// + /// Concept Description object + /// Concept Description created successfully + [HttpPost] + [Route("/concept-descriptions")] + [ValidateModelState] + [SwaggerOperation("PostConceptDescription")] + [SwaggerResponse(statusCode: 201, type: typeof(ConceptDescription), description: "Concept Description created successfully")] + //public virtual IActionResult PostConceptDescription([FromBody]ConceptDescription body) + public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.ConceptDescription body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } + + //Check if already exists + var conceptDescription = aasHelper.FindConceptDescription(body.idShort, out _); + if (conceptDescription != null) + { + return Conflict($"Concept Description {body.idShort} already exists."); + } + + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Concept Description {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new Submodel + /// + /// Submodel object + /// Submodel created successfully + [HttpPost] + [Route("/submodels")] + [ValidateModelState] + [SwaggerOperation("PostSubmodel")] + [SwaggerResponse(statusCode: 201, type: typeof(Submodel), description: "Submodel created successfully")] + //public virtual IActionResult PostSubmodel([FromBody]Submodel body) + public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + //Check if already exists + var submodel = aasHelper.FindSubmodel(body.idShort); + if (submodel != null) + { + return Conflict($"Submodel {body.idShort} already exists."); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new submodel element + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElement")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider rest of the parameters, i.e., level, content & extent + + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if(submodel == null) + { + return NotFound($"Submodel not found"); + } + + //Check for idShort in SubmodelElement + if(string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } + + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if(submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel Element {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a new submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementByPath")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } + + if(string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + //Check if requested submodel element already exists in the parent SME + if(parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + { + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if(existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if(added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Creates a new submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementByPathSubmodelRepo")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + { + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Creates a new submodel element + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element created successfully + [HttpPost] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelElementSubmodelRepo")] + [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] + //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } + + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel Element {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Creates a submodel reference at the Asset Administration Shell + /// + /// Reference to the Submodel + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Submodel reference created successfully + [HttpPost] + [Route("/shells/{aasIdentifier}/aas/submodels")] + [ValidateModelState] + [SwaggerOperation("PostSubmodelReference")] + [SwaggerResponse(statusCode: 201, type: typeof(Reference), description: "Submodel reference created successfully")] + //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Reference body, [FromRoute][Required]string aasIdentifier) + { + if (body.Count == 0) + { + return BadRequest($"No references present in the request payload."); + } + else if(body.Count != 1) + { + return BadRequest($"More than one references present in the request payload."); + } + + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found."); + } + + //Check if Submodel with this reference exists + var submodel = aasHelper.FindSubmodelWithReference(body); + if (submodel == null) + { + return BadRequest($"No Submodel with this reference present in the server"); + } + + //Check if reference already exists with the AAS + if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + { + return Conflict($"The Submodel Reference already exists in AAS {aasIdentifier}"); + } + + aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); + AasxServer.Program.signalNewData(1); + return Created($"Submodel reference created successfully.", body); + + } + + /// + /// Updates the Asset Administration Shell + /// + /// Asset Administration Shell object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Determines the request or response kind of the resource + /// Asset Administration Shell updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas")] + [ValidateModelState] + [SwaggerOperation("PutAssetAdministrationShell")] + //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + { + //TODO: content?? + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + if(!aasIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {aasIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates an existing Asset Administration Shell + /// + /// Asset Administration Shell object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Administration Shell updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}")] + [ValidateModelState] + [SwaggerOperation("PutAssetAdministrationShellById")] + //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + if (!aasIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {aasIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates the Asset Information + /// + /// Asset Information object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// Asset Information updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/asset-information")] + [ValidateModelState] + [SwaggerOperation("PutAssetInformation")] + public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) + { + //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(204); + + throw new NotImplementedException(); + } + + /// + /// Updates an existing Concept Description + /// + /// Concept Description object + /// The Concept Description’s unique id (BASE64-URL-encoded) + /// Concept Description updated successfully + [HttpPut] + [Route("/concept-descriptions/{cdIdentifier}")] + [ValidateModelState] + [SwaggerOperation("PutConceptDescriptionById")] + //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) + public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.ConceptDescription body, [FromRoute][Required]string cdIdentifier) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } + + if (!cdIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {cdIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates the Submodel + /// + /// Submodel object + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("PutSubmodel")] + //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //TODO: Consider other parameters i.e., level, content, extent + + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if(aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found."); + } + + if (!submodelIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {submodelIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + //Check if AAS has the submodelRef, if not create one. + var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); + if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + { + aasReturn.AAS.submodelRefs.Add(newsmRef); + } + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Asset Administration Shell’s unique id (BASE64-URL-encoded) + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element updated successfully + [HttpPut] + [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelElementByPath")] + //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Requested submodel element + /// The Submodel’s unique id (BASE64-URL-encoded) + /// IdShort path to the submodel element (dot-separated) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel element updated successfully + [HttpPut] + [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelElementByPathSubmodelRepo")] + //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } + + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + return Created($"Submodel element created successfully", body); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + + /// + /// Updates the Submodel + /// + /// Submodel object + /// The Submodel’s unique id (BASE64-URL-encoded) + /// Determines the structural depth of the respective resource content + /// Determines the request or response kind of the resource + /// Determines to which extent the resource is being serialized + /// Submodel updated successfully + [HttpPut] + [Route("/submodels/{submodelIdentifier}/submodel")] + [ValidateModelState] + [SwaggerOperation("PutSubmodelSubmodelRepo")] + //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + if (!submodelIdentifier.Equals(body.idShort)) + { + return BadRequest($"idShort {submodelIdentifier} and payload do not match"); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + } +} diff --git a/src/IO.Swagger/Dockerfile b/src/IO.Swagger/Dockerfile new file mode 100644 index 000000000..a22c4e17f --- /dev/null +++ b/src/IO.Swagger/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 +WORKDIR /app +COPY --from=build-env /app/out . + +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 000000000..c9d95d6d1 --- /dev/null +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,51 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 000000000..1845e56ac --- /dev/null +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,96 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; + } + } + } + } + } + } +} diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs new file mode 100644 index 000000000..fd2f5a87f --- /dev/null +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -0,0 +1,729 @@ +using AdminShellNS; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Helpers +{ + /// + /// A helper class to suffice all the AAS related queries. + /// + public class AASHelper + { + private static AdminShellPackageEnv[] Packages; + + /// + /// Constructor + /// + public AASHelper() + { + Packages = AasxServer.Program.env; + } + + internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) + { + FindAasReturn aasReturn = FindAas(aasIdentifier); + + if (aasReturn.AAS == null) + return null; + + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodel; + } + + // no + return null; + } + + /// + /// Return a specific AAS from the server + /// + /// The Asset Administration Shell’s unique id + /// + public FindAasReturn FindAas(string aasIdentifier) + { + FindAasReturn findAasReturn = new FindAasReturn(); + + if (Packages == null) + return null; + + if (Regex.IsMatch(aasIdentifier, @"^\d+$")) // only number, i.e. index + { + // Index + int i = Convert.ToInt32(aasIdentifier); + + if (i > Packages.Length) + return null; + + if (Packages[i] == null || Packages[i].AasEnv == null || Packages[i].AasEnv.AdministrationShells == null + || Packages[i].AasEnv.AdministrationShells.Count < 1) + return null; + + findAasReturn.AAS = Packages[i].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = i; + } + else + { + // Name + if (aasIdentifier == "id") + { + findAasReturn.AAS = Packages[0].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = 0; + } + else + { + for (int i = 0; i < Packages.Length; i++) + { + if (Packages[i] != null) + { + if (Packages[i].AasEnv.AdministrationShells[0].identification.id == aasIdentifier) + { + findAasReturn.AAS = Packages[i].AasEnv.AdministrationShells[0]; + findAasReturn.IPackage = i; + break; + } + } + } + } + } + + return findAasReturn; + } + + //TODO: delete the cd Ref from corresponding AAS + internal bool DeleteConceptDescription(string cdIdentifier) + { + bool deleted = false; + var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); + if(conceptDescription != null) + { + Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); + deleted = true; + } + + return deleted; + } + + + internal ConceptDescription FindConceptDescription(string cdIdentifier, out int packageIndex) + { + if (Packages != null) + { + for(int i=0; i< Packages.Length;i++) + { + var env = Packages[i]; + if (env != null) + { + foreach(var cd in env.AasEnv.ConceptDescriptions) + { + if (cd.identification.id != null && cd.identification.id.Trim().ToLower() == cdIdentifier.Trim().ToLower()) + { + packageIndex = i; + return cd; + } + } + } + } + } + + packageIndex = 0; + return null; + } + + //TODO: Check if asset needs to be deleted? an asset can be referenced in many shells. + internal bool DeleteAASAndAsset(string aasIdentifier) + { + bool success = false; + // find the AAS + var aasReturn = FindAas(aasIdentifier); + if(aasReturn.AAS != null) + { + // find the asset + var asset = FindAssetwithReference(aasReturn.AAS.assetRef); + //Deleting AAS from the server + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Remove(aasReturn.AAS); + success = true; + if (Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Count == 0) + { + Packages[aasReturn.IPackage] = null; + } + else + { + if (asset != null) + { + //TODO:Check if needs to be removed (BG: Asset can have multiple shells) + Packages[aasReturn.IPackage].AasEnv.Assets.Remove(asset); + } + } + } + + return success; + } + + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) + { + if(parent is SubmodelElementCollection parentColl) + { + parentColl.value.Remove(submodelElement); + return true; + } + + return false; + } + + internal Asset FindAssetwithReference(AssetRef assetRef) + { + if (Packages != null) + { + foreach (var env in Packages) + { + if (env != null) + { + Asset asset = env.AasEnv.FindAsset(assetRef); + if(asset != null) + { + return asset; + } + } + } + } + + return null; + } + + internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submodelIdentifier) + { + FindAasReturn aasReturn = FindAas(aasIdentifier); + + if (aasReturn.AAS!= null) + { + SubmodelRef submodelRef = FindSubmodelRefWithinAAS(aasReturn, submodelIdentifier); + if (submodelRef != null) + { + aasReturn.AAS.submodelRefs.Remove(submodelRef); + return true; + } + } + + return false; + } + + internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string submodelIdentifier) + { + if (aasReturn.AAS != null) + { + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodelRef; + } + } + + return null; + } + + internal Submodel FindSubmodel(string submodelIdentifier) + { + if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) + return null; + + //TODO: Check again + // via handle + //var specialHandles = CreateHandlesFromRawUrl(rawUrl); + //var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); + //if (handleId != null && handleId.identification != null) + // return Packages[0].AasEnv.FindSubmodel(handleId.identification); + + // no, iterate & find + foreach (var submodel in Packages[0].AasEnv.Submodels) + { + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + return submodel; + } + + // no + return null; + } + + /// + /// If AAS exists, it is updated. If not, added. + /// Similar to HTTP PUT + /// + /// + /// + internal bool AddAas(AdministrationShell aas) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingAas = Packages[envi].AasEnv.FindAAS(aas.identification); + if (existingAas != null) + { + Packages[envi].AasEnv.AdministrationShells.Remove(existingAas); + Packages[envi].AasEnv.AdministrationShells.Add(aas); + return true; + } + } + else + { + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); + return true; + } + + return false; + } + + internal bool AddConceptDescription(ConceptDescription conceptDescription) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingCD = Packages[envi].AasEnv.FindConceptDescription(conceptDescription.identification); + if (existingCD != null) + { + Packages[envi].AasEnv.ConceptDescriptions.Remove(existingCD); + Packages[envi].AasEnv.ConceptDescriptions.Add(conceptDescription); + return true; + } + } + else + { + //TODO: This logic is not in the old server. + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); + return true; + } + + return false; + } + + internal List FindAllAasByIdShort(string idShort) + { + List outputShells = new List(); + foreach (AdminShellPackageEnv env in Packages) + { + if (env != null) + { + foreach (AdministrationShell aas in env.AasEnv.AdministrationShells) + { + if (!string.IsNullOrEmpty(aas.idShort) && aas.idShort.Equals(idShort)) + { + outputShells.Add(aas); + } + } + } + } + + return outputShells; + } + + internal List FindAllAasByAssetIds(List assetIdList) + { + List outputShells = new List(); + + foreach(IdentifierKeyValuePair_V2 assetId in assetIdList) + { + outputShells.AddRange(FindAasByAssetId(assetId.Value)); + } + + return outputShells; + } + + private List FindAasByAssetId(string assetId) + { + List outputShells = new List(); + foreach (AdminShellPackageEnv env in Packages) + { + if (env != null) + { + foreach (AdministrationShell aas in env.AasEnv.AdministrationShells) + { + if (!aas.assetRef.IsEmpty && aas.assetRef.Keys[0].value.Equals(assetId)) + { + outputShells.Add(aas); + } + } + } + } + + return outputShells; + } + + internal List FindAllConceptDescriptionsByIdShort(string idShort) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach(ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if(conceptDescription.idShort.Equals(idShort)) + { + outputCds.Add(conceptDescription); + } + } + } + } + + return outputCds; + } + + internal object FindAllConceptDescriptionsByDataSpecRef(DataSpecificationRef dataSpecRefReq) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if (conceptDescription.embeddedDataSpecification != null ) + { + foreach(EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) + { + if(embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + { + outputCds.Add(conceptDescription); + } + } + + } + } + } + } + + return outputCds; + } + + internal List FindAllConceptDescriptionsByIsCaseOf(List isCaseOfObj) + { + List outputCds = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + { + if ((conceptDescription.IsCaseOf != null) && CompareIsCaseOf(conceptDescription.IsCaseOf, isCaseOfObj)) + { + outputCds.Add(conceptDescription); + } + } + } + } + + return outputCds; + } + + private bool CompareIsCaseOf(List isCaseOf1, List isCaseOf2) + { + foreach(Reference isCaseOf1_Ref in isCaseOf1) + { + bool found=false; + foreach(Reference isCaseOf2_Ref in isCaseOf2) + { + if(isCaseOf1_Ref.Matches(isCaseOf2_Ref)) + { + found = true; + break; + } + } + + if(!found) + { + return false; + } + } + + return true; + } + + internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") + { + //Handle Level + var json = ApplyLevelModifier(level, obj); + return json; + } + + private object ApplyLevelModifier(string level, object obj) + { + if(level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + var contractResolver = new OutputModifierContractResolver(true); + var settings = new JsonSerializerSettings(); + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; + } + return null; + } + + internal bool AddSubmodel(Submodel submodel) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] != null) + { + var existingSubmodel = Packages[envi].AasEnv.FindSubmodel(submodel.identification); + if (existingSubmodel != null) + { + Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); + Packages[envi].AasEnv.Submodels.Add(submodel); + return true; + } + } + else + { + //TODO: This logic is not in the old server. + if (!emptyPackageAvailable) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; //Added to avoid unnecessary iterations + } + + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.Submodels.Add(submodel); + return true; + } + + return false; + } + + internal Submodel FindSubmodelWithReference(Reference submodelRef) + { + //There should be exactly one key + if (submodelRef.Count != 1) + return null; + + foreach(var env in Packages) + { + if(env != null) + { + var submodel = env.AasEnv.FindSubmodel(new Identification(submodelRef.First.idType, submodelRef.First.value)); + if(submodel != null) + { + return submodel; + } + } + } + + return null; + } + + internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElement) + { + var existingSmEle = submodel.FindSubmodelElementWrapper(submodelElement.idShort); + //Check if submodel element already exists in the submodel + if (existingSmEle != null) + { + int indexOfExistingSmw = submodel.submodelElements.IndexOf(existingSmEle); + submodel.submodelElements.RemoveAt(indexOfExistingSmw); + submodel.Insert(indexOfExistingSmw, submodelElement); + submodel.SetAllParents(DateTime.UtcNow); + return true; + } + else + { + submodel.Add(submodelElement); + submodel.SetAllParents(DateTime.UtcNow); + return true; + } + + } + + /// + /// + /// + /// + /// e.g. SMEColl_idShort.SME_idShort + /// Parent of SME, bzw. SMEColl + /// + internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out SubmodelElement parent) + { + parent = null; + if (idShortPath.Contains('.')) + { + string[] idShorts = idShortPath.Split('.', 2); + foreach (var smeWrapper in submodel.submodelElements) + { + var submodelElement = smeWrapper.submodelElement; + if (submodelElement.idShort.Equals(idShorts[0])) + { + if (submodelElement is SubmodelElementCollection collection) + { + return FindSubmodelElementByPath(collection, idShorts[1], out parent); + } + } + } + } + else + { + var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); + if(smeWrapper != null) + return smeWrapper.submodelElement; + } + + return null; + } + + internal object FindAllSubmodelsBySemanticId(SemanticId reqSemaniticId) + { + var outputSubmodels = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (Submodel submodel in env.AasEnv.Submodels) + { + if ((submodel.semanticId != null) && submodel.semanticId.Matches(reqSemaniticId)) + { + outputSubmodels.Add(submodel); + } + } + } + } + + return outputSubmodels; + } + + internal List FindAllSubmodelsByIdShort(string idShort) + { + var outputSubmodels = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + foreach (Submodel submodel in env.AasEnv.Submodels) + { + if(submodel.idShort.Equals(idShort)) + { + outputSubmodels.Add(submodel); + } + } + } + } + + return outputSubmodels; + } + + internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection smeColl, string idShortPath, out SubmodelElement parent) + { + parent = null; + string[] idShorts = idShortPath.Split('.', 2); + foreach (var smeWrapper in smeColl.value) + { + var submodelElement = smeWrapper.submodelElement; + if (submodelElement.idShort.Equals(idShorts[0])) + { + if (submodelElement is SubmodelElementCollection collection) + { + parent = collection; + FindSubmodelElementByPath(collection, idShorts[1], out parent); + } + else if (submodelElement is SubmodelElement) + { + parent = smeColl; + return submodelElement; + } + } + } + + return null; + } + + internal object InvokeOperation(SubmodelElement submodelElement) + { + throw new NotImplementedException(); + } + + /// + /// Adds the submodel element to the SMECollection + /// + /// + /// + /// + internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) + { + + if (parentSME is SubmodelElementCollection parentSMEColl) + { + var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); + //Check if submodel element already exists in the collection + if (existingSmEle != null) + { + int indexOfExistingSmw = parentSMEColl.value.IndexOf(existingSmEle); + parentSMEColl.value.RemoveAt(indexOfExistingSmw); + parentSMEColl.Insert(indexOfExistingSmw, submodelElement); + } + else + { + parentSMEColl.Add(submodelElement); + + } + + submodelElement.SetAllTimeStamps(DateTime.UtcNow); + return true; + } + + return false; + } + } + + /// + /// The class consists of an AAS and a ENV package which it belongs to. + /// + public class FindAasReturn + { + public AdminShell.AdministrationShell AAS { get; set; } = null; + public int IPackage { get; set; } = -1; + } +} diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs new file mode 100644 index 000000000..a5f0b5c4c --- /dev/null +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -0,0 +1,127 @@ +using IO.Swagger.Models; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace IO.Swagger.Helpers +{ + /// + /// + /// + [DataContract] + public partial class IdentifierKeyValuePair_V2 + { + /// + /// Gets or Sets Key + /// + [Required] + + [DataMember(Name = "key")] + public string Key { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name = "value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IdentifierKeyValuePair {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IdentifierKeyValuePair_V2)obj); + } + + /// + /// Returns true if IdentifierKeyValuePair instances are equal + /// + /// Instance of IdentifierKeyValuePair to be compared + /// Boolean + public bool Equals(IdentifierKeyValuePair other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Key == other.Key || + Key != null && + Key.Equals(other.Key) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Key != null) + hashCode = hashCode * 59 + Key.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators +#pragma warning disable 1591 + + //public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + //{ + // return Equals(left, right); + //} + + //public static bool operator !=(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + //{ + // return !Equals(left, right); + //} + +#pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs new file mode 100644 index 000000000..f77fe899a --- /dev/null +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -0,0 +1,65 @@ +using AdminShellNS; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +namespace IO.Swagger.Helpers +{ + /// + /// This converter / contract resolver for Json.NET adaptively filters different levels of depth + /// of nested AASX structures. + /// + public class OutputModifierContractResolver : DefaultContractResolver + { + public bool AasHasViews = true; + public bool BlobHasValue = false; // only true, if extent modifier is withBLOBValue + public bool SubmodelHasElements = true; + public bool SmcHasValue = true; + public bool OpHasVariables = true; + + + public OutputModifierContractResolver(bool deep = true) + { + if (!deep) + { + this.SubmodelHasElements = false; + this.SmcHasValue = false; + this.OpHasVariables = false; + this.BlobHasValue = false; + this.AasHasViews = false; + } + } + + /// + /// + /// + /// + /// + /// + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + JsonProperty property = base.CreateProperty(member, memberSerialization); + + if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && property.PropertyName == "value") + property.ShouldSerialize = instance => { return false; }; + + if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && property.PropertyName == "submodelElements") + property.ShouldSerialize = instance => { return false; }; + + if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && property.PropertyName == "value") + property.ShouldSerialize = instance => { return false; }; + + if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && (property.PropertyName == "in" || property.PropertyName == "out")) + property.ShouldSerialize = instance => { return false; }; + + if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && property.PropertyName == "views") + property.ShouldSerialize = instance => { return false; }; + + return property; + } + } +} diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 000000000..4aa64e512 --- /dev/null +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,24 @@ + + + IO.Swagger + IO.Swagger + netcoreapp3.1 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + + + + + + diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs new file mode 100644 index 000000000..1e06c68d5 --- /dev/null +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -0,0 +1,222 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessControl : IEquatable + { + /// + /// Gets or Sets AccessPermissionRule + /// + + [DataMember(Name="accessPermissionRule")] + public List AccessPermissionRule { get; set; } + + /// + /// Gets or Sets DefaultEnvironmentAttributes + /// + + [DataMember(Name="defaultEnvironmentAttributes")] + //TODO:Uncomment + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultEnvironmentAttributes { get; set; } + public Reference DefaultEnvironmentAttributes { get; set; } + + /// + /// Gets or Sets DefaultPermissions + /// + + [DataMember(Name="defaultPermissions")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultPermissions { get; set; } + public Reference DefaultPermissions { get; set; } + + /// + /// Gets or Sets DefaultSubjectAttributes + /// + + [DataMember(Name="defaultSubjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultSubjectAttributes { get; set; } + public Reference DefaultSubjectAttributes { get; set; } + + /// + /// Gets or Sets SelectableEnvironmentAttributes + /// + + [DataMember(Name="selectableEnvironmentAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableEnvironmentAttributes { get; set; } + public Reference SelectableEnvironmentAttributes { get; set; } + + /// + /// Gets or Sets SelectablePermissions + /// + + [DataMember(Name="selectablePermissions")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectablePermissions { get; set; } + public Reference SelectablePermissions { get; set; } + + /// + /// Gets or Sets SelectableSubjectAttributes + /// + + [DataMember(Name="selectableSubjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableSubjectAttributes { get; set; } + public Reference SelectableSubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessControl {\n"); + sb.Append(" AccessPermissionRule: ").Append(AccessPermissionRule).Append("\n"); + sb.Append(" DefaultEnvironmentAttributes: ").Append(DefaultEnvironmentAttributes).Append("\n"); + sb.Append(" DefaultPermissions: ").Append(DefaultPermissions).Append("\n"); + sb.Append(" DefaultSubjectAttributes: ").Append(DefaultSubjectAttributes).Append("\n"); + sb.Append(" SelectableEnvironmentAttributes: ").Append(SelectableEnvironmentAttributes).Append("\n"); + sb.Append(" SelectablePermissions: ").Append(SelectablePermissions).Append("\n"); + sb.Append(" SelectableSubjectAttributes: ").Append(SelectableSubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessControl)obj); + } + + /// + /// Returns true if AccessControl instances are equal + /// + /// Instance of AccessControl to be compared + /// Boolean + public bool Equals(AccessControl other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AccessPermissionRule == other.AccessPermissionRule || + AccessPermissionRule != null && + AccessPermissionRule.SequenceEqual(other.AccessPermissionRule) + ) && + ( + DefaultEnvironmentAttributes == other.DefaultEnvironmentAttributes || + DefaultEnvironmentAttributes != null && + DefaultEnvironmentAttributes.Equals(other.DefaultEnvironmentAttributes) + ) && + ( + DefaultPermissions == other.DefaultPermissions || + DefaultPermissions != null && + DefaultPermissions.Equals(other.DefaultPermissions) + ) && + ( + DefaultSubjectAttributes == other.DefaultSubjectAttributes || + DefaultSubjectAttributes != null && + DefaultSubjectAttributes.Equals(other.DefaultSubjectAttributes) + ) && + ( + SelectableEnvironmentAttributes == other.SelectableEnvironmentAttributes || + SelectableEnvironmentAttributes != null && + SelectableEnvironmentAttributes.Equals(other.SelectableEnvironmentAttributes) + ) && + ( + SelectablePermissions == other.SelectablePermissions || + SelectablePermissions != null && + SelectablePermissions.Equals(other.SelectablePermissions) + ) && + ( + SelectableSubjectAttributes == other.SelectableSubjectAttributes || + SelectableSubjectAttributes != null && + SelectableSubjectAttributes.Equals(other.SelectableSubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AccessPermissionRule != null) + hashCode = hashCode * 59 + AccessPermissionRule.GetHashCode(); + if (DefaultEnvironmentAttributes != null) + hashCode = hashCode * 59 + DefaultEnvironmentAttributes.GetHashCode(); + if (DefaultPermissions != null) + hashCode = hashCode * 59 + DefaultPermissions.GetHashCode(); + if (DefaultSubjectAttributes != null) + hashCode = hashCode * 59 + DefaultSubjectAttributes.GetHashCode(); + if (SelectableEnvironmentAttributes != null) + hashCode = hashCode * 59 + SelectableEnvironmentAttributes.GetHashCode(); + if (SelectablePermissions != null) + hashCode = hashCode * 59 + SelectablePermissions.GetHashCode(); + if (SelectableSubjectAttributes != null) + hashCode = hashCode * 59 + SelectableSubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessControl left, AccessControl right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessControl left, AccessControl right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs new file mode 100644 index 000000000..292864002 --- /dev/null +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -0,0 +1,178 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessControlPolicyPoints : IEquatable + { + /// + /// Gets or Sets PolicyAdministrationPoint + /// + [Required] + + [DataMember(Name="policyAdministrationPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyAdministrationPoint PolicyAdministrationPoint { get; set; } + public PolicyAdministrationPoint PolicyAdministrationPoint { get; set; } + + /// + /// Gets or Sets PolicyDecisionPoint + /// + [Required] + + [DataMember(Name="policyDecisionPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyDecisionPoint PolicyDecisionPoint { get; set; } + public PolicyDecisionPoint PolicyDecisionPoint { get; set; } + + /// + /// Gets or Sets PolicyEnforcementPoint + /// + [Required] + + [DataMember(Name="policyEnforcementPoint")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyEnforcementPoint + //PolicyEnforcementPoint { get; set; } + //https://app.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyInformationPoints + public PolicyEnforcementPoint PolicyEnforcementPoint { get; set; } + + /// + /// Gets or Sets PolicyInformationPoints + /// + + [DataMember(Name="policyInformationPoints")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyInformationPoints PolicyInformationPoints { get; set; } + public PolicyInformationPoints PolicyInformationPoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessControlPolicyPoints {\n"); + sb.Append(" PolicyAdministrationPoint: ").Append(PolicyAdministrationPoint).Append("\n"); + sb.Append(" PolicyDecisionPoint: ").Append(PolicyDecisionPoint).Append("\n"); + sb.Append(" PolicyEnforcementPoint: ").Append(PolicyEnforcementPoint).Append("\n"); + sb.Append(" PolicyInformationPoints: ").Append(PolicyInformationPoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessControlPolicyPoints)obj); + } + + /// + /// Returns true if AccessControlPolicyPoints instances are equal + /// + /// Instance of AccessControlPolicyPoints to be compared + /// Boolean + public bool Equals(AccessControlPolicyPoints other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + PolicyAdministrationPoint == other.PolicyAdministrationPoint || + PolicyAdministrationPoint != null && + PolicyAdministrationPoint.Equals(other.PolicyAdministrationPoint) + ) && + ( + PolicyDecisionPoint == other.PolicyDecisionPoint || + PolicyDecisionPoint != null && + PolicyDecisionPoint.Equals(other.PolicyDecisionPoint) + ) && + ( + PolicyEnforcementPoint == other.PolicyEnforcementPoint || + PolicyEnforcementPoint != null && + PolicyEnforcementPoint.Equals(other.PolicyEnforcementPoint) + ) && + ( + PolicyInformationPoints == other.PolicyInformationPoints || + PolicyInformationPoints != null && + PolicyInformationPoints.Equals(other.PolicyInformationPoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (PolicyAdministrationPoint != null) + hashCode = hashCode * 59 + PolicyAdministrationPoint.GetHashCode(); + if (PolicyDecisionPoint != null) + hashCode = hashCode * 59 + PolicyDecisionPoint.GetHashCode(); + if (PolicyEnforcementPoint != null) + hashCode = hashCode * 59 + PolicyEnforcementPoint.GetHashCode(); + if (PolicyInformationPoints != null) + hashCode = hashCode * 59 + PolicyInformationPoints.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessControlPolicyPoints left, AccessControlPolicyPoints right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessControlPolicyPoints left, AccessControlPolicyPoints right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs new file mode 100644 index 000000000..95a9b18a6 --- /dev/null +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AccessPermissionRule : Referable, IEquatable + { + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets PermissionsPerObject + /// + + [DataMember(Name="permissionsPerObject")] + public List PermissionsPerObject { get; set; } + + /// + /// Gets or Sets TargetSubjectAttributes + /// + [Required] + + [DataMember(Name="targetSubjectAttributes")] + public List TargetSubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AccessPermissionRule {\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" PermissionsPerObject: ").Append(PermissionsPerObject).Append("\n"); + sb.Append(" TargetSubjectAttributes: ").Append(TargetSubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AccessPermissionRule)obj); + } + + /// + /// Returns true if AccessPermissionRule instances are equal + /// + /// Instance of AccessPermissionRule to be compared + /// Boolean + public bool Equals(AccessPermissionRule other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + PermissionsPerObject == other.PermissionsPerObject || + PermissionsPerObject != null && + PermissionsPerObject.SequenceEqual(other.PermissionsPerObject) + ) && + ( + TargetSubjectAttributes == other.TargetSubjectAttributes || + TargetSubjectAttributes != null && + TargetSubjectAttributes.SequenceEqual(other.TargetSubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (PermissionsPerObject != null) + hashCode = hashCode * 59 + PermissionsPerObject.GetHashCode(); + if (TargetSubjectAttributes != null) + hashCode = hashCode * 59 + TargetSubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AccessPermissionRule left, AccessPermissionRule right) + { + return Equals(left, right); + } + + public static bool operator !=(AccessPermissionRule left, AccessPermissionRule right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs new file mode 100644 index 000000000..c106e04bc --- /dev/null +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AdministrativeInformation : IEquatable + { + /// + /// Gets or Sets Revision + /// + + [DataMember(Name="revision")] + public string Revision { get; set; } + + /// + /// Gets or Sets Version + /// + + [DataMember(Name="version")] + public string Version { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdministrativeInformation {\n"); + sb.Append(" Revision: ").Append(Revision).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AdministrativeInformation)obj); + } + + /// + /// Returns true if AdministrativeInformation instances are equal + /// + /// Instance of AdministrativeInformation to be compared + /// Boolean + public bool Equals(AdministrativeInformation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Revision == other.Revision || + Revision != null && + Revision.Equals(other.Revision) + ) && + ( + Version == other.Version || + Version != null && + Version.Equals(other.Version) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Revision != null) + hashCode = hashCode * 59 + Revision.GetHashCode(); + if (Version != null) + hashCode = hashCode * 59 + Version.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AdministrativeInformation left, AdministrativeInformation right) + { + return Equals(left, right); + } + + public static bool operator !=(AdministrativeInformation left, AdministrativeInformation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs new file mode 100644 index 000000000..f3a9b5681 --- /dev/null +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AnnotatedRelationshipElement : RelationshipElement, IEquatable + { + /// + /// Gets or Sets Annotation + /// + + [DataMember(Name="annotation")] + public List Annotation { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnnotatedRelationshipElement {\n"); + sb.Append(" Annotation: ").Append(Annotation).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AnnotatedRelationshipElement)obj); + } + + /// + /// Returns true if AnnotatedRelationshipElement instances are equal + /// + /// Instance of AnnotatedRelationshipElement to be compared + /// Boolean + public bool Equals(AnnotatedRelationshipElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Annotation == other.Annotation || + Annotation != null && + Annotation.SequenceEqual(other.Annotation) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Annotation != null) + hashCode = hashCode * 59 + Annotation.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) + { + return Equals(left, right); + } + + public static bool operator !=(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs new file mode 100644 index 000000000..930317d36 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -0,0 +1,196 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetAdministrationShell : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets AssetInformation + /// + [Required] + + [DataMember(Name="assetInformation")] + public AssetInformation AssetInformation { get; set; } + + /// + /// Gets or Sets DerivedFrom + /// + + [DataMember(Name="derivedFrom")] + public Reference DerivedFrom { get; set; } + + /// + /// Gets or Sets Security + /// + + [DataMember(Name="security")] + public Security Security { get; set; } + + /// + /// Gets or Sets Submodels + /// + + [DataMember(Name="submodels")] + public List Submodels { get; set; } + + /// + /// Gets or Sets Views + /// + + [DataMember(Name="views")] + public List Views { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetAdministrationShell {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" AssetInformation: ").Append(AssetInformation).Append("\n"); + sb.Append(" DerivedFrom: ").Append(DerivedFrom).Append("\n"); + sb.Append(" Security: ").Append(Security).Append("\n"); + sb.Append(" Submodels: ").Append(Submodels).Append("\n"); + sb.Append(" Views: ").Append(Views).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetAdministrationShell)obj); + } + + /// + /// Returns true if AssetAdministrationShell instances are equal + /// + /// Instance of AssetAdministrationShell to be compared + /// Boolean + public bool Equals(AssetAdministrationShell other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + AssetInformation == other.AssetInformation || + AssetInformation != null && + AssetInformation.Equals(other.AssetInformation) + ) && + ( + DerivedFrom == other.DerivedFrom || + DerivedFrom != null && + DerivedFrom.Equals(other.DerivedFrom) + ) && + ( + Security == other.Security || + Security != null && + Security.Equals(other.Security) + ) && + ( + Submodels == other.Submodels || + Submodels != null && + Submodels.SequenceEqual(other.Submodels) + ) && + ( + Views == other.Views || + Views != null && + Views.SequenceEqual(other.Views) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (AssetInformation != null) + hashCode = hashCode * 59 + AssetInformation.GetHashCode(); + if (DerivedFrom != null) + hashCode = hashCode * 59 + DerivedFrom.GetHashCode(); + if (Security != null) + hashCode = hashCode * 59 + Security.GetHashCode(); + if (Submodels != null) + hashCode = hashCode * 59 + Submodels.GetHashCode(); + if (Views != null) + hashCode = hashCode * 59 + Views.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetAdministrationShell left, AssetAdministrationShell right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetAdministrationShell left, AssetAdministrationShell right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs new file mode 100644 index 000000000..3f1819c13 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -0,0 +1,150 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetAdministrationShellEnvironment : IEquatable + { + /// + /// Gets or Sets AssetAdministrationShells + /// + + [DataMember(Name="assetAdministrationShells")] + public List AssetAdministrationShells { get; set; } + + /// + /// Gets or Sets ConceptDescriptions + /// + + [DataMember(Name="conceptDescriptions")] + public List ConceptDescriptions { get; set; } + + /// + /// Gets or Sets Submodels + /// + + [DataMember(Name="submodels")] + public List Submodels { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetAdministrationShellEnvironment {\n"); + sb.Append(" AssetAdministrationShells: ").Append(AssetAdministrationShells).Append("\n"); + sb.Append(" ConceptDescriptions: ").Append(ConceptDescriptions).Append("\n"); + sb.Append(" Submodels: ").Append(Submodels).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetAdministrationShellEnvironment)obj); + } + + /// + /// Returns true if AssetAdministrationShellEnvironment instances are equal + /// + /// Instance of AssetAdministrationShellEnvironment to be compared + /// Boolean + public bool Equals(AssetAdministrationShellEnvironment other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AssetAdministrationShells == other.AssetAdministrationShells || + AssetAdministrationShells != null && + AssetAdministrationShells.SequenceEqual(other.AssetAdministrationShells) + ) && + ( + ConceptDescriptions == other.ConceptDescriptions || + ConceptDescriptions != null && + ConceptDescriptions.SequenceEqual(other.ConceptDescriptions) + ) && + ( + Submodels == other.Submodels || + Submodels != null && + Submodels.SequenceEqual(other.Submodels) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AssetAdministrationShells != null) + hashCode = hashCode * 59 + AssetAdministrationShells.GetHashCode(); + if (ConceptDescriptions != null) + hashCode = hashCode * 59 + ConceptDescriptions.GetHashCode(); + if (Submodels != null) + hashCode = hashCode * 59 + Submodels.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs new file mode 100644 index 000000000..8ab61ca3e --- /dev/null +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class AssetInformation : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AssetInformation {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((AssetInformation)obj); + } + + /// + /// Returns true if AssetInformation instances are equal + /// + /// Instance of AssetInformation to be compared + /// Boolean + public bool Equals(AssetInformation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(AssetInformation left, AssetInformation right) + { + return Equals(left, right); + } + + public static bool operator !=(AssetInformation left, AssetInformation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs new file mode 100644 index 000000000..e236f583e --- /dev/null +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets AssetKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AssetKind + { + /// + /// Enum TypeEnum for Type + /// + [EnumMember(Value = "Type")] + TypeEnum = 0, + /// + /// Enum InstanceEnum for Instance + /// + [EnumMember(Value = "Instance")] + InstanceEnum = 1 } +} diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs new file mode 100644 index 000000000..318151203 --- /dev/null +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BasicEvent : ModelEvent, IEquatable + { + /// + /// Gets or Sets Observed + /// + [Required] + + [DataMember(Name="observed")] + public Reference Observed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BasicEvent {\n"); + sb.Append(" Observed: ").Append(Observed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BasicEvent)obj); + } + + /// + /// Returns true if BasicEvent instances are equal + /// + /// Instance of BasicEvent to be compared + /// Boolean + public bool Equals(BasicEvent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Observed == other.Observed || + Observed != null && + Observed.Equals(other.Observed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Observed != null) + hashCode = hashCode * 59 + Observed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BasicEvent left, BasicEvent right) + { + return Equals(left, right); + } + + public static bool operator !=(BasicEvent left, BasicEvent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs new file mode 100644 index 000000000..100026f1b --- /dev/null +++ b/src/IO.Swagger/Models/Blob.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Blob : SubmodelElement, IEquatable + { + /// + /// Gets or Sets MimeType + /// + [Required] + + [DataMember(Name="mimeType")] + public string MimeType { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Blob {\n"); + sb.Append(" MimeType: ").Append(MimeType).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Blob)obj); + } + + /// + /// Returns true if Blob instances are equal + /// + /// Instance of Blob to be compared + /// Boolean + public bool Equals(Blob other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + MimeType == other.MimeType || + MimeType != null && + MimeType.Equals(other.MimeType) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (MimeType != null) + hashCode = hashCode * 59 + MimeType.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Blob left, Blob right) + { + return Equals(left, right); + } + + public static bool operator !=(Blob left, Blob right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs new file mode 100644 index 000000000..aa57ec7ff --- /dev/null +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BlobCertificate : IEquatable + { + /// + /// Gets or Sets _BlobCertificate + /// + + [DataMember(Name="blobCertificate")] + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasBlob _BlobCertificate { get; set; } + public Blob _BlobCertificate { get; set; } + + /// + /// Gets or Sets ContainedExtension + /// + + [DataMember(Name="containedExtension")] + public List ContainedExtension { get; set; } + + /// + /// Gets or Sets LastCertificate + /// + + [DataMember(Name="lastCertificate")] + public bool? LastCertificate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BlobCertificate {\n"); + sb.Append(" _BlobCertificate: ").Append(_BlobCertificate).Append("\n"); + sb.Append(" ContainedExtension: ").Append(ContainedExtension).Append("\n"); + sb.Append(" LastCertificate: ").Append(LastCertificate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BlobCertificate)obj); + } + + /// + /// Returns true if BlobCertificate instances are equal + /// + /// Instance of BlobCertificate to be compared + /// Boolean + public bool Equals(BlobCertificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _BlobCertificate == other._BlobCertificate || + _BlobCertificate != null && + _BlobCertificate.Equals(other._BlobCertificate) + ) && + ( + ContainedExtension == other.ContainedExtension || + ContainedExtension != null && + ContainedExtension.SequenceEqual(other.ContainedExtension) + ) && + ( + LastCertificate == other.LastCertificate || + LastCertificate != null && + LastCertificate.Equals(other.LastCertificate) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_BlobCertificate != null) + hashCode = hashCode * 59 + _BlobCertificate.GetHashCode(); + if (ContainedExtension != null) + hashCode = hashCode * 59 + ContainedExtension.GetHashCode(); + if (LastCertificate != null) + hashCode = hashCode * 59 + LastCertificate.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BlobCertificate left, BlobCertificate right) + { + return Equals(left, right); + } + + public static bool operator !=(BlobCertificate left, BlobCertificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs new file mode 100644 index 000000000..a52f19279 --- /dev/null +++ b/src/IO.Swagger/Models/Capability.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Capability : SubmodelElement, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capability {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Capability)obj); + } + + /// + /// Returns true if Capability instances are equal + /// + /// Instance of Capability to be compared + /// Boolean + public bool Equals(Capability other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Capability left, Capability right) + { + return Equals(left, right); + } + + public static bool operator !=(Capability left, Capability right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs new file mode 100644 index 000000000..ea6808243 --- /dev/null +++ b/src/IO.Swagger/Models/Certificate.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Certificate : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Certificate {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Certificate)obj); + } + + /// + /// Returns true if Certificate instances are equal + /// + /// Instance of Certificate to be compared + /// Boolean + public bool Equals(Certificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Certificate left, Certificate right) + { + return Equals(left, right); + } + + public static bool operator !=(Certificate left, Certificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs new file mode 100644 index 000000000..daee04c35 --- /dev/null +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ConceptDescription : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets IsCaseOf + /// + + [DataMember(Name="isCaseOf")] + public List IsCaseOf { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ConceptDescription {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" IsCaseOf: ").Append(IsCaseOf).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ConceptDescription)obj); + } + + /// + /// Returns true if ConceptDescription instances are equal + /// + /// Instance of ConceptDescription to be compared + /// Boolean + public bool Equals(ConceptDescription other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + IsCaseOf == other.IsCaseOf || + IsCaseOf != null && + IsCaseOf.SequenceEqual(other.IsCaseOf) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (IsCaseOf != null) + hashCode = hashCode * 59 + IsCaseOf.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ConceptDescription left, ConceptDescription right) + { + return Equals(left, right); + } + + public static bool operator !=(ConceptDescription left, ConceptDescription right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs new file mode 100644 index 000000000..ec4b27a12 --- /dev/null +++ b/src/IO.Swagger/Models/Constraint.cs @@ -0,0 +1,123 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Constraint : IEquatable + { + /// + /// Gets or Sets ModelType + /// + [Required] + + [DataMember(Name="modelType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelType ModelType { get; set; } + public ModelType ModelType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Constraint {\n"); + sb.Append(" ModelType: ").Append(ModelType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Constraint)obj); + } + + /// + /// Returns true if Constraint instances are equal + /// + /// Instance of Constraint to be compared + /// Boolean + public bool Equals(Constraint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ModelType == other.ModelType || + ModelType != null && + ModelType.Equals(other.ModelType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ModelType != null) + hashCode = hashCode * 59 + ModelType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Constraint left, Constraint right) + { + return Equals(left, right); + } + + public static bool operator !=(Constraint left, Constraint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs new file mode 100644 index 000000000..03e2b6ab0 --- /dev/null +++ b/src/IO.Swagger/Models/DataElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataElement)obj); + } + + /// + /// Returns true if DataElement instances are equal + /// + /// Instance of DataElement to be compared + /// Boolean + public bool Equals(DataElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataElement left, DataElement right) + { + return Equals(left, right); + } + + public static bool operator !=(DataElement left, DataElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs new file mode 100644 index 000000000..73470a843 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationContent : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationContent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationContent)obj); + } + + /// + /// Returns true if DataSpecificationContent instances are equal + /// + /// Instance of DataSpecificationContent to be compared + /// Boolean + public bool Equals(DataSpecificationContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationContent left, DataSpecificationContent right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationContent left, DataSpecificationContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs new file mode 100644 index 000000000..35597f732 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -0,0 +1,271 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable + { + /// + /// Gets or Sets DataType + /// + + [DataMember(Name="dataType")] + public string DataType { get; set; } + + /// + /// Gets or Sets Definition + /// + + [DataMember(Name="definition")] + public List Definition { get; set; } + + /// + /// Gets or Sets LevelType + /// + + [DataMember(Name="levelType")] + public List LevelType { get; set; } + + /// + /// Gets or Sets PreferredName + /// + [Required] + + [DataMember(Name="preferredName")] + public List PreferredName { get; set; } + + /// + /// Gets or Sets ShortName + /// + + [DataMember(Name="shortName")] + public List ShortName { get; set; } + + /// + /// Gets or Sets SourceOfDefinition + /// + + [DataMember(Name="sourceOfDefinition")] + public string SourceOfDefinition { get; set; } + + /// + /// Gets or Sets Symbol + /// + + [DataMember(Name="symbol")] + public string Symbol { get; set; } + + /// + /// Gets or Sets Unit + /// + + [DataMember(Name="unit")] + public string Unit { get; set; } + + /// + /// Gets or Sets UnitId + /// + + [DataMember(Name="unitId")] + public Reference UnitId { get; set; } + + /// + /// Gets or Sets ValueFormat + /// + + [DataMember(Name="valueFormat")] + public string ValueFormat { get; set; } + + /// + /// Gets or Sets ValueList + /// + + [DataMember(Name="valueList")] + public ValueList ValueList { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationIEC61360Content {\n"); + sb.Append(" DataType: ").Append(DataType).Append("\n"); + sb.Append(" Definition: ").Append(Definition).Append("\n"); + sb.Append(" LevelType: ").Append(LevelType).Append("\n"); + sb.Append(" PreferredName: ").Append(PreferredName).Append("\n"); + sb.Append(" ShortName: ").Append(ShortName).Append("\n"); + sb.Append(" SourceOfDefinition: ").Append(SourceOfDefinition).Append("\n"); + sb.Append(" Symbol: ").Append(Symbol).Append("\n"); + sb.Append(" Unit: ").Append(Unit).Append("\n"); + sb.Append(" UnitId: ").Append(UnitId).Append("\n"); + sb.Append(" ValueFormat: ").Append(ValueFormat).Append("\n"); + sb.Append(" ValueList: ").Append(ValueList).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationIEC61360Content)obj); + } + + /// + /// Returns true if DataSpecificationIEC61360Content instances are equal + /// + /// Instance of DataSpecificationIEC61360Content to be compared + /// Boolean + public bool Equals(DataSpecificationIEC61360Content other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + DataType == other.DataType || + DataType != null && + DataType.Equals(other.DataType) + ) && + ( + Definition == other.Definition || + Definition != null && + Definition.SequenceEqual(other.Definition) + ) && + ( + LevelType == other.LevelType || + LevelType != null && + LevelType.SequenceEqual(other.LevelType) + ) && + ( + PreferredName == other.PreferredName || + PreferredName != null && + PreferredName.SequenceEqual(other.PreferredName) + ) && + ( + ShortName == other.ShortName || + ShortName != null && + ShortName.SequenceEqual(other.ShortName) + ) && + ( + SourceOfDefinition == other.SourceOfDefinition || + SourceOfDefinition != null && + SourceOfDefinition.Equals(other.SourceOfDefinition) + ) && + ( + Symbol == other.Symbol || + Symbol != null && + Symbol.Equals(other.Symbol) + ) && + ( + Unit == other.Unit || + Unit != null && + Unit.Equals(other.Unit) + ) && + ( + UnitId == other.UnitId || + UnitId != null && + UnitId.Equals(other.UnitId) + ) && + ( + ValueFormat == other.ValueFormat || + ValueFormat != null && + ValueFormat.Equals(other.ValueFormat) + ) && + ( + ValueList == other.ValueList || + ValueList != null && + ValueList.Equals(other.ValueList) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (DataType != null) + hashCode = hashCode * 59 + DataType.GetHashCode(); + if (Definition != null) + hashCode = hashCode * 59 + Definition.GetHashCode(); + if (LevelType != null) + hashCode = hashCode * 59 + LevelType.GetHashCode(); + if (PreferredName != null) + hashCode = hashCode * 59 + PreferredName.GetHashCode(); + if (ShortName != null) + hashCode = hashCode * 59 + ShortName.GetHashCode(); + if (SourceOfDefinition != null) + hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); + if (Symbol != null) + hashCode = hashCode * 59 + Symbol.GetHashCode(); + if (Unit != null) + hashCode = hashCode * 59 + Unit.GetHashCode(); + if (UnitId != null) + hashCode = hashCode * 59 + UnitId.GetHashCode(); + if (ValueFormat != null) + hashCode = hashCode * 59 + ValueFormat.GetHashCode(); + if (ValueList != null) + hashCode = hashCode * 59 + ValueList.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs new file mode 100644 index 000000000..f72ad4d3b --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -0,0 +1,303 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class DataSpecificationPhysicalUnitContent : IEquatable + { + /// + /// Gets or Sets ConversionFactor + /// + + [DataMember(Name="conversionFactor")] + public string ConversionFactor { get; set; } + + /// + /// Gets or Sets Definition + /// + [Required] + + [DataMember(Name="definition")] + public List Definition { get; set; } + + /// + /// Gets or Sets DinNotation + /// + + [DataMember(Name="dinNotation")] + public string DinNotation { get; set; } + + /// + /// Gets or Sets EceCode + /// + + [DataMember(Name="eceCode")] + public string EceCode { get; set; } + + /// + /// Gets or Sets EceName + /// + + [DataMember(Name="eceName")] + public string EceName { get; set; } + + /// + /// Gets or Sets NistName + /// + + [DataMember(Name="nistName")] + public string NistName { get; set; } + + /// + /// Gets or Sets RegistrationAuthorityId + /// + + [DataMember(Name="registrationAuthorityId")] + public string RegistrationAuthorityId { get; set; } + + /// + /// Gets or Sets SiName + /// + + [DataMember(Name="siName")] + public string SiName { get; set; } + + /// + /// Gets or Sets SiNotation + /// + + [DataMember(Name="siNotation")] + public string SiNotation { get; set; } + + /// + /// Gets or Sets SourceOfDefinition + /// + + [DataMember(Name="sourceOfDefinition")] + public string SourceOfDefinition { get; set; } + + /// + /// Gets or Sets Supplier + /// + + [DataMember(Name="supplier")] + public string Supplier { get; set; } + + /// + /// Gets or Sets UnitName + /// + [Required] + + [DataMember(Name="unitName")] + public string UnitName { get; set; } + + /// + /// Gets or Sets UnitSymbol + /// + [Required] + + [DataMember(Name="unitSymbol")] + public string UnitSymbol { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DataSpecificationPhysicalUnitContent {\n"); + sb.Append(" ConversionFactor: ").Append(ConversionFactor).Append("\n"); + sb.Append(" Definition: ").Append(Definition).Append("\n"); + sb.Append(" DinNotation: ").Append(DinNotation).Append("\n"); + sb.Append(" EceCode: ").Append(EceCode).Append("\n"); + sb.Append(" EceName: ").Append(EceName).Append("\n"); + sb.Append(" NistName: ").Append(NistName).Append("\n"); + sb.Append(" RegistrationAuthorityId: ").Append(RegistrationAuthorityId).Append("\n"); + sb.Append(" SiName: ").Append(SiName).Append("\n"); + sb.Append(" SiNotation: ").Append(SiNotation).Append("\n"); + sb.Append(" SourceOfDefinition: ").Append(SourceOfDefinition).Append("\n"); + sb.Append(" Supplier: ").Append(Supplier).Append("\n"); + sb.Append(" UnitName: ").Append(UnitName).Append("\n"); + sb.Append(" UnitSymbol: ").Append(UnitSymbol).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DataSpecificationPhysicalUnitContent)obj); + } + + /// + /// Returns true if DataSpecificationPhysicalUnitContent instances are equal + /// + /// Instance of DataSpecificationPhysicalUnitContent to be compared + /// Boolean + public bool Equals(DataSpecificationPhysicalUnitContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ConversionFactor == other.ConversionFactor || + ConversionFactor != null && + ConversionFactor.Equals(other.ConversionFactor) + ) && + ( + Definition == other.Definition || + Definition != null && + Definition.SequenceEqual(other.Definition) + ) && + ( + DinNotation == other.DinNotation || + DinNotation != null && + DinNotation.Equals(other.DinNotation) + ) && + ( + EceCode == other.EceCode || + EceCode != null && + EceCode.Equals(other.EceCode) + ) && + ( + EceName == other.EceName || + EceName != null && + EceName.Equals(other.EceName) + ) && + ( + NistName == other.NistName || + NistName != null && + NistName.Equals(other.NistName) + ) && + ( + RegistrationAuthorityId == other.RegistrationAuthorityId || + RegistrationAuthorityId != null && + RegistrationAuthorityId.Equals(other.RegistrationAuthorityId) + ) && + ( + SiName == other.SiName || + SiName != null && + SiName.Equals(other.SiName) + ) && + ( + SiNotation == other.SiNotation || + SiNotation != null && + SiNotation.Equals(other.SiNotation) + ) && + ( + SourceOfDefinition == other.SourceOfDefinition || + SourceOfDefinition != null && + SourceOfDefinition.Equals(other.SourceOfDefinition) + ) && + ( + Supplier == other.Supplier || + Supplier != null && + Supplier.Equals(other.Supplier) + ) && + ( + UnitName == other.UnitName || + UnitName != null && + UnitName.Equals(other.UnitName) + ) && + ( + UnitSymbol == other.UnitSymbol || + UnitSymbol != null && + UnitSymbol.Equals(other.UnitSymbol) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ConversionFactor != null) + hashCode = hashCode * 59 + ConversionFactor.GetHashCode(); + if (Definition != null) + hashCode = hashCode * 59 + Definition.GetHashCode(); + if (DinNotation != null) + hashCode = hashCode * 59 + DinNotation.GetHashCode(); + if (EceCode != null) + hashCode = hashCode * 59 + EceCode.GetHashCode(); + if (EceName != null) + hashCode = hashCode * 59 + EceName.GetHashCode(); + if (NistName != null) + hashCode = hashCode * 59 + NistName.GetHashCode(); + if (RegistrationAuthorityId != null) + hashCode = hashCode * 59 + RegistrationAuthorityId.GetHashCode(); + if (SiName != null) + hashCode = hashCode * 59 + SiName.GetHashCode(); + if (SiNotation != null) + hashCode = hashCode * 59 + SiNotation.GetHashCode(); + if (SourceOfDefinition != null) + hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); + if (Supplier != null) + hashCode = hashCode * 59 + Supplier.GetHashCode(); + if (UnitName != null) + hashCode = hashCode * 59 + UnitName.GetHashCode(); + if (UnitSymbol != null) + hashCode = hashCode * 59 + UnitSymbol.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) + { + return Equals(left, right); + } + + public static bool operator !=(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs new file mode 100644 index 000000000..c21e05e0f --- /dev/null +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -0,0 +1,141 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class EmbeddedDataSpecification : IEquatable + { + /// + /// Gets or Sets DataSpecification + /// + [Required] + + [DataMember(Name="dataSpecification")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DataSpecification { get; set; } + public Reference DataSpecification { get; set; } + + /// + /// Gets or Sets DataSpecificationContent + /// + [Required] + + [DataMember(Name="dataSpecificationContent")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasDataSpecificationContent DataSpecificationContent { get; set; } + public DataSpecificationContent DataSpecificationContent { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EmbeddedDataSpecification {\n"); + sb.Append(" DataSpecification: ").Append(DataSpecification).Append("\n"); + sb.Append(" DataSpecificationContent: ").Append(DataSpecificationContent).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((EmbeddedDataSpecification)obj); + } + + /// + /// Returns true if EmbeddedDataSpecification instances are equal + /// + /// Instance of EmbeddedDataSpecification to be compared + /// Boolean + public bool Equals(EmbeddedDataSpecification other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + DataSpecification == other.DataSpecification || + DataSpecification != null && + DataSpecification.Equals(other.DataSpecification) + ) && + ( + DataSpecificationContent == other.DataSpecificationContent || + DataSpecificationContent != null && + DataSpecificationContent.Equals(other.DataSpecificationContent) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (DataSpecification != null) + hashCode = hashCode * 59 + DataSpecification.GetHashCode(); + if (DataSpecificationContent != null) + hashCode = hashCode * 59 + DataSpecificationContent.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(EmbeddedDataSpecification left, EmbeddedDataSpecification right) + { + return Equals(left, right); + } + + public static bool operator !=(EmbeddedDataSpecification left, EmbeddedDataSpecification right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs new file mode 100644 index 000000000..49a3d9a09 --- /dev/null +++ b/src/IO.Swagger/Models/Entity.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Entity : SubmodelElement, IEquatable + { + /// + /// Gets or Sets EntityType + /// + [Required] + + [DataMember(Name="entityType")] + public EntityType EntityType { get; set; } + + /// + /// Gets or Sets GlobalAssetId + /// + + [DataMember(Name="globalAssetId")] + public Reference GlobalAssetId { get; set; } + + /// + /// Gets or Sets SpecificAssetIds + /// + + [DataMember(Name="specificAssetIds")] + public List SpecificAssetIds { get; set; } + + /// + /// Gets or Sets Statements + /// + + [DataMember(Name="statements")] + public List Statements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Entity {\n"); + sb.Append(" EntityType: ").Append(EntityType).Append("\n"); + sb.Append(" GlobalAssetId: ").Append(GlobalAssetId).Append("\n"); + sb.Append(" SpecificAssetIds: ").Append(SpecificAssetIds).Append("\n"); + sb.Append(" Statements: ").Append(Statements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Entity)obj); + } + + /// + /// Returns true if Entity instances are equal + /// + /// Instance of Entity to be compared + /// Boolean + public bool Equals(Entity other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EntityType == other.EntityType || + EntityType != null && + EntityType.Equals(other.EntityType) + ) && + ( + GlobalAssetId == other.GlobalAssetId || + GlobalAssetId != null && + GlobalAssetId.Equals(other.GlobalAssetId) + ) && + ( + SpecificAssetIds == other.SpecificAssetIds || + SpecificAssetIds != null && + SpecificAssetIds.SequenceEqual(other.SpecificAssetIds) + ) && + ( + Statements == other.Statements || + Statements != null && + Statements.SequenceEqual(other.Statements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EntityType != null) + hashCode = hashCode * 59 + EntityType.GetHashCode(); + if (GlobalAssetId != null) + hashCode = hashCode * 59 + GlobalAssetId.GetHashCode(); + if (SpecificAssetIds != null) + hashCode = hashCode * 59 + SpecificAssetIds.GetHashCode(); + if (Statements != null) + hashCode = hashCode * 59 + Statements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Entity left, Entity right) + { + return Equals(left, right); + } + + public static bool operator !=(Entity left, Entity right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs new file mode 100644 index 000000000..569dcd10d --- /dev/null +++ b/src/IO.Swagger/Models/EntityType.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets EntityType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum EntityType + { + /// + /// Enum CoManagedEntityEnum for CoManagedEntity + /// + [EnumMember(Value = "CoManagedEntity")] + CoManagedEntityEnum = 0, + /// + /// Enum SelfManagedEntityEnum for SelfManagedEntity + /// + [EnumMember(Value = "SelfManagedEntity")] + SelfManagedEntityEnum = 1 } +} diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs new file mode 100644 index 000000000..48d5cad95 --- /dev/null +++ b/src/IO.Swagger/Models/Extension.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Extension : HasSemantics, IEquatable + { + /// + /// Gets or Sets Name + /// + [Required] + + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets RefersTo + /// + + [DataMember(Name="refersTo")] + public Reference RefersTo { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Extension {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" RefersTo: ").Append(RefersTo).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Extension)obj); + } + + /// + /// Returns true if Extension instances are equal + /// + /// Instance of Extension to be compared + /// Boolean + public bool Equals(Extension other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + RefersTo == other.RefersTo || + RefersTo != null && + RefersTo.Equals(other.RefersTo) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (RefersTo != null) + hashCode = hashCode * 59 + RefersTo.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Extension left, Extension right) + { + return Equals(left, right); + } + + public static bool operator !=(Extension left, Extension right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs new file mode 100644 index 000000000..330434ae0 --- /dev/null +++ b/src/IO.Swagger/Models/File.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class File : SubmodelElement, IEquatable + { + /// + /// Gets or Sets MimeType + /// + [Required] + + [DataMember(Name="mimeType")] + public string MimeType { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" MimeType: ").Append(MimeType).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((File)obj); + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + MimeType == other.MimeType || + MimeType != null && + MimeType.Equals(other.MimeType) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (MimeType != null) + hashCode = hashCode * 59 + MimeType.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(File left, File right) + { + return Equals(left, right); + } + + public static bool operator !=(File left, File right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs new file mode 100644 index 000000000..1214dc664 --- /dev/null +++ b/src/IO.Swagger/Models/Formula.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Formula : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Formula {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Formula)obj); + } + + /// + /// Returns true if Formula instances are equal + /// + /// Instance of Formula to be compared + /// Boolean + public bool Equals(Formula other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Formula left, Formula right) + { + return Equals(left, right); + } + + public static bool operator !=(Formula left, Formula right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs new file mode 100644 index 000000000..1b3123530 --- /dev/null +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class GlobalReference : Reference, IEquatable + { + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GlobalReference {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((GlobalReference)obj); + } + + /// + /// Returns true if GlobalReference instances are equal + /// + /// Instance of GlobalReference to be compared + /// Boolean + public bool Equals(GlobalReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(GlobalReference left, GlobalReference right) + { + return Equals(left, right); + } + + public static bool operator !=(GlobalReference left, GlobalReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs new file mode 100644 index 000000000..e901e1f31 --- /dev/null +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasDataSpecification : IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasDataSpecification {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasDataSpecification)obj); + } + + /// + /// Returns true if HasDataSpecification instances are equal + /// + /// Instance of HasDataSpecification to be compared + /// Boolean + public bool Equals(HasDataSpecification other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasDataSpecification left, HasDataSpecification right) + { + return Equals(left, right); + } + + public static bool operator !=(HasDataSpecification left, HasDataSpecification right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs new file mode 100644 index 000000000..3f0120412 --- /dev/null +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasExtensions : IEquatable + { + /// + /// Gets or Sets Extensions + /// + + [DataMember(Name="extensions")] + public List Extensions { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasExtensions {\n"); + sb.Append(" Extensions: ").Append(Extensions).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasExtensions)obj); + } + + /// + /// Returns true if HasExtensions instances are equal + /// + /// Instance of HasExtensions to be compared + /// Boolean + public bool Equals(HasExtensions other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Extensions == other.Extensions || + Extensions != null && + Extensions.SequenceEqual(other.Extensions) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Extensions != null) + hashCode = hashCode * 59 + Extensions.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasExtensions left, HasExtensions right) + { + return Equals(left, right); + } + + public static bool operator !=(HasExtensions left, HasExtensions right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs new file mode 100644 index 000000000..bfc6dbf15 --- /dev/null +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -0,0 +1,122 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class HasSemantics : IEquatable + { + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasSemantics {\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((HasSemantics)obj); + } + + /// + /// Returns true if HasSemantics instances are equal + /// + /// Instance of HasSemantics to be compared + /// Boolean + public bool Equals(HasSemantics other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(HasSemantics left, HasSemantics right) + { + return Equals(left, right); + } + + public static bool operator !=(HasSemantics left, HasSemantics right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs new file mode 100644 index 000000000..486255b3f --- /dev/null +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Identifiable : Referable, IEquatable + { + /// + /// Gets or Sets Administration + /// + + [DataMember(Name="administration")] + public AdministrativeInformation Administration { get; set; } + + /// + /// Gets or Sets Identification + /// + [Required] + + [DataMember(Name="identification")] + public string Identification { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Identifiable {\n"); + sb.Append(" Administration: ").Append(Administration).Append("\n"); + sb.Append(" Identification: ").Append(Identification).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Identifiable)obj); + } + + /// + /// Returns true if Identifiable instances are equal + /// + /// Instance of Identifiable to be compared + /// Boolean + public bool Equals(Identifiable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Administration == other.Administration || + Administration != null && + Administration.Equals(other.Administration) + ) && + ( + Identification == other.Identification || + Identification != null && + Identification.Equals(other.Identification) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Administration != null) + hashCode = hashCode * 59 + Administration.GetHashCode(); + if (Identification != null) + hashCode = hashCode * 59 + Identification.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Identifiable left, Identifiable right) + { + return Equals(left, right); + } + + public static bool operator !=(Identifiable left, Identifiable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs new file mode 100644 index 000000000..e71676d8b --- /dev/null +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -0,0 +1,153 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class IdentifierKeyValuePair : HasSemantics, IEquatable + { + /// + /// Gets or Sets Key + /// + [Required] + + [DataMember(Name="key")] + public string Key { get; set; } + + /// + /// Gets or Sets SubjectId + /// + [Required] + + [DataMember(Name="subjectId")] + public Reference SubjectId { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IdentifierKeyValuePair {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" SubjectId: ").Append(SubjectId).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IdentifierKeyValuePair)obj); + } + + /// + /// Returns true if IdentifierKeyValuePair instances are equal + /// + /// Instance of IdentifierKeyValuePair to be compared + /// Boolean + public bool Equals(IdentifierKeyValuePair other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Key == other.Key || + Key != null && + Key.Equals(other.Key) + ) && + ( + SubjectId == other.SubjectId || + SubjectId != null && + SubjectId.Equals(other.SubjectId) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Key != null) + hashCode = hashCode * 59 + Key.GetHashCode(); + if (SubjectId != null) + hashCode = hashCode * 59 + SubjectId.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + { + return Equals(left, right); + } + + public static bool operator !=(IdentifierKeyValuePair left, IdentifierKeyValuePair right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs new file mode 100644 index 000000000..eeed899eb --- /dev/null +++ b/src/IO.Swagger/Models/Key.cs @@ -0,0 +1,139 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Key : IEquatable + { + /// + /// Gets or Sets Type + /// + [Required] + + [DataMember(Name="type")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasKeyElements Type { get; set; } + public KeyElements Type { get; set; } + + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Key {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Key)obj); + } + + /// + /// Returns true if Key instances are equal + /// + /// Instance of Key to be compared + /// Boolean + public bool Equals(Key other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Key left, Key right) + { + return Equals(left, right); + } + + public static bool operator !=(Key left, Key right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs new file mode 100644 index 000000000..ab4fe4203 --- /dev/null +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -0,0 +1,144 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets KeyElements + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KeyElements + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum AccessPermissionRuleEnum for AccessPermissionRule + /// + [EnumMember(Value = "AccessPermissionRule")] + AccessPermissionRuleEnum = 1, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 2, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 3, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 4, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 5, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 6, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 7, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 8, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 9, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 10, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 22 } +} diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs new file mode 100644 index 000000000..88d7f5203 --- /dev/null +++ b/src/IO.Swagger/Models/LangString.cs @@ -0,0 +1,137 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class LangString : IEquatable + { + /// + /// Gets or Sets Language + /// + [Required] + + [DataMember(Name="language")] + public string Language { get; set; } + + /// + /// Gets or Sets Text + /// + [Required] + + [DataMember(Name="text")] + public string Text { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class LangString {\n"); + sb.Append(" Language: ").Append(Language).Append("\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((LangString)obj); + } + + /// + /// Returns true if LangString instances are equal + /// + /// Instance of LangString to be compared + /// Boolean + public bool Equals(LangString other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Language == other.Language || + Language != null && + Language.Equals(other.Language) + ) && + ( + Text == other.Text || + Text != null && + Text.Equals(other.Text) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Language != null) + hashCode = hashCode * 59 + Language.GetHashCode(); + if (Text != null) + hashCode = hashCode * 59 + Text.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(LangString left, LangString right) + { + return Equals(left, right); + } + + public static bool operator !=(LangString left, LangString right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs new file mode 100644 index 000000000..a638d02b6 --- /dev/null +++ b/src/IO.Swagger/Models/LevelType.cs @@ -0,0 +1,49 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets LevelType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum LevelType + { + /// + /// Enum MinEnum for Min + /// + [EnumMember(Value = "Min")] + MinEnum = 0, + /// + /// Enum MaxEnum for Max + /// + [EnumMember(Value = "Max")] + MaxEnum = 1, + /// + /// Enum NomEnum for Nom + /// + [EnumMember(Value = "Nom")] + NomEnum = 2, + /// + /// Enum TypEnum for Typ + /// + [EnumMember(Value = "Typ")] + TypEnum = 3 } +} diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs new file mode 100644 index 000000000..b83d19d4c --- /dev/null +++ b/src/IO.Swagger/Models/Message.cs @@ -0,0 +1,197 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Message : IEquatable + { + /// + /// Gets or Sets Code + /// + + [DataMember(Name="code")] + public string Code { get; set; } + + /// + /// Gets or Sets MessageType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum MessageTypeEnum + { + /// + /// Enum UndefinedEnum for Undefined + /// + [EnumMember(Value = "Undefined")] + UndefinedEnum = 0, + /// + /// Enum InfoEnum for Info + /// + [EnumMember(Value = "Info")] + InfoEnum = 1, + /// + /// Enum WarningEnum for Warning + /// + [EnumMember(Value = "Warning")] + WarningEnum = 2, + /// + /// Enum ErrorEnum for Error + /// + [EnumMember(Value = "Error")] + ErrorEnum = 3, + /// + /// Enum ExceptionEnum for Exception + /// + [EnumMember(Value = "Exception")] + ExceptionEnum = 4 } + + /// + /// Gets or Sets MessageType + /// + + [DataMember(Name="messageType")] + public MessageTypeEnum? MessageType { get; set; } + + /// + /// Gets or Sets Text + /// + + [DataMember(Name="text")] + public string Text { get; set; } + + /// + /// Gets or Sets Timestamp + /// + + [DataMember(Name="timestamp")] + public string Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Message {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" MessageType: ").Append(MessageType).Append("\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Message)obj); + } + + /// + /// Returns true if Message instances are equal + /// + /// Instance of Message to be compared + /// Boolean + public bool Equals(Message other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + Code != null && + Code.Equals(other.Code) + ) && + ( + MessageType == other.MessageType || + MessageType != null && + MessageType.Equals(other.MessageType) + ) && + ( + Text == other.Text || + Text != null && + Text.Equals(other.Text) + ) && + ( + Timestamp == other.Timestamp || + Timestamp != null && + Timestamp.Equals(other.Timestamp) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Code != null) + hashCode = hashCode * 59 + Code.GetHashCode(); + if (MessageType != null) + hashCode = hashCode * 59 + MessageType.GetHashCode(); + if (Text != null) + hashCode = hashCode * 59 + Text.GetHashCode(); + if (Timestamp != null) + hashCode = hashCode * 59 + Timestamp.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Message left, Message right) + { + return Equals(left, right); + } + + public static bool operator !=(Message left, Message right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs new file mode 100644 index 000000000..49065b6ef --- /dev/null +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelEvent : SubmodelElement, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelEvent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelEvent)obj); + } + + /// + /// Returns true if ModelEvent instances are equal + /// + /// Instance of ModelEvent to be compared + /// Boolean + public bool Equals(ModelEvent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelEvent left, ModelEvent right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelEvent left, ModelEvent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs new file mode 100644 index 000000000..a297f5f82 --- /dev/null +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -0,0 +1,138 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelReference : Reference, IEquatable + { + /// + /// Gets or Sets ReferredSemanticId + /// + + [DataMember(Name="referredSemanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ReferredSemanticId { get; set; } + public Reference ReferredSemanticId { get; set; } + + /// + /// Gets or Sets Keys + /// + [Required] + + [DataMember(Name="keys")] + public List Keys { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelReference {\n"); + sb.Append(" ReferredSemanticId: ").Append(ReferredSemanticId).Append("\n"); + sb.Append(" Keys: ").Append(Keys).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelReference)obj); + } + + /// + /// Returns true if ModelReference instances are equal + /// + /// Instance of ModelReference to be compared + /// Boolean + public bool Equals(ModelReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ReferredSemanticId == other.ReferredSemanticId || + ReferredSemanticId != null && + ReferredSemanticId.Equals(other.ReferredSemanticId) + ) && + ( + Keys == other.Keys || + Keys != null && + Keys.SequenceEqual(other.Keys) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ReferredSemanticId != null) + hashCode = hashCode * 59 + ReferredSemanticId.GetHashCode(); + if (Keys != null) + hashCode = hashCode * 59 + Keys.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelReference left, ModelReference right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelReference left, ModelReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs new file mode 100644 index 000000000..b75e6b0f8 --- /dev/null +++ b/src/IO.Swagger/Models/ModelType.cs @@ -0,0 +1,123 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ModelType : IEquatable + { + /// + /// Gets or Sets Name + /// + [Required] + + [DataMember(Name="name")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelTypes Name { get; set; } + public ModelTypes Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelType {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ModelType)obj); + } + + /// + /// Returns true if ModelType instances are equal + /// + /// Instance of ModelType to be compared + /// Boolean + public bool Equals(ModelType other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ModelType left, ModelType right) + { + return Equals(left, right); + } + + public static bool operator !=(ModelType left, ModelType right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs new file mode 100644 index 000000000..2a7d418c9 --- /dev/null +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -0,0 +1,164 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ModelTypes + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelTypes + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 1, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 2, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 3, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 4, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 5, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 6, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 7, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 8, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 9, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 10, + /// + /// Enum ModelReferenceEnum for ModelReference + /// + [EnumMember(Value = "ModelReference")] + ModelReferenceEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum GlobalReferenceEnum for GlobalReference + /// + [EnumMember(Value = "GlobalReference")] + GlobalReferenceEnum = 22, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 23, + /// + /// Enum ConstraintEnum for Constraint + /// + [EnumMember(Value = "Constraint")] + ConstraintEnum = 24, + /// + /// Enum FormulaEnum for Formula + /// + [EnumMember(Value = "Formula")] + FormulaEnum = 25, + /// + /// Enum QualifierEnum for Qualifier + /// + [EnumMember(Value = "Qualifier")] + QualifierEnum = 26 } +} diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs new file mode 100644 index 000000000..3aaf4f82e --- /dev/null +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -0,0 +1,39 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ModelingKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelingKind + { + /// + /// Enum TemplateEnum for Template + /// + [EnumMember(Value = "Template")] + TemplateEnum = 0, + /// + /// Enum InstanceEnum for Instance + /// + [EnumMember(Value = "Instance")] + InstanceEnum = 1 } +} diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs new file mode 100644 index 000000000..952db25c5 --- /dev/null +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class MultiLanguageProperty : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + public Reference ValueId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MultiLanguageProperty {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((MultiLanguageProperty)obj); + } + + /// + /// Returns true if MultiLanguageProperty instances are equal + /// + /// Instance of MultiLanguageProperty to be compared + /// Boolean + public bool Equals(MultiLanguageProperty other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(MultiLanguageProperty left, MultiLanguageProperty right) + { + return Equals(left, right); + } + + public static bool operator !=(MultiLanguageProperty left, MultiLanguageProperty right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs new file mode 100644 index 000000000..66fb952f5 --- /dev/null +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ObjectAttributes : IEquatable + { + /// + /// Gets or Sets ObjectAttribute + /// + + [DataMember(Name="objectAttribute")] + public List ObjectAttribute { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ObjectAttributes {\n"); + sb.Append(" ObjectAttribute: ").Append(ObjectAttribute).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ObjectAttributes)obj); + } + + /// + /// Returns true if ObjectAttributes instances are equal + /// + /// Instance of ObjectAttributes to be compared + /// Boolean + public bool Equals(ObjectAttributes other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ObjectAttribute == other.ObjectAttribute || + ObjectAttribute != null && + ObjectAttribute.SequenceEqual(other.ObjectAttribute) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ObjectAttribute != null) + hashCode = hashCode * 59 + ObjectAttribute.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ObjectAttributes left, ObjectAttributes right) + { + return Equals(left, right); + } + + public static bool operator !=(ObjectAttributes left, ObjectAttributes right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs new file mode 100644 index 000000000..1f33b2292 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfCertificate : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfCertificate {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfCertificate)obj); + } + + /// + /// Returns true if OneOfCertificate instances are equal + /// + /// Instance of OneOfCertificate to be compared + /// Boolean + public bool Equals(OneOfCertificate other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfCertificate left, OneOfCertificate right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfCertificate left, OneOfCertificate right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs new file mode 100644 index 000000000..a26901a55 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfConstraint : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfConstraint {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfConstraint)obj); + } + + /// + /// Returns true if OneOfConstraint instances are equal + /// + /// Instance of OneOfConstraint to be compared + /// Boolean + public bool Equals(OneOfConstraint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfConstraint left, OneOfConstraint right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfConstraint left, OneOfConstraint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs new file mode 100644 index 000000000..f898be81d --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfDataElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfDataElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfDataElement)obj); + } + + /// + /// Returns true if OneOfDataElement instances are equal + /// + /// Instance of OneOfDataElement to be compared + /// Boolean + public bool Equals(OneOfDataElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfDataElement left, OneOfDataElement right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfDataElement left, OneOfDataElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs new file mode 100644 index 000000000..a7081005a --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfDataSpecificationContent : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfDataSpecificationContent {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfDataSpecificationContent)obj); + } + + /// + /// Returns true if OneOfDataSpecificationContent instances are equal + /// + /// Instance of OneOfDataSpecificationContent to be compared + /// Boolean + public bool Equals(OneOfDataSpecificationContent other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs new file mode 100644 index 000000000..10cded410 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfOperationVariableValue : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfOperationVariableValue {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfOperationVariableValue)obj); + } + + /// + /// Returns true if OneOfOperationVariableValue instances are equal + /// + /// Instance of OneOfOperationVariableValue to be compared + /// Boolean + public bool Equals(OneOfOperationVariableValue other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfOperationVariableValue left, OneOfOperationVariableValue right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfOperationVariableValue left, OneOfOperationVariableValue right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs new file mode 100644 index 000000000..f92a58231 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfReference : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfReference {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfReference)obj); + } + + /// + /// Returns true if OneOfReference instances are equal + /// + /// Instance of OneOfReference to be compared + /// Boolean + public bool Equals(OneOfReference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfReference left, OneOfReference right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfReference left, OneOfReference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs new file mode 100644 index 000000000..b3c6d1148 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OneOfSubmodelElement : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OneOfSubmodelElement {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OneOfSubmodelElement)obj); + } + + /// + /// Returns true if OneOfSubmodelElement instances are equal + /// + /// Instance of OneOfSubmodelElement to be compared + /// Boolean + public bool Equals(OneOfSubmodelElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OneOfSubmodelElement left, OneOfSubmodelElement right) + { + return Equals(left, right); + } + + public static bool operator !=(OneOfSubmodelElement left, OneOfSubmodelElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs new file mode 100644 index 000000000..78b7bd9ce --- /dev/null +++ b/src/IO.Swagger/Models/Operation.cs @@ -0,0 +1,150 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Operation : SubmodelElement, IEquatable + { + /// + /// Gets or Sets InoutputVariable + /// + + [DataMember(Name="inoutputVariable")] + public List InoutputVariable { get; set; } + + /// + /// Gets or Sets InputVariable + /// + + [DataMember(Name="inputVariable")] + public List InputVariable { get; set; } + + /// + /// Gets or Sets OutputVariable + /// + + [DataMember(Name="outputVariable")] + public List OutputVariable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Operation {\n"); + sb.Append(" InoutputVariable: ").Append(InoutputVariable).Append("\n"); + sb.Append(" InputVariable: ").Append(InputVariable).Append("\n"); + sb.Append(" OutputVariable: ").Append(OutputVariable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Operation)obj); + } + + /// + /// Returns true if Operation instances are equal + /// + /// Instance of Operation to be compared + /// Boolean + public bool Equals(Operation other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + InoutputVariable == other.InoutputVariable || + InoutputVariable != null && + InoutputVariable.SequenceEqual(other.InoutputVariable) + ) && + ( + InputVariable == other.InputVariable || + InputVariable != null && + InputVariable.SequenceEqual(other.InputVariable) + ) && + ( + OutputVariable == other.OutputVariable || + OutputVariable != null && + OutputVariable.SequenceEqual(other.OutputVariable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (InoutputVariable != null) + hashCode = hashCode * 59 + InoutputVariable.GetHashCode(); + if (InputVariable != null) + hashCode = hashCode * 59 + InputVariable.GetHashCode(); + if (OutputVariable != null) + hashCode = hashCode * 59 + OutputVariable.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Operation left, Operation right) + { + return Equals(left, right); + } + + public static bool operator !=(Operation left, Operation right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs new file mode 100644 index 000000000..7201d0be6 --- /dev/null +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -0,0 +1,165 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationRequest : IEquatable + { + /// + /// Gets or Sets InoutputArguments + /// + + [DataMember(Name="inoutputArguments")] + public List InoutputArguments { get; set; } + + /// + /// Gets or Sets InputArguments + /// + + [DataMember(Name="inputArguments")] + public List InputArguments { get; set; } + + /// + /// Gets or Sets RequestId + /// + + [DataMember(Name="requestId")] + public string RequestId { get; set; } + + /// + /// Gets or Sets Timeout + /// + + [DataMember(Name="timeout")] + public int? Timeout { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationRequest {\n"); + sb.Append(" InoutputArguments: ").Append(InoutputArguments).Append("\n"); + sb.Append(" InputArguments: ").Append(InputArguments).Append("\n"); + sb.Append(" RequestId: ").Append(RequestId).Append("\n"); + sb.Append(" Timeout: ").Append(Timeout).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationRequest)obj); + } + + /// + /// Returns true if OperationRequest instances are equal + /// + /// Instance of OperationRequest to be compared + /// Boolean + public bool Equals(OperationRequest other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + InoutputArguments == other.InoutputArguments || + InoutputArguments != null && + InoutputArguments.SequenceEqual(other.InoutputArguments) + ) && + ( + InputArguments == other.InputArguments || + InputArguments != null && + InputArguments.SequenceEqual(other.InputArguments) + ) && + ( + RequestId == other.RequestId || + RequestId != null && + RequestId.Equals(other.RequestId) + ) && + ( + Timeout == other.Timeout || + Timeout != null && + Timeout.Equals(other.Timeout) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (InoutputArguments != null) + hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); + if (InputArguments != null) + hashCode = hashCode * 59 + InputArguments.GetHashCode(); + if (RequestId != null) + hashCode = hashCode * 59 + RequestId.GetHashCode(); + if (Timeout != null) + hashCode = hashCode * 59 + Timeout.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationRequest left, OperationRequest right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationRequest left, OperationRequest right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs new file mode 100644 index 000000000..a443d7e69 --- /dev/null +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -0,0 +1,219 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationResult : IEquatable + { + /// + /// Gets or Sets ExecutionResult + /// + + [DataMember(Name="executionResult")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasResult ExecutionResult { get; set; } + public Result ExecutionResult { get; set; } + + /// + /// Gets or Sets ExecutionState + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ExecutionStateEnum + { + /// + /// Enum InitiatedEnum for Initiated + /// + [EnumMember(Value = "Initiated")] + InitiatedEnum = 0, + /// + /// Enum RunningEnum for Running + /// + [EnumMember(Value = "Running")] + RunningEnum = 1, + /// + /// Enum CompletedEnum for Completed + /// + [EnumMember(Value = "Completed")] + CompletedEnum = 2, + /// + /// Enum CanceledEnum for Canceled + /// + [EnumMember(Value = "Canceled")] + CanceledEnum = 3, + /// + /// Enum FailedEnum for Failed + /// + [EnumMember(Value = "Failed")] + FailedEnum = 4, + /// + /// Enum TimeoutEnum for Timeout + /// + [EnumMember(Value = "Timeout")] + TimeoutEnum = 5 } + + /// + /// Gets or Sets ExecutionState + /// + + [DataMember(Name="executionState")] + public ExecutionStateEnum? ExecutionState { get; set; } + + /// + /// Gets or Sets InoutputArguments + /// + + [DataMember(Name="inoutputArguments")] + public List InoutputArguments { get; set; } + + /// + /// Gets or Sets OutputArguments + /// + + [DataMember(Name="outputArguments")] + public List OutputArguments { get; set; } + + /// + /// Gets or Sets RequestId + /// + + [DataMember(Name="requestId")] + public string RequestId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationResult {\n"); + sb.Append(" ExecutionResult: ").Append(ExecutionResult).Append("\n"); + sb.Append(" ExecutionState: ").Append(ExecutionState).Append("\n"); + sb.Append(" InoutputArguments: ").Append(InoutputArguments).Append("\n"); + sb.Append(" OutputArguments: ").Append(OutputArguments).Append("\n"); + sb.Append(" RequestId: ").Append(RequestId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationResult)obj); + } + + /// + /// Returns true if OperationResult instances are equal + /// + /// Instance of OperationResult to be compared + /// Boolean + public bool Equals(OperationResult other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExecutionResult == other.ExecutionResult || + ExecutionResult != null && + ExecutionResult.Equals(other.ExecutionResult) + ) && + ( + ExecutionState == other.ExecutionState || + ExecutionState != null && + ExecutionState.Equals(other.ExecutionState) + ) && + ( + InoutputArguments == other.InoutputArguments || + InoutputArguments != null && + InoutputArguments.SequenceEqual(other.InoutputArguments) + ) && + ( + OutputArguments == other.OutputArguments || + OutputArguments != null && + OutputArguments.SequenceEqual(other.OutputArguments) + ) && + ( + RequestId == other.RequestId || + RequestId != null && + RequestId.Equals(other.RequestId) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExecutionResult != null) + hashCode = hashCode * 59 + ExecutionResult.GetHashCode(); + if (ExecutionState != null) + hashCode = hashCode * 59 + ExecutionState.GetHashCode(); + if (InoutputArguments != null) + hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); + if (OutputArguments != null) + hashCode = hashCode * 59 + OutputArguments.GetHashCode(); + if (RequestId != null) + hashCode = hashCode * 59 + RequestId.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationResult left, OperationResult right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationResult left, OperationResult right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs new file mode 100644 index 000000000..1bb9242d3 --- /dev/null +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class OperationVariable : IEquatable + { + /// + /// Gets or Sets Value + /// + [Required] + + [DataMember(Name="value")] + public OneOfOperationVariableValue Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OperationVariable {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((OperationVariable)obj); + } + + /// + /// Returns true if OperationVariable instances are equal + /// + /// Instance of OperationVariable to be compared + /// Boolean + public bool Equals(OperationVariable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(OperationVariable left, OperationVariable right) + { + return Equals(left, right); + } + + public static bool operator !=(OperationVariable left, OperationVariable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs new file mode 100644 index 000000000..3df8196a2 --- /dev/null +++ b/src/IO.Swagger/Models/Permission.cs @@ -0,0 +1,166 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Permission : IEquatable + { + /// + /// Gets or Sets KindOfPermission + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KindOfPermissionEnum + { + /// + /// Enum AllowEnum for Allow + /// + [EnumMember(Value = "Allow")] + AllowEnum = 0, + /// + /// Enum DenyEnum for Deny + /// + [EnumMember(Value = "Deny")] + DenyEnum = 1, + /// + /// Enum NotApplicableEnum for NotApplicable + /// + [EnumMember(Value = "NotApplicable")] + NotApplicableEnum = 2, + /// + /// Enum UndefinedEnum for Undefined + /// + [EnumMember(Value = "Undefined")] + UndefinedEnum = 3 } + + /// + /// Gets or Sets KindOfPermission + /// + [Required] + + [DataMember(Name="kindOfPermission")] + public KindOfPermissionEnum? KindOfPermission { get; set; } + + /// + /// Gets or Sets _Permission + /// + [Required] + + [DataMember(Name="permission")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Permission { get; set; } + public Reference _Permission { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Permission {\n"); + sb.Append(" KindOfPermission: ").Append(KindOfPermission).Append("\n"); + sb.Append(" _Permission: ").Append(_Permission).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Permission)obj); + } + + /// + /// Returns true if Permission instances are equal + /// + /// Instance of Permission to be compared + /// Boolean + public bool Equals(Permission other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + KindOfPermission == other.KindOfPermission || + KindOfPermission != null && + KindOfPermission.Equals(other.KindOfPermission) + ) && + ( + _Permission == other._Permission || + _Permission != null && + _Permission.Equals(other._Permission) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (KindOfPermission != null) + hashCode = hashCode * 59 + KindOfPermission.GetHashCode(); + if (_Permission != null) + hashCode = hashCode * 59 + _Permission.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Permission left, Permission right) + { + return Equals(left, right); + } + + public static bool operator !=(Permission left, Permission right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs new file mode 100644 index 000000000..e4604d13c --- /dev/null +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PermissionsPerObject : IEquatable + { + /// + /// Gets or Sets _Object + /// + + [DataMember(Name="object")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Object { get; set; } + public Reference _Object { get; set; } + + /// + /// Gets or Sets Permission + /// + + [DataMember(Name="permission")] + public List Permission { get; set; } + + /// + /// Gets or Sets TargetObjectAttributes + /// + + [DataMember(Name="targetObjectAttributes")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasObjectAttributes TargetObjectAttributes { get; set; } + public ObjectAttributes TargetObjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PermissionsPerObject {\n"); + sb.Append(" _Object: ").Append(_Object).Append("\n"); + sb.Append(" Permission: ").Append(Permission).Append("\n"); + sb.Append(" TargetObjectAttributes: ").Append(TargetObjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PermissionsPerObject)obj); + } + + /// + /// Returns true if PermissionsPerObject instances are equal + /// + /// Instance of PermissionsPerObject to be compared + /// Boolean + public bool Equals(PermissionsPerObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _Object == other._Object || + _Object != null && + _Object.Equals(other._Object) + ) && + ( + Permission == other.Permission || + Permission != null && + Permission.SequenceEqual(other.Permission) + ) && + ( + TargetObjectAttributes == other.TargetObjectAttributes || + TargetObjectAttributes != null && + TargetObjectAttributes.Equals(other.TargetObjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_Object != null) + hashCode = hashCode * 59 + _Object.GetHashCode(); + if (Permission != null) + hashCode = hashCode * 59 + Permission.GetHashCode(); + if (TargetObjectAttributes != null) + hashCode = hashCode * 59 + TargetObjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PermissionsPerObject left, PermissionsPerObject right) + { + return Equals(left, right); + } + + public static bool operator !=(PermissionsPerObject left, PermissionsPerObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs new file mode 100644 index 000000000..c5224f43e --- /dev/null +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -0,0 +1,138 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyAdministrationPoint : IEquatable + { + /// + /// Gets or Sets ExternalAccessControl + /// + [Required] + + [DataMember(Name="externalAccessControl")] + public bool? ExternalAccessControl { get; set; } + + /// + /// Gets or Sets LocalAccessControl + /// + + [DataMember(Name="localAccessControl")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControl LocalAccessControl { get; set; } + public AccessControl LocalAccessControl { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyAdministrationPoint {\n"); + sb.Append(" ExternalAccessControl: ").Append(ExternalAccessControl).Append("\n"); + sb.Append(" LocalAccessControl: ").Append(LocalAccessControl).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyAdministrationPoint)obj); + } + + /// + /// Returns true if PolicyAdministrationPoint instances are equal + /// + /// Instance of PolicyAdministrationPoint to be compared + /// Boolean + public bool Equals(PolicyAdministrationPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalAccessControl == other.ExternalAccessControl || + ExternalAccessControl != null && + ExternalAccessControl.Equals(other.ExternalAccessControl) + ) && + ( + LocalAccessControl == other.LocalAccessControl || + LocalAccessControl != null && + LocalAccessControl.Equals(other.LocalAccessControl) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalAccessControl != null) + hashCode = hashCode * 59 + ExternalAccessControl.GetHashCode(); + if (LocalAccessControl != null) + hashCode = hashCode * 59 + LocalAccessControl.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyAdministrationPoint left, PolicyAdministrationPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyAdministrationPoint left, PolicyAdministrationPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs new file mode 100644 index 000000000..736a37c49 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyDecisionPoint : IEquatable + { + /// + /// Gets or Sets ExternalPolicyDecisionPoints + /// + [Required] + + [DataMember(Name="externalPolicyDecisionPoints")] + public bool? ExternalPolicyDecisionPoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyDecisionPoint {\n"); + sb.Append(" ExternalPolicyDecisionPoints: ").Append(ExternalPolicyDecisionPoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyDecisionPoint)obj); + } + + /// + /// Returns true if PolicyDecisionPoint instances are equal + /// + /// Instance of PolicyDecisionPoint to be compared + /// Boolean + public bool Equals(PolicyDecisionPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalPolicyDecisionPoints == other.ExternalPolicyDecisionPoints || + ExternalPolicyDecisionPoints != null && + ExternalPolicyDecisionPoints.Equals(other.ExternalPolicyDecisionPoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalPolicyDecisionPoints != null) + hashCode = hashCode * 59 + ExternalPolicyDecisionPoints.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyDecisionPoint left, PolicyDecisionPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyDecisionPoint left, PolicyDecisionPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs new file mode 100644 index 000000000..97f2ed0d3 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyEnforcementPoint : IEquatable + { + /// + /// Gets or Sets ExternalPolicyEnforcementPoint + /// + [Required] + + [DataMember(Name="externalPolicyEnforcementPoint")] + public bool? ExternalPolicyEnforcementPoint { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyEnforcementPoint {\n"); + sb.Append(" ExternalPolicyEnforcementPoint: ").Append(ExternalPolicyEnforcementPoint).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyEnforcementPoint)obj); + } + + /// + /// Returns true if PolicyEnforcementPoint instances are equal + /// + /// Instance of PolicyEnforcementPoint to be compared + /// Boolean + public bool Equals(PolicyEnforcementPoint other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalPolicyEnforcementPoint == other.ExternalPolicyEnforcementPoint || + ExternalPolicyEnforcementPoint != null && + ExternalPolicyEnforcementPoint.Equals(other.ExternalPolicyEnforcementPoint) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalPolicyEnforcementPoint != null) + hashCode = hashCode * 59 + ExternalPolicyEnforcementPoint.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyEnforcementPoint left, PolicyEnforcementPoint right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyEnforcementPoint left, PolicyEnforcementPoint right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs new file mode 100644 index 000000000..6cbe41c71 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -0,0 +1,136 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class PolicyInformationPoints : IEquatable + { + /// + /// Gets or Sets ExternalInformationPoint + /// + [Required] + + [DataMember(Name="externalInformationPoint")] + public bool? ExternalInformationPoint { get; set; } + + /// + /// Gets or Sets InternalInformationPoint + /// + + [DataMember(Name="internalInformationPoint")] + public List InternalInformationPoint { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolicyInformationPoints {\n"); + sb.Append(" ExternalInformationPoint: ").Append(ExternalInformationPoint).Append("\n"); + sb.Append(" InternalInformationPoint: ").Append(InternalInformationPoint).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((PolicyInformationPoints)obj); + } + + /// + /// Returns true if PolicyInformationPoints instances are equal + /// + /// Instance of PolicyInformationPoints to be compared + /// Boolean + public bool Equals(PolicyInformationPoints other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ExternalInformationPoint == other.ExternalInformationPoint || + ExternalInformationPoint != null && + ExternalInformationPoint.Equals(other.ExternalInformationPoint) + ) && + ( + InternalInformationPoint == other.InternalInformationPoint || + InternalInformationPoint != null && + InternalInformationPoint.SequenceEqual(other.InternalInformationPoint) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ExternalInformationPoint != null) + hashCode = hashCode * 59 + ExternalInformationPoint.GetHashCode(); + if (InternalInformationPoint != null) + hashCode = hashCode * 59 + InternalInformationPoint.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(PolicyInformationPoints left, PolicyInformationPoints right) + { + return Equals(left, right); + } + + public static bool operator !=(PolicyInformationPoints left, PolicyInformationPoints right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs new file mode 100644 index 000000000..0c2eef1dd --- /dev/null +++ b/src/IO.Swagger/Models/Property.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Property : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Property {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Property)obj); + } + + /// + /// Returns true if Property instances are equal + /// + /// Instance of Property to be compared + /// Boolean + public bool Equals(Property other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Property left, Property right) + { + return Equals(left, right); + } + + public static bool operator !=(Property left, Property right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs new file mode 100644 index 000000000..91093fcaf --- /dev/null +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Qualifiable : IEquatable + { + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Qualifiable {\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Qualifiable)obj); + } + + /// + /// Returns true if Qualifiable instances are equal + /// + /// Instance of Qualifiable to be compared + /// Boolean + public bool Equals(Qualifiable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Qualifiable left, Qualifiable right) + { + return Equals(left, right); + } + + public static bool operator !=(Qualifiable left, Qualifiable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs new file mode 100644 index 000000000..229d0ab9d --- /dev/null +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -0,0 +1,170 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Qualifier : HasSemantics, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Gets or Sets Type + /// + [Required] + + [DataMember(Name="type")] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Qualifier {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Qualifier)obj); + } + + /// + /// Returns true if Qualifier instances are equal + /// + /// Instance of Qualifier to be compared + /// Boolean + public bool Equals(Qualifier other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Qualifier left, Qualifier right) + { + return Equals(left, right); + } + + public static bool operator !=(Qualifier left, Qualifier right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs new file mode 100644 index 000000000..db644e080 --- /dev/null +++ b/src/IO.Swagger/Models/Range.cs @@ -0,0 +1,151 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Range : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Max + /// + + [DataMember(Name="max")] + public string Max { get; set; } + + /// + /// Gets or Sets Min + /// + + [DataMember(Name="min")] + public string Min { get; set; } + + /// + /// Gets or Sets ValueType + /// + [Required] + + [DataMember(Name="valueType")] + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Range {\n"); + sb.Append(" Max: ").Append(Max).Append("\n"); + sb.Append(" Min: ").Append(Min).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Range)obj); + } + + /// + /// Returns true if Range instances are equal + /// + /// Instance of Range to be compared + /// Boolean + public bool Equals(Range other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Max == other.Max || + Max != null && + Max.Equals(other.Max) + ) && + ( + Min == other.Min || + Min != null && + Min.Equals(other.Min) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Max != null) + hashCode = hashCode * 59 + Max.GetHashCode(); + if (Min != null) + hashCode = hashCode * 59 + Min.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Range left, Range right) + { + return Equals(left, right); + } + + public static bool operator !=(Range left, Range right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs new file mode 100644 index 000000000..3528845d5 --- /dev/null +++ b/src/IO.Swagger/Models/Referable.cs @@ -0,0 +1,182 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Referable : HasExtensions, IEquatable + { + /// + /// Gets or Sets Category + /// + + [DataMember(Name="category")] + public string Category { get; set; } + + /// + /// Gets or Sets Description + /// + + [DataMember(Name="description")] + public List Description { get; set; } + + /// + /// Gets or Sets DisplayName + /// + + [DataMember(Name="displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or Sets IdShort + /// + [Required] + + [DataMember(Name="idShort")] + public string IdShort { get; set; } + + /// + /// Gets or Sets ModelType + /// + [Required] + + [DataMember(Name="modelType")] + public ModelType ModelType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Referable {\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" DisplayName: ").Append(DisplayName).Append("\n"); + sb.Append(" IdShort: ").Append(IdShort).Append("\n"); + sb.Append(" ModelType: ").Append(ModelType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Referable)obj); + } + + /// + /// Returns true if Referable instances are equal + /// + /// Instance of Referable to be compared + /// Boolean + public bool Equals(Referable other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Description == other.Description || + Description != null && + Description.SequenceEqual(other.Description) + ) && + ( + DisplayName == other.DisplayName || + DisplayName != null && + DisplayName.Equals(other.DisplayName) + ) && + ( + IdShort == other.IdShort || + IdShort != null && + IdShort.Equals(other.IdShort) + ) && + ( + ModelType == other.ModelType || + ModelType != null && + ModelType.Equals(other.ModelType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + if (DisplayName != null) + hashCode = hashCode * 59 + DisplayName.GetHashCode(); + if (IdShort != null) + hashCode = hashCode * 59 + IdShort.GetHashCode(); + if (ModelType != null) + hashCode = hashCode * 59 + ModelType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Referable left, Referable right) + { + return Equals(left, right); + } + + public static bool operator !=(Referable left, Referable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs new file mode 100644 index 000000000..8ef828da3 --- /dev/null +++ b/src/IO.Swagger/Models/Reference.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Reference : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Reference {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Reference)obj); + } + + /// + /// Returns true if Reference instances are equal + /// + /// Instance of Reference to be compared + /// Boolean + public bool Equals(Reference other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Reference left, Reference right) + { + return Equals(left, right); + } + + public static bool operator !=(Reference left, Reference right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs new file mode 100644 index 000000000..29583b3c2 --- /dev/null +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ReferenceElement : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public Reference Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReferenceElement {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ReferenceElement)obj); + } + + /// + /// Returns true if ReferenceElement instances are equal + /// + /// Instance of ReferenceElement to be compared + /// Boolean + public bool Equals(ReferenceElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ReferenceElement left, ReferenceElement right) + { + return Equals(left, right); + } + + public static bool operator !=(ReferenceElement left, ReferenceElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs new file mode 100644 index 000000000..10ae5a544 --- /dev/null +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -0,0 +1,137 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class RelationshipElement : SubmodelElement, IEquatable + { + /// + /// Gets or Sets First + /// + [Required] + + [DataMember(Name="first")] + public Reference First { get; set; } + + /// + /// Gets or Sets Second + /// + [Required] + + [DataMember(Name="second")] + public Reference Second { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class RelationshipElement {\n"); + sb.Append(" First: ").Append(First).Append("\n"); + sb.Append(" Second: ").Append(Second).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((RelationshipElement)obj); + } + + /// + /// Returns true if RelationshipElement instances are equal + /// + /// Instance of RelationshipElement to be compared + /// Boolean + public bool Equals(RelationshipElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + First == other.First || + First != null && + First.Equals(other.First) + ) && + ( + Second == other.Second || + Second != null && + Second.Equals(other.Second) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (First != null) + hashCode = hashCode * 59 + First.GetHashCode(); + if (Second != null) + hashCode = hashCode * 59 + Second.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(RelationshipElement left, RelationshipElement right) + { + return Equals(left, right); + } + + public static bool operator !=(RelationshipElement left, RelationshipElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs new file mode 100644 index 000000000..c5ccfb1ce --- /dev/null +++ b/src/IO.Swagger/Models/Result.cs @@ -0,0 +1,135 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Result : IEquatable + { + /// + /// Gets or Sets Messages + /// + + [DataMember(Name="messages")] + public List Messages { get; set; } + + /// + /// Gets or Sets Success + /// + + [DataMember(Name="success")] + public bool? Success { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Result {\n"); + sb.Append(" Messages: ").Append(Messages).Append("\n"); + sb.Append(" Success: ").Append(Success).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Result)obj); + } + + /// + /// Returns true if Result instances are equal + /// + /// Instance of Result to be compared + /// Boolean + public bool Equals(Result other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Messages == other.Messages || + Messages != null && + Messages.SequenceEqual(other.Messages) + ) && + ( + Success == other.Success || + Success != null && + Success.Equals(other.Success) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Messages != null) + hashCode = hashCode * 59 + Messages.GetHashCode(); + if (Success != null) + hashCode = hashCode * 59 + Success.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Result left, Result right) + { + return Equals(left, right); + } + + public static bool operator !=(Result left, Result right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs new file mode 100644 index 000000000..2db4764ee --- /dev/null +++ b/src/IO.Swagger/Models/Security.cs @@ -0,0 +1,153 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Security : IEquatable + { + /// + /// Gets or Sets AccessControlPolicyPoints + /// + [Required] + + [DataMember(Name="accessControlPolicyPoints")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControlPolicyPoints AccessControlPolicyPoints { get; set; } + public AccessControlPolicyPoints AccessControlPolicyPoints { get; set; } + + /// + /// Gets or Sets Certificate + /// + + [DataMember(Name="certificate")] + public List Certificate { get; set; } + + /// + /// Gets or Sets RequiredCertificateExtension + /// + + [DataMember(Name="requiredCertificateExtension")] + public List RequiredCertificateExtension { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Security {\n"); + sb.Append(" AccessControlPolicyPoints: ").Append(AccessControlPolicyPoints).Append("\n"); + sb.Append(" Certificate: ").Append(Certificate).Append("\n"); + sb.Append(" RequiredCertificateExtension: ").Append(RequiredCertificateExtension).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Security)obj); + } + + /// + /// Returns true if Security instances are equal + /// + /// Instance of Security to be compared + /// Boolean + public bool Equals(Security other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + AccessControlPolicyPoints == other.AccessControlPolicyPoints || + AccessControlPolicyPoints != null && + AccessControlPolicyPoints.Equals(other.AccessControlPolicyPoints) + ) && + ( + Certificate == other.Certificate || + Certificate != null && + Certificate.SequenceEqual(other.Certificate) + ) && + ( + RequiredCertificateExtension == other.RequiredCertificateExtension || + RequiredCertificateExtension != null && + RequiredCertificateExtension.SequenceEqual(other.RequiredCertificateExtension) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (AccessControlPolicyPoints != null) + hashCode = hashCode * 59 + AccessControlPolicyPoints.GetHashCode(); + if (Certificate != null) + hashCode = hashCode * 59 + Certificate.GetHashCode(); + if (RequiredCertificateExtension != null) + hashCode = hashCode * 59 + RequiredCertificateExtension.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Security left, Security right) + { + return Equals(left, right); + } + + public static bool operator !=(Security left, Security right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs new file mode 100644 index 000000000..6e30f03b8 --- /dev/null +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -0,0 +1,120 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubjectAttributes : IEquatable + { + /// + /// Gets or Sets _SubjectAttributes + /// + + [DataMember(Name="subjectAttributes")] + public List _SubjectAttributes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubjectAttributes {\n"); + sb.Append(" _SubjectAttributes: ").Append(_SubjectAttributes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubjectAttributes)obj); + } + + /// + /// Returns true if SubjectAttributes instances are equal + /// + /// Instance of SubjectAttributes to be compared + /// Boolean + public bool Equals(SubjectAttributes other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + _SubjectAttributes == other._SubjectAttributes || + _SubjectAttributes != null && + _SubjectAttributes.SequenceEqual(other._SubjectAttributes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (_SubjectAttributes != null) + hashCode = hashCode * 59 + _SubjectAttributes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubjectAttributes left, SubjectAttributes right) + { + return Equals(left, right); + } + + public static bool operator !=(SubjectAttributes left, SubjectAttributes right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs new file mode 100644 index 000000000..6d686a7ff --- /dev/null +++ b/src/IO.Swagger/Models/Submodel.cs @@ -0,0 +1,182 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class Submodel : Identifiable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets Kind + /// + + [DataMember(Name="kind")] + public ModelingKind Kind { get; set; } + + /// + /// Gets or Sets SubmodelElements + /// + + [DataMember(Name="submodelElements")] + public List SubmodelElements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Submodel {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append(" SubmodelElements: ").Append(SubmodelElements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Submodel)obj); + } + + /// + /// Returns true if Submodel instances are equal + /// + /// Instance of Submodel to be compared + /// Boolean + public bool Equals(Submodel other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + Kind == other.Kind || + Kind != null && + Kind.Equals(other.Kind) + ) && + ( + SubmodelElements == other.SubmodelElements || + SubmodelElements != null && + SubmodelElements.SequenceEqual(other.SubmodelElements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (Kind != null) + hashCode = hashCode * 59 + Kind.GetHashCode(); + if (SubmodelElements != null) + hashCode = hashCode * 59 + SubmodelElements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Submodel left, Submodel right) + { + return Equals(left, right); + } + + public static bool operator !=(Submodel left, Submodel right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs new file mode 100644 index 000000000..a2f20eb03 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -0,0 +1,167 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElement : Referable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets Qualifiers + /// + + [DataMember(Name="qualifiers")] + public List Qualifiers { get; set; } + + /// + /// Gets or Sets Kind + /// + + [DataMember(Name="kind")] + public ModelingKind Kind { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElement {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" Qualifiers: ").Append(Qualifiers).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElement)obj); + } + + /// + /// Returns true if SubmodelElement instances are equal + /// + /// Instance of SubmodelElement to be compared + /// Boolean + public bool Equals(SubmodelElement other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + Qualifiers == other.Qualifiers || + Qualifiers != null && + Qualifiers.SequenceEqual(other.Qualifiers) + ) && + ( + Kind == other.Kind || + Kind != null && + Kind.Equals(other.Kind) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (Qualifiers != null) + hashCode = hashCode * 59 + Qualifiers.GetHashCode(); + if (Kind != null) + hashCode = hashCode * 59 + Kind.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElement left, SubmodelElement right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElement left, SubmodelElement right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs new file mode 100644 index 000000000..3e2e75550 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -0,0 +1,165 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElementList : SubmodelElement, IEquatable + { + /// + /// Gets or Sets SemanticIdValues + /// + + [DataMember(Name="semanticIdValues")] + public Reference SemanticIdValues { get; set; } + + /// + /// Gets or Sets SubmodelElementTypeValues + /// + + [DataMember(Name="submodelElementTypeValues")] + public ModelType SubmodelElementTypeValues { get; set; } + + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public List Value { get; set; } + + /// + /// Gets or Sets ValueTypeValues + /// + + [DataMember(Name="valueTypeValues")] + public ValueTypeEnum ValueTypeValues { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElementList {\n"); + sb.Append(" SemanticIdValues: ").Append(SemanticIdValues).Append("\n"); + sb.Append(" SubmodelElementTypeValues: ").Append(SubmodelElementTypeValues).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueTypeValues: ").Append(ValueTypeValues).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElementList)obj); + } + + /// + /// Returns true if SubmodelElementList instances are equal + /// + /// Instance of SubmodelElementList to be compared + /// Boolean + public bool Equals(SubmodelElementList other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + SemanticIdValues == other.SemanticIdValues || + SemanticIdValues != null && + SemanticIdValues.Equals(other.SemanticIdValues) + ) && + ( + SubmodelElementTypeValues == other.SubmodelElementTypeValues || + SubmodelElementTypeValues != null && + SubmodelElementTypeValues.Equals(other.SubmodelElementTypeValues) + ) && + ( + Value == other.Value || + Value != null && + Value.SequenceEqual(other.Value) + ) && + ( + ValueTypeValues == other.ValueTypeValues || + ValueTypeValues != null && + ValueTypeValues.Equals(other.ValueTypeValues) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (SemanticIdValues != null) + hashCode = hashCode * 59 + SemanticIdValues.GetHashCode(); + if (SubmodelElementTypeValues != null) + hashCode = hashCode * 59 + SubmodelElementTypeValues.GetHashCode(); + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueTypeValues != null) + hashCode = hashCode * 59 + ValueTypeValues.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElementList left, SubmodelElementList right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElementList left, SubmodelElementList right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs new file mode 100644 index 000000000..a08559806 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -0,0 +1,122 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class SubmodelElementStruct : SubmodelElement, IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasSubmodelElement Value { get; set; } + public SubmodelElement Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SubmodelElementStruct {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((SubmodelElementStruct)obj); + } + + /// + /// Returns true if SubmodelElementStruct instances are equal + /// + /// Instance of SubmodelElementStruct to be compared + /// Boolean + public bool Equals(SubmodelElementStruct other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(SubmodelElementStruct left, SubmodelElementStruct right) + { + return Equals(left, right); + } + + public static bool operator !=(SubmodelElementStruct left, SubmodelElementStruct right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs new file mode 100644 index 000000000..8308d84f8 --- /dev/null +++ b/src/IO.Swagger/Models/ValueList.cs @@ -0,0 +1,121 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueList : IEquatable + { + /// + /// Gets or Sets ValueReferencePairTypes + /// + [Required] + + [DataMember(Name="valueReferencePairTypes")] + public List ValueReferencePairTypes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueList {\n"); + sb.Append(" ValueReferencePairTypes: ").Append(ValueReferencePairTypes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueList)obj); + } + + /// + /// Returns true if ValueList instances are equal + /// + /// Instance of ValueList to be compared + /// Boolean + public bool Equals(ValueList other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ValueReferencePairTypes == other.ValueReferencePairTypes || + ValueReferencePairTypes != null && + ValueReferencePairTypes.SequenceEqual(other.ValueReferencePairTypes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ValueReferencePairTypes != null) + hashCode = hashCode * 59 + ValueReferencePairTypes.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueList left, ValueList right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueList left, ValueList right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs new file mode 100644 index 000000000..bbb677815 --- /dev/null +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -0,0 +1,154 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueObject : IEquatable + { + /// + /// Gets or Sets Value + /// + + [DataMember(Name="value")] + public string Value { get; set; } + + /// + /// Gets or Sets ValueId + /// + + [DataMember(Name="valueId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } + public Reference ValueId { get; set; } + + /// + /// Gets or Sets ValueType + /// + + [DataMember(Name="valueType")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } + public ValueTypeEnum ValueType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueObject {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ValueId: ").Append(ValueId).Append("\n"); + sb.Append(" ValueType: ").Append(ValueType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueObject)obj); + } + + /// + /// Returns true if ValueObject instances are equal + /// + /// Instance of ValueObject to be compared + /// Boolean + public bool Equals(ValueObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + ValueId == other.ValueId || + ValueId != null && + ValueId.Equals(other.ValueId) + ) && + ( + ValueType == other.ValueType || + ValueType != null && + ValueType.Equals(other.ValueType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (ValueId != null) + hashCode = hashCode * 59 + ValueId.GetHashCode(); + if (ValueType != null) + hashCode = hashCode * 59 + ValueType.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueObject left, ValueObject right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueObject left, ValueObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs new file mode 100644 index 000000000..af6705d11 --- /dev/null +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -0,0 +1,105 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class ValueReferencePairType : ValueObject, IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ValueReferencePairType {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ValueReferencePairType)obj); + } + + /// + /// Returns true if ValueReferencePairType instances are equal + /// + /// Instance of ValueReferencePairType to be compared + /// Boolean + public bool Equals(ValueReferencePairType other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ValueReferencePairType left, ValueReferencePairType right) + { + return Equals(left, right); + } + + public static bool operator !=(ValueReferencePairType left, ValueReferencePairType right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs new file mode 100644 index 000000000..a573295c3 --- /dev/null +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -0,0 +1,249 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets ValueTypeEnum + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ValueTypeEnum + { + /// + /// Enum AnyUriEnum for anyUri + /// + [EnumMember(Value = "anyUri")] + AnyUriEnum = 0, + /// + /// Enum Base64BinaryEnum for base64Binary + /// + [EnumMember(Value = "base64Binary")] + Base64BinaryEnum = 1, + /// + /// Enum BooleanEnum for boolean + /// + [EnumMember(Value = "boolean")] + BooleanEnum = 2, + /// + /// Enum DateEnum for date + /// + [EnumMember(Value = "date")] + DateEnum = 3, + /// + /// Enum DateTimeEnum for dateTime + /// + [EnumMember(Value = "dateTime")] + DateTimeEnum = 4, + /// + /// Enum DateTimeStampEnum for dateTimeStamp + /// + [EnumMember(Value = "dateTimeStamp")] + DateTimeStampEnum = 5, + /// + /// Enum DecimalEnum for decimal + /// + [EnumMember(Value = "decimal")] + DecimalEnum = 6, + /// + /// Enum IntegerEnum for integer + /// + [EnumMember(Value = "integer")] + IntegerEnum = 7, + /// + /// Enum LongEnum for long + /// + [EnumMember(Value = "long")] + LongEnum = 8, + /// + /// Enum IntEnum for int + /// + [EnumMember(Value = "int")] + IntEnum = 9, + /// + /// Enum ShortEnum for short + /// + [EnumMember(Value = "short")] + ShortEnum = 10, + /// + /// Enum ByteEnum for byte + /// + [EnumMember(Value = "byte")] + ByteEnum = 11, + /// + /// Enum NonNegativeIntegerEnum for nonNegativeInteger + /// + [EnumMember(Value = "nonNegativeInteger")] + NonNegativeIntegerEnum = 12, + /// + /// Enum PositiveIntegerEnum for positiveInteger + /// + [EnumMember(Value = "positiveInteger")] + PositiveIntegerEnum = 13, + /// + /// Enum UnsignedLongEnum for unsignedLong + /// + [EnumMember(Value = "unsignedLong")] + UnsignedLongEnum = 14, + /// + /// Enum UnsignedIntEnum for unsignedInt + /// + [EnumMember(Value = "unsignedInt")] + UnsignedIntEnum = 15, + /// + /// Enum UnsignedShortEnum for unsignedShort + /// + [EnumMember(Value = "unsignedShort")] + UnsignedShortEnum = 16, + /// + /// Enum UnsignedByteEnum for unsignedByte + /// + [EnumMember(Value = "unsignedByte")] + UnsignedByteEnum = 17, + /// + /// Enum NonPositiveIntegerEnum for nonPositiveInteger + /// + [EnumMember(Value = "nonPositiveInteger")] + NonPositiveIntegerEnum = 18, + /// + /// Enum NegativeIntegerEnum for negativeInteger + /// + [EnumMember(Value = "negativeInteger")] + NegativeIntegerEnum = 19, + /// + /// Enum DoubleEnum for double + /// + [EnumMember(Value = "double")] + DoubleEnum = 20, + /// + /// Enum DurationEnum for duration + /// + [EnumMember(Value = "duration")] + DurationEnum = 21, + /// + /// Enum DayTimeDurationEnum for dayTimeDuration + /// + [EnumMember(Value = "dayTimeDuration")] + DayTimeDurationEnum = 22, + /// + /// Enum YearMonthDurationEnum for yearMonthDuration + /// + [EnumMember(Value = "yearMonthDuration")] + YearMonthDurationEnum = 23, + /// + /// Enum FloatEnum for float + /// + [EnumMember(Value = "float")] + FloatEnum = 24, + /// + /// Enum GDayEnum for gDay + /// + [EnumMember(Value = "gDay")] + GDayEnum = 25, + /// + /// Enum GMonthEnum for gMonth + /// + [EnumMember(Value = "gMonth")] + GMonthEnum = 26, + /// + /// Enum GMonthDayEnum for gMonthDay + /// + [EnumMember(Value = "gMonthDay")] + GMonthDayEnum = 27, + /// + /// Enum GYearEnum for gYear + /// + [EnumMember(Value = "gYear")] + GYearEnum = 28, + /// + /// Enum GYearMonthEnum for gYearMonth + /// + [EnumMember(Value = "gYearMonth")] + GYearMonthEnum = 29, + /// + /// Enum HexBinaryEnum for hexBinary + /// + [EnumMember(Value = "hexBinary")] + HexBinaryEnum = 30, + /// + /// Enum NOTATIONEnum for NOTATION + /// + [EnumMember(Value = "NOTATION")] + NOTATIONEnum = 31, + /// + /// Enum QNameEnum for QName + /// + [EnumMember(Value = "QName")] + QNameEnum = 32, + /// + /// Enum StringEnum for string + /// + [EnumMember(Value = "string")] + StringEnum = 33, + /// + /// Enum NormalizedStringEnum for normalizedString + /// + [EnumMember(Value = "normalizedString")] + NormalizedStringEnum = 34, + /// + /// Enum TokenEnum for token + /// + [EnumMember(Value = "token")] + TokenEnum = 35, + /// + /// Enum LanguageEnum for language + /// + [EnumMember(Value = "language")] + LanguageEnum = 36, + /// + /// Enum NameEnum for Name + /// + [EnumMember(Value = "Name")] + NameEnum = 37, + /// + /// Enum NCNameEnum for NCName + /// + [EnumMember(Value = "NCName")] + NCNameEnum = 38, + /// + /// Enum ENTITYEnum for ENTITY + /// + [EnumMember(Value = "ENTITY")] + ENTITYEnum = 39, + /// + /// Enum IDEnum for ID + /// + [EnumMember(Value = "ID")] + IDEnum = 40, + /// + /// Enum IDREFEnum for IDREF + /// + [EnumMember(Value = "IDREF")] + IDREFEnum = 41, + /// + /// Enum NMTOKENEnum for NMTOKEN + /// + [EnumMember(Value = "NMTOKEN")] + NMTOKENEnum = 42, + /// + /// Enum TimeEnum for time + /// + [EnumMember(Value = "time")] + TimeEnum = 43 } +} diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs new file mode 100644 index 000000000..b0016246c --- /dev/null +++ b/src/IO.Swagger/Models/View.cs @@ -0,0 +1,152 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class View : Referable, IEquatable + { + /// + /// Gets or Sets EmbeddedDataSpecifications + /// + + [DataMember(Name="embeddedDataSpecifications")] + public List EmbeddedDataSpecifications { get; set; } + + /// + /// Gets or Sets SemanticId + /// + + [DataMember(Name="semanticId")] + //TODO: + //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } + public Reference SemanticId { get; set; } + + /// + /// Gets or Sets ContainedElements + /// + + [DataMember(Name="containedElements")] + public List ContainedElements { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class View {\n"); + sb.Append(" EmbeddedDataSpecifications: ").Append(EmbeddedDataSpecifications).Append("\n"); + sb.Append(" SemanticId: ").Append(SemanticId).Append("\n"); + sb.Append(" ContainedElements: ").Append(ContainedElements).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((View)obj); + } + + /// + /// Returns true if View instances are equal + /// + /// Instance of View to be compared + /// Boolean + public bool Equals(View other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || + EmbeddedDataSpecifications != null && + EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) + ) && + ( + SemanticId == other.SemanticId || + SemanticId != null && + SemanticId.Equals(other.SemanticId) + ) && + ( + ContainedElements == other.ContainedElements || + ContainedElements != null && + ContainedElements.SequenceEqual(other.ContainedElements) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EmbeddedDataSpecifications != null) + hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); + if (SemanticId != null) + hashCode = hashCode * 59 + SemanticId.GetHashCode(); + if (ContainedElements != null) + hashCode = hashCode * 59 + ContainedElements.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(View left, View right) + { + return Equals(left, right); + } + + public static bool operator !=(View left, View right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Program.cs b/src/IO.Swagger/Program.cs new file mode 100644 index 000000000..cdbbe15a7 --- /dev/null +++ b/src/IO.Swagger/Program.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + + CreateWebHostBuilder(args).Build().RunAsync(); + + //CreateHostBuilder(args).Build().RunAsync(); + + AasxServer.Program.Main(args); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/src/IO.Swagger/Properties/launchSettings.json b/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 000000000..7ef03b4e0 --- /dev/null +++ b/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "publishAllPorts": true, + "useSSL": true + } + } +} \ No newline at end of file diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs new file mode 100644 index 000000000..39fcd6c69 --- /dev/null +++ b/src/IO.Swagger/Startup.cs @@ -0,0 +1,141 @@ +/* + * DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository + * + * An exemplary interface combination for the use case of an Asset Administration Shell Repository + * + * OpenAPI spec version: Final-Draft + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.IO; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; + + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IWebHostEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IWebHostEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); + }) + .AddXmlSerializerFormatters(); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("Final-Draft", new OpenApiInfo + { + Version = "Final-Draft", + Title = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", + Contact = new OpenApiContact() + { + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" + }, + TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") + }); + c.CustomSchemaIds(type => type.FullName); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.UseRouting(); + + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/Final-Draft/swagger.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + app.UseExceptionHandler("/Error"); + + app.UseHsts(); + } + } + } +} diff --git a/src/IO.Swagger/appsettings.json b/src/IO.Swagger/appsettings.json new file mode 100644 index 000000000..c6af7d9b0 --- /dev/null +++ b/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/IO.Swagger/web.config b/src/IO.Swagger/web.config new file mode 100644 index 000000000..6250eaf44 --- /dev/null +++ b/src/IO.Swagger/web.config @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/IO.Swagger/wwwroot/README.md b/src/IO.Swagger/wwwroot/README.md new file mode 100644 index 000000000..6a0b78471 --- /dev/null +++ b/src/IO.Swagger/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/src/IO.Swagger/wwwroot/index.html b/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 000000000..cde1f2f90 --- /dev/null +++ b/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/IO.Swagger/wwwroot/swagger-original.json b/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 000000000..97327baee --- /dev/null +++ b/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,3341 @@ +{ + "openapi" : "3.0.3", + "info" : { + "title" : "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + "description" : "An exemplary interface combination for the use case of an Asset Administration Shell Repository", + "termsOfService" : "https://github.com/admin-shell-io/aas-specs", + "contact" : { + "name" : "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche" + }, + "version" : "Final-Draft" + }, + "servers" : [ { + "url" : "/" + } ], + "paths" : { + "/shells" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Asset Administration Shells", + "operationId" : "GetAllAssetAdministrationShells", + "parameters" : [ { + "name" : "assetIds", + "in" : "query", + "description" : "The key-value-pair of an Asset identifier", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "example" : "[{\"key\": \"globalAssetId\",\"value\": \"http://example.company/myAsset\"},{\"key\": \"myOwnInternalAssetId\",\"value\": \"12345ABC\"}]", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + } + }, { + "name" : "idShort", + "in" : "query", + "description" : "The Asset Administration Shell’s IdShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shells", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllAssetAdministrationShells/1/0/RC02", "https://admin-shell.io/aas/API/GetAllAssetAdministrationShellsByAssetId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllAssetAdministrationShellsByIdShort/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Asset Administration Shell", + "operationId" : "PostAssetAdministrationShell", + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Asset Administration Shell created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostAssetAdministrationShell/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific Asset Administration Shell", + "operationId" : "GetAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shell", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetAdministrationShellById/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing Asset Administration Shell", + "operationId" : "PutAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Administration Shell updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetAdministrationShellById/1/0/RC02" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes an Asset Administration Shell", + "operationId" : "DeleteAssetAdministrationShellById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Asset Administration Shell deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteAssetAdministrationShellById/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Asset Administration Shell", + "operationId" : "GetAssetAdministrationShell", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Administration Shell", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetAdministrationShell/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Asset Administration Shell", + "operationId" : "PutAssetAdministrationShell", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + } ], + "requestBody" : { + "description" : "Asset Administration Shell object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Administration Shell updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetAdministrationShell/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/asset-information" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Asset Information", + "operationId" : "GetAssetInformation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Asset Information", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetInformation" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAssetInformation/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Asset Information", + "operationId" : "PutAssetInformation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Asset Information object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetInformation" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Asset Information updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutAssetInformation/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel references", + "operationId" : "GetAllSubmodelReferences", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel references", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelReferences/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a submodel reference at the Asset Administration Shell", + "operationId" : "PostSubmodelReference", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Reference to the Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Reference" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel reference created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelReference/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}" : { + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes the submodel reference from the Asset Administration Shell", + "operationId" : "DeleteSubmodelReferenceById", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel reference deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelReference/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Submodel", + "operationId" : "GetSubmodel", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodel/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Submodel", + "operationId" : "PutSubmodel", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodel/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel elements including their hierarchy", + "operationId" : "GetAllSubmodelElements", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "List of found submodel elements", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelElements/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsByParentPathAndSemanticId/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element", + "operationId" : "PostSubmodelElement", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElement/1/0/RC02c" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific submodel element from the Submodel at a specified path", + "operationId" : "GetSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodelElementByPath/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PutSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel element updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodelElementByPath/1/0/RC02c", "https://admin-shell.io/aas/API/SetSubmodelElementValueByPath/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PostSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElementByPath/1/0/RC02c" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a submodel element at a specified path within the submodel elements hierarchy", + "operationId" : "DeleteSubmodelElementByPath", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel element deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelElementByPath/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke" : { + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Synchronously or asynchronously invokes an Operation at a specified path", + "operationId" : "InvokeOperation", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "async", + "in" : "query", + "description" : "Determines whether an operation invocation is performed asynchronously or synchronously", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Operation request object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/InvokeOperationSync/1/0/RC02", "https://admin-shell.io/aas/API/InvokeOperationAsync/1/0/RC02" ] + } + }, + "/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Operation result of an asynchronous invoked Operation", + "operationId" : "GetOperationAsyncResult", + "parameters" : [ { + "name" : "aasIdentifier", + "in" : "path", + "description" : "The Asset Administration Shell’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "value" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "handleId", + "in" : "path", + "description" : "The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetOperationAsyncResult/1/0/RC02" ] + } + }, + "/submodels" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Submodels", + "operationId" : "GetAllSubmodels", + "parameters" : [ { + "name" : "semanticId", + "in" : "query", + "description" : "The value of the semantic id reference (BASE64-URL-encoded)", + "schema" : { + "type" : "string" + } + }, { + "name" : "idShort", + "in" : "query", + "description" : "The Submodel’s idShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodels", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Submodel" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodels/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelsByIdShort/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Submodel", + "operationId" : "PostSubmodel", + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodel/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Submodel", + "operationId" : "GetSubmodel_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "Requested Submodel", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodel/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates the Submodel", + "operationId" : "PutSubmodel_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Submodel object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Submodel" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodel/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all submodel elements including their hierarchy", + "operationId" : "GetAllSubmodelElements_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "responses" : { + "200" : { + "description" : "List of found submodel elements", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllSubmodelElements/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsBySemanticId/1/0/RC02", "https://admin-shell.io/aas/API/GetAllSubmodelElementsByParentPathAndSemanticId/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element", + "operationId" : "PostSubmodelElement_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElement/1/0/RC02c" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific submodel element from the Submodel at a specified path", + "operationId" : "GetSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetSubmodelElementByPath/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PutSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Submodel element updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutSubmodelElementByPath/1/0/RC02c", "https://admin-shell.io/aas/API/SetSubmodelElementValueByPath/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new submodel element at a specified path within submodel elements hierarchy", + "operationId" : "PostSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "level", + "in" : "query", + "description" : "Determines the structural depth of the respective resource content", + "required" : false, + "schema" : { + "type" : "string", + "default" : "deep", + "enum" : [ "deep", "core" ] + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "extent", + "in" : "query", + "description" : "Determines to which extent the resource is being serialized", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ "withBlobValue", "withoutBlobValue" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Requested submodel element", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Submodel element created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostSubmodelElementByPath/1/0/RC02c" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a submodel element at a specified path within the submodel elements hierarchy", + "operationId" : "DeleteSubmodelElementByPath_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Submodel element deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteSubmodelElementByPath/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/invoke" : { + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Synchronously or asynchronously invokes an Operation at a specified path", + "operationId" : "InvokeOperation_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "async", + "in" : "query", + "description" : "Determines whether an operation invocation is performed asynchronously or synchronously", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "content", + "in" : "query", + "description" : "Determines the request or response kind of the resource", + "required" : false, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "trimmed", "value", "reference", "path" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Operation request object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/InvokeOperationSync/1/0/RC02", "https://admin-shell.io/aas/API/InvokeOperationAsync/1/0/RC02" ] + } + }, + "/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}/operation-results/{handleId}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns the Operation result of an asynchronous invoked Operation", + "operationId" : "GetOperationAsyncResult_SubmodelRepo", + "parameters" : [ { + "name" : "submodelIdentifier", + "in" : "path", + "description" : "The Submodel’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "content", + "in" : "query", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "default" : "normal", + "enum" : [ "normal", "value" ] + } + }, { + "name" : "idShortPath", + "in" : "path", + "description" : "IdShort path to the submodel element (dot-separated), in this case an operation", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "handleId", + "in" : "path", + "description" : "The returned handle id of an operation’s asynchronous invocation used to request the current state of the operation’s execution (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Operation result object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OperationResult" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetOperationAsyncResult/1/0/RC02" ] + } + }, + "/concept-descriptions" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns all Concept Descriptions", + "operationId" : "GetAllConceptDescriptions", + "parameters" : [ { + "name" : "idShort", + "in" : "query", + "description" : "The Concept Description’s IdShort", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "isCaseOf", + "in" : "query", + "description" : "IsCaseOf reference (BASE64-URL-encoded)", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "dataSpecificationRef", + "in" : "query", + "description" : "DataSpecification reference (BASE64-URL-encoded)", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Concept Descriptions", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConceptDescription" + }, + "x-content-type" : "application/json" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetAllConceptDescriptions/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByIdShort/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByIsCaseOf/1/0/RC02", "https://admin-shell.io/aas/API/GetAllConceptDescriptionsByDataSpecificationReference/1/0/RC02" ] + }, + "post" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Creates a new Concept Description", + "operationId" : "PostConceptDescription", + "requestBody" : { + "description" : "Concept Description object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Concept Description created successfully", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PostConceptDescription/1/0/RC02" ] + } + }, + "/concept-descriptions/{cdIdentifier}" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns a specific Concept Description", + "operationId" : "GetConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Requested Concept Description", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GetConceptDescriptionById/1/0/RC02" ] + }, + "put" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Updates an existing Concept Description", + "operationId" : "PutConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Concept Description object", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "Concept Description updated successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/PutConceptDescriptionById/1/0/RC02" ] + }, + "delete" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Deletes a Concept Description", + "operationId" : "DeleteConceptDescriptionById", + "parameters" : [ { + "name" : "cdIdentifier", + "in" : "path", + "description" : "The Concept Description’s unique id (BASE64-URL-encoded)", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "Concept Description deleted successfully" + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/DeleteConceptDescriptionById/1/0/RC02" ] + } + }, + "/serialization" : { + "get" : { + "tags" : [ "Asset Administration Shell Repository" ], + "summary" : "Returns an appropriate serialization based on the specified format (see SerializationFormat)", + "operationId" : "GenerateSerializationByIds", + "parameters" : [ { + "name" : "aasIds", + "in" : "query", + "description" : "The Asset Administration Shells' unique ids (BASE64-URL-encoded)", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, { + "name" : "submodelIds", + "in" : "query", + "description" : "The Submodels' unique ids (BASE64-URL-encoded)", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, { + "name" : "includeConceptDescriptions", + "in" : "query", + "description" : "Include Concept Descriptions?", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : true + } + } ], + "responses" : { + "200" : { + "description" : "Requested serialization based on SerializationFormat", + "content" : { + "application/asset-administration-shell-package+xml" : { + "schema" : { + "type" : "string", + "description" : "AASX package", + "format" : "binary", + "x-content-type" : "application/asset-administration-shell-package+xml" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AssetAdministrationShellEnvironment" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schema/AssetAdministrationShellEnvironment" + } + } + } + } + }, + "x-semanticIds" : [ "https://admin-shell.io/aas/API/GenerateSerializationByIds/1/0/RC02" ] + } + } + }, + "components" : { + "schemas" : { + "IdentifierKeyValuePair" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "required" : [ "key", "subjectId", "value" ], + "properties" : { + "key" : { + "type" : "string" + }, + "subjectId" : { + "$ref" : "#/components/schemas/Reference" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "HasSemantics" : { + "type" : "object", + "properties" : { + "semanticId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "Reference" : { + "type" : "object", + "oneOf" : [ { + "$ref" : "#/components/schemas/GlobalReference" + }, { + "$ref" : "#/components/schemas/ModelReference" + } ] + }, + "GlobalReference" : { + "required" : [ "value" ], + "properties" : { + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Identifier" + } + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/Reference" + } ] + }, + "Identifier" : { + "type" : "string" + }, + "ModelReference" : { + "required" : [ "keys" ], + "properties" : { + "referredSemanticId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "keys" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Key" + } + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/Reference" + } ] + }, + "Key" : { + "required" : [ "type", "value" ], + "type" : "object", + "properties" : { + "type" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/KeyElements" + }, + "value" : { + "type" : "string" + } + } + }, + "KeyElements" : { + "type" : "string", + "enum" : [ "AssetAdministrationShell", "AccessPermissionRule", "ConceptDescription", "Submodel", "AnnotatedRelationshipElement", "BasicEvent", "Blob", "Capability", "DataElement", "File", "Entity", "Event", "MultiLanguageProperty", "Operation", "Property", "Range", "ReferenceElement", "RelationshipElement", "SubmodelElement", "SubmodelElementList", "SubmodelElementStruct", "View", "FragmentReference" ] + }, + "AssetAdministrationShell" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "required" : [ "assetInformation" ], + "properties" : { + "assetInformation" : { + "$ref" : "#/components/schemas/AssetInformation" + }, + "derivedFrom" : { + "$ref" : "#/components/schemas/Reference" + }, + "security" : { + "$ref" : "#/components/schemas/Security" + }, + "submodels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "views" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/View" + } + } + } + } ] + }, + "Identifiable" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "required" : [ "identification" ], + "properties" : { + "administration" : { + "$ref" : "#/components/schemas/AdministrativeInformation" + }, + "identification" : { + "$ref" : "#/components/schemas/Identifier" + } + } + } ] + }, + "Referable" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasExtensions" + }, { + "required" : [ "idShort", "modelType" ], + "properties" : { + "category" : { + "type" : "string" + }, + "description" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "displayName" : { + "type" : "string" + }, + "idShort" : { + "type" : "string" + }, + "modelType" : { + "$ref" : "#/components/schemas/ModelType" + } + } + } ] + }, + "HasExtensions" : { + "type" : "object", + "properties" : { + "extensions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Extension" + } + } + } + }, + "Extension" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "refersTo" : { + "$ref" : "#/components/schemas/Reference" + }, + "value" : { + "type" : "string" + }, + "valueType" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "ValueTypeEnum" : { + "type" : "string", + "enum" : [ "anyUri", "base64Binary", "boolean", "date", "dateTime", "dateTimeStamp", "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", "positiveInteger", "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", "negativeInteger", "double", "duration", "dayTimeDuration", "yearMonthDuration", "float", "gDay", "gMonth", "gMonthDay", "gYear", "gYearMonth", "hexBinary", "NOTATION", "QName", "string", "normalizedString", "token", "language", "Name", "NCName", "ENTITY", "ID", "IDREF", "NMTOKEN", "time" ] + }, + "LangString" : { + "required" : [ "language", "text" ], + "type" : "object", + "properties" : { + "language" : { + "type" : "string" + }, + "text" : { + "type" : "string" + } + } + }, + "ModelType" : { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "name" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ModelTypes" + } + } + }, + "ModelTypes" : { + "type" : "string", + "enum" : [ "AssetAdministrationShell", "ConceptDescription", "Submodel", "AnnotatedRelationshipElement", "BasicEvent", "Blob", "Capability", "DataElement", "File", "Entity", "Event", "ModelReference", "MultiLanguageProperty", "Operation", "Property", "Range", "ReferenceElement", "RelationshipElement", "SubmodelElement", "SubmodelElementList", "SubmodelElementStruct", "View", "GlobalReference", "FragmentReference", "Constraint", "Formula", "Qualifier" ] + }, + "AdministrativeInformation" : { + "type" : "object", + "properties" : { + "revision" : { + "type" : "string" + }, + "version" : { + "type" : "string" + } + } + }, + "HasDataSpecification" : { + "type" : "object", + "properties" : { + "embeddedDataSpecifications" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/EmbeddedDataSpecification" + } + } + } + }, + "EmbeddedDataSpecification" : { + "required" : [ "dataSpecification", "dataSpecificationContent" ], + "type" : "object", + "properties" : { + "dataSpecification" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "dataSpecificationContent" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/DataSpecificationContent" + } + } + }, + "DataSpecificationContent" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/DataSpecificationIEC61360Content" + }, { + "$ref" : "#/components/schemas/DataSpecificationPhysicalUnitContent" + } ] + }, + "DataSpecificationIEC61360Content" : { + "allOf" : [ { + "$ref" : "#/components/schemas/ValueObject" + }, { + "required" : [ "preferredName" ], + "type" : "object", + "properties" : { + "dataType" : { + "type" : "string", + "enum" : [ "DATE", "STRING", "STRING_TRANSLATABLE", "REAL_MEASURE", "REAL_COUNT", "REAL_CURRENCY", "BOOLEAN", "URL", "RATIONAL", "RATIONAL_MEASURE", "TIME", "TIMESTAMP", "INTEGER_COUNT", "INTEGER_MEASURE", "INTEGER_CURRENCY" ] + }, + "definition" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "levelType" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LevelType" + } + }, + "preferredName" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "shortName" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "sourceOfDefinition" : { + "type" : "string" + }, + "symbol" : { + "type" : "string" + }, + "unit" : { + "type" : "string" + }, + "unitId" : { + "$ref" : "#/components/schemas/Reference" + }, + "valueFormat" : { + "type" : "string" + }, + "valueList" : { + "$ref" : "#/components/schemas/ValueList" + } + } + } ] + }, + "ValueObject" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "string" + }, + "valueId" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "valueType" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ValueTypeEnum" + } + } + }, + "LevelType" : { + "type" : "string", + "enum" : [ "Min", "Max", "Nom", "Typ" ] + }, + "ValueList" : { + "required" : [ "valueReferencePairTypes" ], + "type" : "object", + "properties" : { + "valueReferencePairTypes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueReferencePairType" + } + } + } + }, + "ValueReferencePairType" : { + "allOf" : [ { + "$ref" : "#/components/schemas/ValueObject" + } ] + }, + "DataSpecificationPhysicalUnitContent" : { + "required" : [ "definition", "unitName", "unitSymbol" ], + "type" : "object", + "properties" : { + "conversionFactor" : { + "type" : "string" + }, + "definition" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "dinNotation" : { + "type" : "string" + }, + "eceCode" : { + "type" : "string" + }, + "eceName" : { + "type" : "string" + }, + "nistName" : { + "type" : "string" + }, + "registrationAuthorityId" : { + "type" : "string" + }, + "siName" : { + "type" : "string" + }, + "siNotation" : { + "type" : "string" + }, + "sourceOfDefinition" : { + "type" : "string" + }, + "supplier" : { + "type" : "string" + }, + "unitName" : { + "type" : "string" + }, + "unitSymbol" : { + "type" : "string" + } + } + }, + "AssetInformation" : { + "allOf" : [ { + "required" : [ "assetKind" ], + "properties" : { + "assetKind" : { + "$ref" : "#/components/schemas/AssetKind" + }, + "billOfMaterial" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "globalAssetId" : { + "$ref" : "#/components/schemas/Reference" + }, + "specificAssetIds" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + }, + "thumbnail" : { + "$ref" : "#/components/schemas/File" + } + } + } ] + }, + "AssetKind" : { + "type" : "string", + "enum" : [ "Type", "Instance" ] + }, + "File" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "mimeType" ], + "properties" : { + "mimeType" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "SubmodelElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "properties" : { + "kind" : { + "$ref" : "#/components/schemas/ModelingKind" + } + } + } ], + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/Capability" + }, { + "$ref" : "#/components/schemas/Entity" + }, { + "$ref" : "#/components/schemas/Event" + }, { + "$ref" : "#/components/schemas/BasicEvent" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Operation" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + }, { + "$ref" : "#/components/schemas/AnnotatedRelationshipElement" + }, { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "$ref" : "#/components/schemas/SubmodelElementList" + }, { + "$ref" : "#/components/schemas/SubmodelElementStruct" + } ] + }, + "Qualifiable" : { + "type" : "object", + "properties" : { + "qualifiers" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Constraint" + } + } + } + }, + "Constraint" : { + "required" : [ "modelType" ], + "properties" : { + "modelType" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ModelType" + } + }, + "oneOf" : [ { + "$ref" : "#/components/schemas/Qualifier" + }, { + "$ref" : "#/components/schemas/Formula" + } ] + }, + "Qualifier" : { + "allOf" : [ { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "$ref" : "#/components/schemas/ValueObject" + }, { + "required" : [ "type" ], + "properties" : { + "type" : { + "type" : "string" + } + } + } ] + }, + "Formula" : { + "allOf" : [ { + "properties" : { + "dependsOn" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "ModelingKind" : { + "type" : "string", + "enum" : [ "Template", "Instance" ] + }, + "Blob" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "mimeType" ], + "properties" : { + "mimeType" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + } ] + }, + "Capability" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "Entity" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "entityType" ], + "properties" : { + "entityType" : { + "$ref" : "#/components/schemas/EntityType" + }, + "globalAssetId" : { + "$ref" : "#/components/schemas/Reference" + }, + "specificAssetIds" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/IdentifierKeyValuePair" + } + }, + "statements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } ] + }, + "EntityType" : { + "type" : "string", + "enum" : [ "CoManagedEntity", "SelfManagedEntity" ] + }, + "Event" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "BasicEvent" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Event" + }, { + "required" : [ "observed" ], + "properties" : { + "observed" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "MultiLanguageProperty" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LangString" + } + }, + "valueId" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "Operation" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "inoutputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "inputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "outputVariable" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + } + } + } ] + }, + "OperationVariable" : { + "required" : [ "value" ], + "type" : "object", + "properties" : { + "value" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/Capability" + }, { + "$ref" : "#/components/schemas/Entity" + }, { + "$ref" : "#/components/schemas/Event" + }, { + "$ref" : "#/components/schemas/BasicEvent" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Operation" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + }, { + "$ref" : "#/components/schemas/AnnotatedRelationshipElement" + }, { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "$ref" : "#/components/schemas/SubmodelElementList" + }, { + "$ref" : "#/components/schemas/SubmodelElementStruct" + } ] + } + }, + "example" : { + "value" : "" + } + }, + "Property" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "$ref" : "#/components/schemas/ValueObject" + } ] + }, + "Range" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "valueType" ], + "properties" : { + "max" : { + "type" : "string" + }, + "min" : { + "type" : "string" + }, + "valueType" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "ReferenceElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "value" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "AnnotatedRelationshipElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/RelationshipElement" + }, { + "properties" : { + "annotation" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DataElement" + } + } + } + } ] + }, + "RelationshipElement" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "required" : [ "first", "second" ], + "properties" : { + "first" : { + "$ref" : "#/components/schemas/Reference" + }, + "second" : { + "$ref" : "#/components/schemas/Reference" + } + } + } ] + }, + "DataElement" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/Blob" + }, { + "$ref" : "#/components/schemas/File" + }, { + "$ref" : "#/components/schemas/MultiLanguageProperty" + }, { + "$ref" : "#/components/schemas/Property" + }, { + "$ref" : "#/components/schemas/Range" + }, { + "$ref" : "#/components/schemas/ReferenceElement" + } ] + }, + "SubmodelElementList" : { + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + }, { + "properties" : { + "semanticIdValues" : { + "$ref" : "#/components/schemas/Reference" + }, + "submodelElementTypeValues" : { + "$ref" : "#/components/schemas/ModelType" + }, + "value" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + }, + "valueTypeValues" : { + "$ref" : "#/components/schemas/ValueTypeEnum" + } + } + } ] + }, + "SubmodelElementStruct" : { + "properties" : { + "value" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/SubmodelElement" + } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/SubmodelElement" + } ] + }, + "Security" : { + "required" : [ "accessControlPolicyPoints" ], + "type" : "object", + "properties" : { + "accessControlPolicyPoints" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/AccessControlPolicyPoints" + }, + "certificate" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Certificate" + } + }, + "requiredCertificateExtension" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "AccessControlPolicyPoints" : { + "required" : [ "policyAdministrationPoint", "policyDecisionPoint", "policyEnforcementPoint" ], + "type" : "object", + "properties" : { + "policyAdministrationPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyAdministrationPoint" + }, + "policyDecisionPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyDecisionPoint" + }, + "policyEnforcementPoint" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyEnforcementPoint" + }, + "policyInformationPoints" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/PolicyInformationPoints" + } + } + }, + "PolicyAdministrationPoint" : { + "required" : [ "externalAccessControl" ], + "type" : "object", + "properties" : { + "externalAccessControl" : { + "type" : "boolean" + }, + "localAccessControl" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/AccessControl" + } + } + }, + "AccessControl" : { + "type" : "object", + "properties" : { + "accessPermissionRule" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AccessPermissionRule" + } + }, + "defaultEnvironmentAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "defaultPermissions" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "defaultSubjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectableEnvironmentAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectablePermissions" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "selectableSubjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "AccessPermissionRule" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "required" : [ "targetSubjectAttributes" ], + "properties" : { + "permissionsPerObject" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PermissionsPerObject" + } + }, + "targetSubjectAttributes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubjectAttributes" + } + } + } + } ] + }, + "PermissionsPerObject" : { + "type" : "object", + "properties" : { + "object" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + }, + "permission" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Permission" + } + }, + "targetObjectAttributes" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/ObjectAttributes" + } + } + }, + "Permission" : { + "required" : [ "kindOfPermission", "permission" ], + "type" : "object", + "properties" : { + "kindOfPermission" : { + "type" : "string", + "enum" : [ "Allow", "Deny", "NotApplicable", "Undefined" ] + }, + "permission" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Reference" + } + } + }, + "ObjectAttributes" : { + "type" : "object", + "properties" : { + "objectAttribute" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Property" + } + } + } + }, + "SubjectAttributes" : { + "type" : "object", + "properties" : { + "subjectAttributes" : { + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "PolicyDecisionPoint" : { + "required" : [ "externalPolicyDecisionPoints" ], + "type" : "object", + "properties" : { + "externalPolicyDecisionPoints" : { + "type" : "boolean" + } + } + }, + "PolicyEnforcementPoint" : { + "required" : [ "externalPolicyEnforcementPoint" ], + "type" : "object", + "properties" : { + "externalPolicyEnforcementPoint" : { + "type" : "boolean" + } + } + }, + "PolicyInformationPoints" : { + "required" : [ "externalInformationPoint" ], + "type" : "object", + "properties" : { + "externalInformationPoint" : { + "type" : "boolean" + }, + "internalInformationPoint" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + }, + "Certificate" : { + "type" : "object", + "oneOf" : [ { + "$ref" : "#/components/schemas/BlobCertificate" + } ] + }, + "BlobCertificate" : { + "properties" : { + "blobCertificate" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Blob" + }, + "containedExtension" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + }, + "lastCertificate" : { + "type" : "boolean" + } + } + }, + "View" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Referable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "properties" : { + "containedElements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "Submodel" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "$ref" : "#/components/schemas/Qualifiable" + }, { + "$ref" : "#/components/schemas/HasSemantics" + }, { + "properties" : { + "kind" : { + "$ref" : "#/components/schemas/ModelingKind" + }, + "submodelElements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SubmodelElement" + } + } + } + } ] + }, + "OperationRequest" : { + "type" : "object", + "properties" : { + "inoutputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "inputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "requestId" : { + "type" : "string" + }, + "timeout" : { + "type" : "integer" + } + } + }, + "OperationResult" : { + "type" : "object", + "properties" : { + "executionResult" : { + "$ref" : "https://api.swaggerhub.com/domains/Plattform_i40/Shared-Domain-Models/Final-Draft#/components/schemas/Result" + }, + "executionState" : { + "type" : "string", + "enum" : [ "Initiated", "Running", "Completed", "Canceled", "Failed", "Timeout" ] + }, + "inoutputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "outputArguments" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/OperationVariable" + } + }, + "requestId" : { + "type" : "string" + } + }, + "example" : { + "outputArguments" : [ null, null ], + "requestId" : "requestId", + "executionResult" : "{}", + "executionState" : "Initiated", + "inoutputArguments" : [ { + "value" : "" + }, { + "value" : "" + } ] + } + }, + "Result" : { + "type" : "object", + "properties" : { + "messages" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Message" + } + }, + "success" : { + "type" : "boolean" + } + } + }, + "Message" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "string" + }, + "messageType" : { + "type" : "string", + "enum" : [ "Undefined", "Info", "Warning", "Error", "Exception" ] + }, + "text" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string" + } + } + }, + "ConceptDescription" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Identifiable" + }, { + "$ref" : "#/components/schemas/HasDataSpecification" + }, { + "properties" : { + "isCaseOf" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Reference" + } + } + } + } ] + }, + "AssetAdministrationShellEnvironment" : { + "type" : "object", + "properties" : { + "assetAdministrationShells" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssetAdministrationShell" + } + }, + "conceptDescriptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConceptDescription" + } + }, + "submodels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Submodel" + } + } + } + } + } + } +} diff --git a/src/IO.Swagger/wwwroot/web.config b/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 000000000..e70a7778d --- /dev/null +++ b/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + From 7ceac1c95e3b80e6f311b1079c97c2d7161288d3 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Fri, 21 Jan 2022 12:27:03 +0100 Subject: [PATCH 19/53] Changed the formatting --- .../aasxs/Example_AAS_ServoDCMotor_21.aasx | Bin 203968 -> 204115 bytes .../Attributes/ValidateModelStateAttribute.cs | 6 +- .../AssetAdministrationShellRepositoryApi.cs | 393 +++++++++------ src/IO.Swagger/Filters/BasePathFilter.cs | 5 +- .../GeneratePathParamsValidationFilter.cs | 4 +- src/IO.Swagger/Helpers/AASHelper.cs | 208 ++++++-- .../Helpers/IdentifierKeyValuePair_V2.cs | 4 - .../Helpers/OutputModifierContractResolver.cs | 47 +- src/IO.Swagger/Models/AccessControl.cs | 60 ++- .../Models/AccessControlPolicyPoints.cs | 41 +- src/IO.Swagger/Models/AccessPermissionRule.cs | 37 +- .../Models/AdministrativeInformation.cs | 30 +- .../Models/AnnotatedRelationshipElement.cs | 26 +- .../Models/AssetAdministrationShell.cs | 55 +-- .../AssetAdministrationShellEnvironment.cs | 36 +- src/IO.Swagger/Models/AssetInformation.cs | 18 +- src/IO.Swagger/Models/AssetKind.cs | 41 +- src/IO.Swagger/Models/BasicEvent.cs | 25 +- src/IO.Swagger/Models/Blob.cs | 31 +- src/IO.Swagger/Models/BlobCertificate.cs | 36 +- src/IO.Swagger/Models/Capability.cs | 20 +- src/IO.Swagger/Models/Certificate.cs | 18 +- src/IO.Swagger/Models/ConceptDescription.cs | 32 +- src/IO.Swagger/Models/Constraint.cs | 23 +- src/IO.Swagger/Models/DataElement.cs | 18 +- .../Models/DataSpecificationContent.cs | 18 +- .../DataSpecificationIEC61360Content.cs | 85 ++-- .../DataSpecificationPhysicalUnitContent.cs | 95 ++-- .../Models/EmbeddedDataSpecification.cs | 29 +- src/IO.Swagger/Models/Entity.cs | 43 +- src/IO.Swagger/Models/EntityType.cs | 41 +- src/IO.Swagger/Models/Extension.cs | 43 +- src/IO.Swagger/Models/File.cs | 31 +- src/IO.Swagger/Models/Formula.cs | 18 +- src/IO.Swagger/Models/GlobalReference.cs | 25 +- src/IO.Swagger/Models/HasDataSpecification.cs | 24 +- src/IO.Swagger/Models/HasExtensions.cs | 24 +- src/IO.Swagger/Models/HasSemantics.cs | 24 +- src/IO.Swagger/Models/Identifiable.cs | 31 +- .../Models/IdentifierKeyValuePair.cs | 37 +- src/IO.Swagger/Models/Key.cs | 29 +- src/IO.Swagger/Models/KeyElements.cs | 255 +++++----- src/IO.Swagger/Models/LangString.cs | 29 +- src/IO.Swagger/Models/LevelType.cs | 61 +-- src/IO.Swagger/Models/Message.cs | 45 +- src/IO.Swagger/Models/ModelEvent.cs | 20 +- src/IO.Swagger/Models/ModelReference.cs | 31 +- src/IO.Swagger/Models/ModelType.cs | 23 +- src/IO.Swagger/Models/ModelTypes.cs | 295 ++++++----- src/IO.Swagger/Models/ModelingKind.cs | 41 +- .../Models/MultiLanguageProperty.cs | 32 +- src/IO.Swagger/Models/ObjectAttributes.cs | 24 +- src/IO.Swagger/Models/OneOfCertificate.cs | 18 +- src/IO.Swagger/Models/OneOfConstraint.cs | 18 +- src/IO.Swagger/Models/OneOfDataElement.cs | 18 +- .../Models/OneOfDataSpecificationContent.cs | 18 +- .../Models/OneOfOperationVariableValue.cs | 18 +- src/IO.Swagger/Models/OneOfReference.cs | 18 +- src/IO.Swagger/Models/OneOfSubmodelElement.cs | 18 +- src/IO.Swagger/Models/Operation.cs | 38 +- src/IO.Swagger/Models/OperationHandle.cs | 19 + src/IO.Swagger/Models/OperationRequest.cs | 42 +- src/IO.Swagger/Models/OperationResult.cs | 51 +- src/IO.Swagger/Models/OperationVariable.cs | 23 +- src/IO.Swagger/Models/Permission.cs | 32 +- src/IO.Swagger/Models/PermissionsPerObject.cs | 36 +- .../Models/PolicyAdministrationPoint.cs | 29 +- src/IO.Swagger/Models/PolicyDecisionPoint.cs | 23 +- .../Models/PolicyEnforcementPoint.cs | 23 +- .../Models/PolicyInformationPoints.cs | 29 +- src/IO.Swagger/Models/Property.cs | 38 +- src/IO.Swagger/Models/Qualifiable.cs | 24 +- src/IO.Swagger/Models/Qualifier.cs | 43 +- src/IO.Swagger/Models/Range.cs | 37 +- src/IO.Swagger/Models/Referable.cs | 49 +- src/IO.Swagger/Models/Reference.cs | 18 +- src/IO.Swagger/Models/ReferenceElement.cs | 26 +- src/IO.Swagger/Models/RelationshipElement.cs | 31 +- src/IO.Swagger/Models/Result.cs | 30 +- src/IO.Swagger/Models/Security.cs | 35 +- src/IO.Swagger/Models/SubjectAttributes.cs | 24 +- src/IO.Swagger/Models/Submodel.cs | 50 +- src/IO.Swagger/Models/SubmodelElement.cs | 44 +- src/IO.Swagger/Models/SubmodelElementList.cs | 44 +- .../Models/SubmodelElementStruct.cs | 26 +- src/IO.Swagger/Models/ValueList.cs | 23 +- src/IO.Swagger/Models/ValueObject.cs | 36 +- .../Models/ValueReferencePairType.cs | 20 +- src/IO.Swagger/Models/ValueTypeEnum.cs | 465 +++++++++--------- src/IO.Swagger/Models/View.cs | 38 +- src/IO.Swagger/Program.cs | 2 +- src/IO.Swagger/Startup.cs | 15 +- 92 files changed, 2062 insertions(+), 2194 deletions(-) create mode 100644 src/IO.Swagger/Models/OperationHandle.cs diff --git a/content-for-demo/aasxs/Example_AAS_ServoDCMotor_21.aasx b/content-for-demo/aasxs/Example_AAS_ServoDCMotor_21.aasx index 1651621154988c2ef92db1f03441ef85158ec45d..cb10a77172e368da1206d16409c940d928af16b4 100644 GIT binary patch delta 4384 zcmV+*5#R2>xeU{~43KIQ*NrVy8#vs0Q4jzC2DAVGRsaB(kQW0hmuVRTEPw4?*>d7Y z7JZ+H`G*Ypr8~k#2+ZP&E;@w4)pU6qpgdDOF;S673FKG{ohjKaKlO)9%)InB^i#k2 zPx?zHQwwNEV8DP?6;)v?7iHdi^5nfY7k&T3qo#s;L?|}&_XV+7D*Vv=>tDWykiKL8 zkbVzX2A#g^cFx`xCZ;)kCw~YJ4-ZACXjng{6Qrs|YzQp5CRS=Cp)8aNZjncd14SMx zMT3lma;YQ=|G2#9%M+x*W2{pX>N4_5!6B5>-o#oZ@I3CDD1JxniY^Qpnsz7B%d%oX zlKRC*s(@_$0p2gX%&eJ^W_VM9$r1oZnv^0_;<+$2iQUvb&rR(t3x6`XdE8uB=}!z| zHam|{o2uy2Fb(p(;7!1CwWU_I-Vqxod)U7?{dt6F_kU43tDUyQv)0MUd8vL{ zsUAolXF3$6daG7$Rm-R6;;C3&4@M&?G(?C76Ytb)W0}(uBp6X3cr-j8@JT$Jo`r@e zKg#d%WZp;Q-e{j?CG%N>SLN*lMqEhQ-9U!R1Z*v0@hsqZ8MCF6`GQ_Jt;M?1?7E}T zt&Ts6040nHAAbZq5C%}-J&XrJuxaa>*A+x%f~Ntcx=AY3$9ta~M~UO5)ODT&8Y`${}*d{Zi&E`{8fc7NLK`Ne`N>pvo4Qt*J*QIW=E zlxU^6>Cv7}i7`dQ46<8n8XrPyFkGU z)a*;XhpL5m)0)&CkxrHKr%6ScXP^3m>&s3Le9(qJ`bx!2!7+FUPPS1btq*7)F0S4- zzCJg^GJnID_}ciwI+Lb1*fRi3EIEI77+W{QP%PPOBZ|j*%Eap{deBh&d!^FY1*pvp zjLc~3o|M2DoWh}sfNfL*+olHJcCNnLVFa?KVyIqO+VHJUqnFicZ4al>8?jtDsn+TZ z2EaArEH-uKQUnsS`xyfyPjqH9t8Hk)ZG{h42!H78p?QD)b4{$WpK1qT-aqyX(}{0P z5mK^q(~Z=VE<1xxZwJZg%nbp}-PFWLM3A0Zk|dT(jGh{=O;5{OVbxM;mn|@cvw=Z= zvCx|bSf^yi1`^`gbFFL|U?bIlW@dPmcN$%1hM}^_oOfX(_=*p&`7*=?*;u=EAY&q1 z*nd0%=+Q((hboYr#wLc?{K89q@&4gnEOYlZcGC2BdB^O&mei_M>q*%6XMGjP){mVA zGRaoJ%A$>H|1KG`Z9}$rJ!_4bzbIB6zp}MqW7cmWzLHHD%5Y|=Dw31v$sAi_<_@TVZq{pDcw~O2>xLmK7Y=6iMRcM-`(9z8Yi;RTpJ5y{3vLbkxenmcv z7fKoieAyD_WnYf)=`7$jxwT25eE1*_tfJVIpq?43+cHZzr;4QK@eXrga#?MqpX=b1wJbzwo zam*$}At0Rt!EdQ@>;*IT9k*9dOZA_8<=-T7=knP->}Fj`2^aQ^GiCwvB^1y?3P!rc z9NBN%ox~Lte`j_d*E2Qtzfu!vImDA89xJNdL;FfhecSGG*}N;4#KztN`>i3&qFbaNf9mfTR7Y4% zY4^;H!((hh^_*q?a??IvHh!FKiPu;1U~%4OWQ7zD?L9OlhQosyubHJTfIrXtD1;WFinD6cheRw+vkZp?OU4FK5YtH0-fZUN^&Z9KhN@~j zv@J&ni26%~ll-M)+ZnrN_X>-;v%pjKJ&LzduPe1KI_qB6&2T6)->3Mh`xIB)q__Yu zOXzTsCe!p8tJURrKJJhwqkna0FG8c!YFBILwbn_c-8fA+MVz4Y1*%^F0AKRzTNh6% z^J)I7qV#owTH;El9QXs822P781;lFn`5&JkcUe_0i^U z@PVkSvsW$aHf3TkU%?G}O-bHCWB3;QySnCWiD+LMu--hFmq zM6l-!Nj!=`kiwS~qc$7QLb>>OaujVmIp(Cx4+WnNf_WmSOnZY}zola{p<#waWOO}h zqY-AAxX}LD?Oy}2S`|-^MZT@0^e^`f(X25Qa>?1lv~xA+4u3v7MQ0D=3M5sRB%5}p z&^%{kiGZamV2li+=!pGxiS#i7_x$Fa=RXKgFao!TJRn`+8?O}B_zAc{gc>^1!H`ve zHH{VP>LY__wvv&4WEZ<<#h_{;(|!X~Dd=E*f|v}S9x%T;Q3oxgTjmoYx}C+@*8`wM z$H-*=%M%kkAb-Lz3+|w<7c*%vK@bl9vj8$7XB6b|5RZ+PEx6Dua};gv`G#(Nj11ZV z(xxg8x<-?{KF9mTu|9EvOhUZ7h(X+WHHkY{V%Dy5%cqzu5!#m?ym`rn__s{Fd{gx{ zsW(2~j6C~;Uia$5h8UIe9>QbRYZWtw1Kwq3ceWO&ZhvVSH^p)u%Xw^x!x?L*rnIvU zZ<(rQg4i5iZHI@LrKKRtWK0CQZJ;0mKJu<1fOW=Cy7&8xnR44I=cHv1-fV@H{I7rG zyyS>tYs~az(37tE7t+89iEV_YE--gMxwA>91j-XQoIL-gkGTN_cn5UwWD(%9auMVt zm6O!!r+=un!dD3`*%Ru@%uR)6u(!bLZt4I{qk^D4LTQ%zoaD3~tciLfT0J29@FUXg zGnIC@kJ*MGRue^V&eMZwjGuMJ+Tga`1$@*1&7u?({D;{Jb{G)pJc#GS@^Vu%XYnPE z46cp2Gn~jfG_K~OeT;_W`8P|RI6Xw2lp|>60#Nc+2F$V>04el(Ncm?A{2M7qn~Bni zMewyQ-+i+*Sk~3hthN*Lj=+GNT)4XhK*@w3MBJ zj**JFX3RX&5gPdWI03AaLesA_*c5jP;eXd27Kw5Tc;3U61J8YX<>@tJ6&X9R2c~g{ z)2*|p#|>iaqhl`&%)kO%k>>=t??&=EIWpzSqV*AE{Ea||$c%3HR;EQ(9;vTLidovf zZ`&REp-m11*isI<068hHCyi5GZ;&c4bj>YLECsL)5I|E+t%jBDIK){yU?*EAj**rcL_{qZ_E>fj^(Q z1+?csD0QAYTcUuc|0j&d5E4LHQW5a=_lT4Lb9GhKbmELy*AbaObvO$yYRu3>^O|SP zpg8Va5aV2uvtrJQk^3b#Oohu`!1yNF(JzE8@Zx!QV?L-IqT}{0c1~$4QGZ$kghAl> zH;w_ufMyX~p`p9PZ46aBh72$60q&djxga^!&6Y|Yn5}8AlJKW|WkesNv0X#HERs98 zA(qSbk>}t+?wj8AO{d3iMF>33#*676RZb%}TUD5v(K|_as<(b9gcAt5$2_I!F6hsG z4+=e@_T8h^j9jCjLQ{i}%zthoXz~Oni(-jM^&q{#K~e<7g$bYzPSzTkjOSy{)J;)f zigD_*e^1C4cLN?E0 zOXRiLlfDMOvc>`DUZac{-pzS1NORlTa25H;>;`u|E%++@24|$;SJ?N)+|F!IyL@iC z(%lx1UunBb;$@M4e}BBPNfPgMq>BwQI9F>dPijb>K%Id}bu}JgNg3*33MmC_R6x^C zPzb(9fKK3O(Y0M^uFePY{QL9&Sc|+yFrURYyHI<2(G2eS9J!MV^-V6&ae1VnJ)6)6 zd$%tfI<5@AkSgczO?d^|bqQ9w!~D>AnGYE0&a`ZlztCpqWPc#ZCjTJOMy>W`LO3Bv zts{t&y9Qfu4J7j}h{+XvfkM;q1~A!Yn>&v^&2p`2$Juu5`;|Udus74o8l&uk>>j~l zZhon`AM@3K-LbUY$#t=9&FyNme#_b;YQS@eOKu{`b0;B~)1AAL*HAoWm1WK3j>Z_7oGY&7c3h;xVR z3k)-3G;)}UFdz5`oD-xecP{UP{blS>g*nOWILRa>@@BZ(9Uw*eee?fNO9KQH00ICA z061y)PJ^HjhoBGvhoBGwx1bOMeFzTMjV)9gINW+s5C8xMw3jOx1Gobv5dfEv7XvYq z;1D{OQ5pj(0)rBleHsH{0koIj8Ut(r#+OVR133Z>PM3!p13v;vPnXCW12+OQQI`Q6 a14IJ`7z3A(7XxCKsvH9l24)!p0001k+FrB( delta 4227 zcmV-}5Pa{`x(vX%43KIOV1f`&9@&$Wz7GHZq^x;*r*^Si4!%r-0FCVe@R%GIDbVrAhMxm|6O{`jf?{EmEO!n4U!WV3pcv^4B^-`rNRZq9De{u2)NYU-1d|p1QOXq*})66@Z-BsZ?5v+6g+;@Mnyi)m-}Dff$mHRyjov7)390IjJJ9mXipO7YXDhht=! zBVyTMHjdzR8WmBrE`ZrtB1{wH^2B+3B+EDDN(IE3pqUbcIzzN`2zZ8=h2(pzIfVD3 z#@rd{RW^B=RHSzPsnfl=YPQjPz4xO~DnXM`nwHAAT*U??b^|MJE=ymN~Q8{tI?0r@yThaT&V&8myEO6)Uitu zO3dzObcr%Fz-ZPQ*v9J$A1)Bk*(~$^;^%*|RDxgS{W0$!+otWsH%5f0*}3VX+?KDJ z-DZ1T13I zAoXOZHwa*T&BS(QcpYyvy3S2g17*&;uo8U5hu4G*u|YOyw}BLDDGs&YAo6Gv%fNpc zQoP0{hSpIk5QK1o7M4O> z`!~s$ZJ3I~>se~d{6(?q_?4~2jakw7+hm(ElHuIcG@>NYQy`-ofDnv`G2p>utYxO? z_^G^R(sS{^_ki51^te(fx;W@**tUPALesDx9IIcrxwEBeK~W0UMoMSC8X{m+VU_Qiw#cxs)WW?kdU7rI!LV;uu z37O_otA|%MA2w!>il7v3`FmggU#g z_${6s1#!=9$L%%NQ~f8gAv=KFNq2VuyIGe~qJ;zF3@l*2go5fsrNnT+k^Q#OOk7bB zd%yX(9?QM+mDxn!BZ$ZLds$I74bcS@N|El_Z`Zqd(y<7ZX}+&)Yf(lyh3#ap?^C7)R!8_U=e%a zOL5!L)?)V(M#I5_orAA$3*UNY7z^QU?f{AxqFZ7ded=r&RQps*Y4_NTqXTMV?E*4? z`PjIaH-4OLiC1j=mf*Yt+(Xm=?QJr$2n*K73c{dmIqr3;djQ9ykrsbAwj;IgyY%Y6QH^ZUK!#>4V-KV(VCdC{gXPL5aE;q5K4x?0$=IL{&W#WvWa zDP^Mfh^m5-9Gy4OsUJ7DVs-Y68xu0>a&g8)u9cZ;MwjR#jaz?p(@DXtHSzN)b}o4j zXLQ#SVl)HrfgMYWQ#pfnMaL?54wHb75ZJjq3_3jp$N3n?7SAJ~E+#RlxMNT|t#;F~ z6mrvVkUoW+u^W5GnWuL5Hk!HGKUh%q4Op5GSm{D*~9O3*E_9*Cjx z#bOouGDIJV#Y}@3s0S5LU58>VqioRc|o z5;}m<)F^Ny3a)UubA`tYN7qyCZJFxn?lWQPR?MZ7TiVvh1KI5p*^NcNO2$jcyl!Fw z<4q-w4b*>xS`DOvU;TlP0729M!ZL!t$5eGN*Rt=sT?%tMQM* ztSLMbdE1t%i1A+m(>L|YwI`pw%6o?P#4i%w*Z zg@xR)4!aBos^pG4%;gm`np@FchzXc_*3B zpTGY1GyHROb#(|N4BmCJ&bPSQ%0R7CVy!n0Rq9{|l1a_u zW-uCet_eukI?!bJLaY^Y<9t_4Z7p3Moa}iRQxyAabLB;A4Q{I&>*KaE_0F!V(^Q8n zm>bW(@yP+KXy?&2>G@0QW>0^k0}K<%Ki2-SaZ!-H>c)#P4`7hG>oEK&UwbhIWZ>3t zSa_N9GnHPIJtdd+!$B$sCSY-HwhqFR_N%asT$Dx=!}u^QpaBCBvcl7Gu*vErAL3DZb5l)ySe`Yu)ntmH+pO|B9=~}W&E@2Veq2|Y7f!FkSarW z8=vkq&q94jOjpW(+}>u-qQR|3Qm_Mu7Jt=r-mmH{Iku)Ei&5F+sIq z&v}x2t}bH_?mlJQ^PD1n;n%imk7ZK-I^CfKub@4|gtj~;G{=;e?`+4Nr!VxdIGxFg z%|ElTCLb$0ljeU6YaM*B?f1cC`z{RL1)Q#2&2zh`wYAR8Quq6= zX{{na;JkdkWN#?#w#n`HJbYC>+t=WJ23fwR5is|nE(Pt)di!3m^|@(k&~=WF^+%GV zWA4r$xOq3Yd7jB@+1_=L&wmUxC-|z_LN0?3U{`Lh6-R&D*3CdaI}GbUoPD5ZenH2* zusO&V4z_H5dAp-~w|8_LWeBF$osKoWX5sJY>5&0UlP7-kMRwQ&n9)4#&g6B!K(rl4 z*Rl1L-x6?-EowT1PafHml)euD0Hm&$z8M3!0+JAuK@n`1mF9Rm;s(-;E)001s>Kk)zn diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs index 07cfabe83..604012536 100644 --- a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -1,9 +1,9 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; +using System.ComponentModel.DataAnnotations; +using System.Reflection; namespace IO.Swagger.Attributes { @@ -26,7 +26,7 @@ public override void OnActionExecuting(ActionExecutingContext context) { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 1d3cd1796..a78908d31 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -7,23 +7,20 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; +using AdminShellNS; using IO.Swagger.Attributes; - -using Microsoft.AspNetCore.Authorization; -using IO.Swagger.Models; using IO.Swagger.Helpers; -using AdminShellNS; +using IO.Swagger.Models; +using Microsoft.AspNetCore.Mvc; using Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; +using Swashbuckle.AspNetCore.Annotations; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; namespace IO.Swagger.Controllers -{ +{ /// /// /// @@ -48,10 +45,10 @@ public AssetAdministrationShellRepositoryApiController() [Route("/shells/{aasIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteAssetAdministrationShellById")] - public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -69,7 +66,7 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ [Route("/concept-descriptions/{cdIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteConceptDescriptionById")] - public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]string cdIdentifier) + public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] string cdIdentifier) { bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); if (deleted) @@ -92,7 +89,7 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required]s [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelElementByPath")] - public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -115,7 +112,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]st } var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -134,7 +131,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required]st [Route("/submodels/{submodelIdentifier}/submodel/submodel-elements/{idShortPath}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] - public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath) + public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); //Check if submodel exists @@ -151,7 +148,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] } var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if(deleted) + if (deleted) { AasxServer.Program.signalNewData(2); return NoContent(); @@ -170,7 +167,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] [Route("/shells/{aasIdentifier}/aas/submodels/{submodelIdentifier}")] [ValidateModelState] [SwaggerOperation("DeleteSubmodelReferenceById")] - public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier) + public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier) { aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); @@ -197,16 +194,16 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required]st [ValidateModelState] [SwaggerOperation("GenerateSerializationByIds")] [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] - public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]List aasIds, [FromQuery][Required()]List submodelIds, [FromQuery][Required()]bool? includeConceptDescriptions) - { + public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(byte[])); string exampleJson = null; exampleJson = "\"\""; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(byte[]); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(byte[]); //TODO: Change the data returned return new ObjectResult(example); } @@ -222,7 +219,7 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()]L [SwaggerOperation("GetAllAssetAdministrationShells")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Asset Administration Shells")] //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) - public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string assetIds, [FromQuery]string idShort) + public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string assetIds, [FromQuery] string idShort) { //TODO: Consider a case where both assetIds and idShort are present. var aasList = new List(); @@ -267,10 +264,10 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]string a [ValidateModelState] [SwaggerOperation("GetAllConceptDescriptions")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] - public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort, [FromQuery]string isCaseOf, [FromQuery]string dataSpecificationRef) - { + public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShort, [FromQuery] string isCaseOf, [FromQuery] string dataSpecificationRef) + { //Return all the concept-descriptions from the server, NO Filter - if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef) ) + if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef)) { var cdList = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) @@ -285,13 +282,13 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort } //CDs filtered with idShort - if(!string.IsNullOrEmpty(idShort)) + if (!string.IsNullOrEmpty(idShort)) { return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); } //CDs filtered with isCaseOfReference - if(!string.IsNullOrEmpty(isCaseOf)) + if (!string.IsNullOrEmpty(isCaseOf)) { var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); @@ -324,13 +321,13 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery]string idShort [ValidateModelState] [SwaggerOperation("GetAllSubmodelElements")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] - public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { // access AAS and Submodel var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found."); } @@ -341,11 +338,6 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string submodelElements.Add(smeWrapper.submodelElement); } - if(string.IsNullOrEmpty(level) && string.IsNullOrEmpty(content) && string.IsNullOrEmpty(extent)) - { - return new ObjectResult(submodelElements); - } - var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); return new ObjectResult(json); @@ -364,7 +356,7 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("GetAllSubmodelElementsSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] - public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel != null) @@ -392,10 +384,10 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ [ValidateModelState] [SwaggerOperation("GetAllSubmodelReferences")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] - public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] string aasIdentifier) { var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { return new ObjectResult(aasReturn.AAS.submodelRefs); } @@ -417,10 +409,10 @@ public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required]strin [ValidateModelState] [SwaggerOperation("GetAllSubmodels")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] - public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [FromQuery]string idShort) - { + public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [FromQuery] string idShort) + { //Fetch all the submodels from the server - if(string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) { var submodelList = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) @@ -434,7 +426,7 @@ public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [From return new ObjectResult(submodelList); } - if(!string.IsNullOrEmpty(idShort)) + if (!string.IsNullOrEmpty(idShort)) { return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); } @@ -460,13 +452,21 @@ public virtual IActionResult GetAllSubmodels([FromQuery]string semanticId, [From [ValidateModelState] [SwaggerOperation("GetAssetAdministrationShell")] [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] - public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] string aasIdentifier, [FromQuery] string content) { //TODO: Content ?? var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { - return new ObjectResult(aasReturn.AAS); + //If content is empty or Normal, return the object as it is + if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasReturn.AAS); + } + else if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); + } } return NotFound(); @@ -482,7 +482,7 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required]st [ValidateModelState] [SwaggerOperation("GetAssetAdministrationShellById")] [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] - public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS != null) @@ -503,15 +503,15 @@ public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Require [ValidateModelState] [SwaggerOperation("GetAssetInformation")] [SwaggerResponse(statusCode: 200, type: typeof(AssetInformation), description: "Requested Asset Information")] - public virtual IActionResult GetAssetInformation([FromRoute][Required]string aasIdentifier) + public virtual IActionResult GetAssetInformation([FromRoute][Required] string aasIdentifier) { //TODO:Change to AssetInformation in V3 //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); - if(asset != null) + if (asset != null) { return new ObjectResult(asset); } @@ -531,10 +531,10 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required]string aas [ValidateModelState] [SwaggerOperation("GetConceptDescriptionById")] [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] - public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]string cdIdentifier) + public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] string cdIdentifier) { var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); - if(conceptDescription != null) + if (conceptDescription != null) { return new ObjectResult(conceptDescription); } @@ -556,16 +556,16 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required]stri [ValidateModelState] [SwaggerOperation("GetOperationAsyncResult")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) - { + public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(OperationResult)); string exampleJson = null; exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned return new ObjectResult(example); } @@ -582,16 +582,16 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("GetOperationAsyncResultSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromRoute][Required]string handleId, [FromQuery]string content) - { + public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) + { //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(OperationResult)); string exampleJson = null; exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(OperationResult); //TODO: Change the data returned return new ObjectResult(example); } @@ -609,17 +609,23 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req [ValidateModelState] [SwaggerOperation("GetSubmodel")] [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] - public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider other parameters súch as level, content, & extent var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel != null) + if (submodel == null) { - return new ObjectResult(submodel); + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); } - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Either AAS or Submodel not found"); } /// @@ -637,7 +643,7 @@ public virtual IActionResult GetSubmodel([FromRoute][Required]string aasIdentifi [ValidateModelState] [SwaggerOperation("GetSubmodelElementByPath")] [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] - public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -654,12 +660,18 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]strin } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if(submodelElement != null) + if (submodelElement == null) { - return new ObjectResult(submodelElement); + return NotFound($"Requested submodel element not found."); } - return NotFound($"Requested submodel element not found."); + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); } /// @@ -676,7 +688,7 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required]strin [ValidateModelState] [SwaggerOperation("GetSubmodelElementByPathSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] - public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: support for Content, extent and level @@ -688,12 +700,18 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement != null) + if (submodelElement == null) { - return new ObjectResult(submodelElement); + return NotFound($"Requested submodel element not found."); } - return NotFound($"Requested submodel element not found."); + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); } /// @@ -709,16 +727,22 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re [ValidateModelState] [SwaggerOperation("GetSubmodelSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] - public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider rest of the parameters i.e., level, content & extent var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel != null) + if (submodel == null) + { + return NotFound($"The Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) { - return new ObjectResult(submodel); + return new ObjectResult(json); } - return NotFound($"Submodel not found."); + return NotFound($"Submodel not found"); } /// @@ -736,32 +760,55 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required]string [ValidateModelState] [SwaggerOperation("InvokeOperation")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) + public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { //Check if aas exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found."); } //Find the operation from the idShortpath var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if(submodelElement == null) + if (submodelElement == null) { return NotFound($"Operation {idShortPath} not found."); } - var output = aasHelper.InvokeOperation(submodelElement); + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } - return NoContent(); + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } /// @@ -778,17 +825,48 @@ public virtual IActionResult InvokeOperation([FromBody]OperationRequest body, [F [ValidateModelState] [SwaggerOperation("InvokeOperationSubmodelRepo")] [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] - public virtual IActionResult InvokeOperationSubmodelRepo([FromBody]OperationRequest body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]bool? _async, [FromQuery]string content) - { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationRequest body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } + + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } /// @@ -811,13 +889,13 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV //Check if already exists var aasReturn = aasHelper.FindAas(body.idShort); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { return Conflict($"Asset Administration Shell {body.idShort} already exists."); } bool added = aasHelper.AddAas(body); - if(added) + if (added) { AasxServer.Program.signalNewData(2); return Created($"Asset Administration Shell {body.idShort} created successfully.", body); @@ -873,7 +951,7 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con [SwaggerOperation("PostSubmodel")] [SwaggerResponse(statusCode: 201, type: typeof(Submodel), description: "Submodel created successfully")] //public virtual IActionResult PostSubmodel([FromBody]Submodel body) - public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) + public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -913,33 +991,33 @@ public virtual IActionResult PostSubmodel([FromBody]AdminShellV20.Submodel body) [SwaggerOperation("PostSubmodelElement")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider rest of the parameters, i.e., level, content & extent //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if(submodel == null) + if (submodel == null) { return NotFound($"Submodel not found"); } //Check for idShort in SubmodelElement - if(string.IsNullOrEmpty(body.idShort)) + if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"No IdShort found in the submodel element"); } //Check if submodel element already exists in the submodel var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if(submodelElement != null) + if (submodelElement != null) { return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); } @@ -948,7 +1026,8 @@ public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.Submode if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel Element {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -971,7 +1050,7 @@ public virtual IActionResult PostSubmodelElement([FromBody]AdminShellV20.Submode [SwaggerOperation("PostSubmodelElementByPath")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -994,25 +1073,27 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.S return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); } - if(string.IsNullOrEmpty(body.idShort)) + if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"IdShort is not set in the submodel element."); } //Check if requested submodel element already exists in the parent SME - if(parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if(existingSME != null) + if (existingSME != null) { return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); } } bool added = aasHelper.AddSubmodelElement(parentSME, body); - if(added) + if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); } //Re-do @@ -1035,7 +1116,7 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody]AdminShellV20.S [SwaggerOperation("PostSubmodelElementByPathSubmodelRepo")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1069,7 +1150,9 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]Adm bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); } //Re-do @@ -1091,7 +1174,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]Adm [SwaggerOperation("PostSubmodelElementSubmodelRepo")] [SwaggerResponse(statusCode: 201, type: typeof(SubmodelElement), description: "Submodel element created successfully")] //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1117,7 +1200,8 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShel if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel Element {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1135,20 +1219,20 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]AdminShel [SwaggerOperation("PostSubmodelReference")] [SwaggerResponse(statusCode: 201, type: typeof(Reference), description: "Submodel reference created successfully")] //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) - public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Reference body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Reference body, [FromRoute][Required] string aasIdentifier) { if (body.Count == 0) { return BadRequest($"No references present in the request payload."); } - else if(body.Count != 1) + else if (body.Count != 1) { return BadRequest($"More than one references present in the request payload."); } //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found."); } @@ -1184,7 +1268,7 @@ public virtual IActionResult PostSubmodelReference([FromBody]AdminShellV20.Refer [ValidateModelState] [SwaggerOperation("PutAssetAdministrationShell")] //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) - public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) + public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier, [FromQuery] string content) { //TODO: content?? if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) @@ -1192,7 +1276,7 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 return BadRequest($"No Identification found in AAS."); } - if(!aasIdentifier.Equals(body.idShort)) + if (!aasIdentifier.Equals(body.idShort)) { return BadRequest($"idShort {aasIdentifier} and payload do not match"); } @@ -1201,7 +1285,8 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 if (added) { AasxServer.Program.signalNewData(2); - return NoContent(); + object output = aasHelper.HandleOutputModifiers(body, content: content); + return Created($"AAS {body.idShort} created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1218,13 +1303,14 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody]AdminShellV20 [ValidateModelState] [SwaggerOperation("PutAssetAdministrationShellById")] //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) - public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShellV20.AdministrationShell body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in AAS."); } + //TODO: What if iDShort needs to be updated if (!aasIdentifier.Equals(body.idShort)) { return BadRequest($"idShort {aasIdentifier} and payload do not match"); @@ -1250,12 +1336,29 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody]AdminShel [Route("/shells/{aasIdentifier}/aas/asset-information")] [ValidateModelState] [SwaggerOperation("PutAssetInformation")] - public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) - { - //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(204); + //public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) + public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset body, [FromRoute][Required] string aasIdentifier) + { + //Check if identification exists + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Asset."); + } - throw new NotImplementedException(); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + + bool added = aasHelper.AddAsset(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1269,7 +1372,7 @@ public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body [ValidateModelState] [SwaggerOperation("PutConceptDescriptionById")] //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) - public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.ConceptDescription body, [FromRoute][Required]string cdIdentifier) + public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20.ConceptDescription body, [FromRoute][Required] string cdIdentifier) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -1306,7 +1409,7 @@ public virtual IActionResult PutConceptDescriptionById([FromBody]AdminShellV20.C [ValidateModelState] [SwaggerOperation("PutSubmodel")] //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //TODO: Consider other parameters i.e., level, content, extent @@ -1316,7 +1419,7 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, } var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if(aasReturn.AAS == null) + if (aasReturn.AAS == null) { return NotFound($"AAS {aasIdentifier} not found."); } @@ -1336,7 +1439,8 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, aasReturn.AAS.submodelRefs.Add(newsmRef); } AasxServer.Program.signalNewData(2); - return NoContent(); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1358,7 +1462,7 @@ public virtual IActionResult PutSubmodel([FromBody]AdminShellV20.Submodel body, [ValidateModelState] [SwaggerOperation("PutSubmodelElementByPath")] //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if AAS exists var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); @@ -1379,7 +1483,7 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su return BadRequest($"IdShort is not set in the submodel element."); } //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); if (parentSME == null) { @@ -1389,7 +1493,9 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } //Re-do @@ -1411,7 +1517,7 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody]AdminShellV20.Su [ValidateModelState] [SwaggerOperation("PutSubmodelElementByPathSubmodelRepo")] //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]AdminShellV20.SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { //Check if submodel exists var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); @@ -1435,7 +1541,9 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]Admi bool added = aasHelper.AddSubmodelElement(parentSME, body); if (added) { - return Created($"Submodel element created successfully", body); + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element updated successfully.", output); } //Re-do @@ -1456,7 +1564,7 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]Admi [ValidateModelState] [SwaggerOperation("PutSubmodelSubmodelRepo")] //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) - public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) + public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { @@ -1472,7 +1580,8 @@ public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]AdminShellV20.Sub if (added) { AasxServer.Program.signalNewData(2); - return Created($"Submodel {body.idShort} created successfully.", body); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs index c9d95d6d1..a94d6a70c 100644 --- a/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -1,8 +1,7 @@ +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; using System.Linq; using System.Text.RegularExpressions; -using Swashbuckle.AspNetCore.Swagger; -using Swashbuckle.AspNetCore.SwaggerGen; -using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index 1845e56ac..a2138c86c 100644 --- a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -1,8 +1,8 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using System.ComponentModel.DataAnnotations; +using System.Linq; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index fd2f5a87f..55dfe86b2 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -2,9 +2,8 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Linq; using System.Text.RegularExpressions; -using System.Threading.Tasks; +using System.Threading; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers @@ -15,6 +14,10 @@ namespace IO.Swagger.Helpers public class AASHelper { private static AdminShellPackageEnv[] Packages; + /// + /// HandleId to operation result mapping for InvokeAsyncResult + /// + private static Dictionary opResultAsyncDict; /// /// Constructor @@ -22,6 +25,7 @@ public class AASHelper public AASHelper() { Packages = AasxServer.Program.env; + opResultAsyncDict = new Dictionary(); } internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) @@ -102,7 +106,7 @@ internal bool DeleteConceptDescription(string cdIdentifier) { bool deleted = false; var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); - if(conceptDescription != null) + if (conceptDescription != null) { Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); deleted = true; @@ -116,12 +120,12 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int { if (Packages != null) { - for(int i=0; i< Packages.Length;i++) + for (int i = 0; i < Packages.Length; i++) { var env = Packages[i]; if (env != null) { - foreach(var cd in env.AasEnv.ConceptDescriptions) + foreach (var cd in env.AasEnv.ConceptDescriptions) { if (cd.identification.id != null && cd.identification.id.Trim().ToLower() == cdIdentifier.Trim().ToLower()) { @@ -143,7 +147,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) bool success = false; // find the AAS var aasReturn = FindAas(aasIdentifier); - if(aasReturn.AAS != null) + if (aasReturn.AAS != null) { // find the asset var asset = FindAssetwithReference(aasReturn.AAS.assetRef); @@ -169,7 +173,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) { - if(parent is SubmodelElementCollection parentColl) + if (parent is SubmodelElementCollection parentColl) { parentColl.value.Remove(submodelElement); return true; @@ -187,7 +191,7 @@ internal Asset FindAssetwithReference(AssetRef assetRef) if (env != null) { Asset asset = env.AasEnv.FindAsset(assetRef); - if(asset != null) + if (asset != null) { return asset; } @@ -202,14 +206,14 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod { FindAasReturn aasReturn = FindAas(aasIdentifier); - if (aasReturn.AAS!= null) + if (aasReturn.AAS != null) { SubmodelRef submodelRef = FindSubmodelRefWithinAAS(aasReturn, submodelIdentifier); if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); return true; - } + } } return false; @@ -224,7 +228,7 @@ internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string su var submodel = Packages[aasReturn.IPackage].AasEnv.FindSubmodel(submodelRef); if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) return submodelRef; - } + } } return null; @@ -349,7 +353,7 @@ internal List FindAllAasByIdShort(string idShort) { outputShells.Add(aas); } - } + } } } @@ -360,7 +364,7 @@ internal List FindAllAasByAssetIds(List outputShells = new List(); - foreach(IdentifierKeyValuePair_V2 assetId in assetIdList) + foreach (IdentifierKeyValuePair_V2 assetId in assetIdList) { outputShells.AddRange(FindAasByAssetId(assetId.Value)); } @@ -381,7 +385,7 @@ private List FindAasByAssetId(string assetId) { outputShells.Add(aas); } - } + } } } @@ -395,9 +399,9 @@ internal List FindAllConceptDescriptionsByIdShort(string idS { if (env != null) { - foreach(ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) + foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) { - if(conceptDescription.idShort.Equals(idShort)) + if (conceptDescription.idShort.Equals(idShort)) { outputCds.Add(conceptDescription); } @@ -417,16 +421,16 @@ internal object FindAllConceptDescriptionsByDataSpecRef(DataSpecificationRef dat { foreach (ConceptDescription conceptDescription in env.AasEnv.ConceptDescriptions) { - if (conceptDescription.embeddedDataSpecification != null ) + if (conceptDescription.embeddedDataSpecification != null) { - foreach(EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) + foreach (EmbeddedDataSpecification embDataSpec in conceptDescription.embeddedDataSpecification) { - if(embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + if (embDataSpec.dataSpecification.Matches(dataSpecRefReq)) { outputCds.Add(conceptDescription); } } - + } } } @@ -444,7 +448,7 @@ internal List FindAllConceptDescriptionsByIsCaseOf(List FindAllConceptDescriptionsByIsCaseOf(List isCaseOf1, List isCaseOf2) { - foreach(Reference isCaseOf1_Ref in isCaseOf1) + foreach (Reference isCaseOf1_Ref in isCaseOf1) { - bool found=false; - foreach(Reference isCaseOf2_Ref in isCaseOf2) + bool found = false; + foreach (Reference isCaseOf2_Ref in isCaseOf2) { - if(isCaseOf1_Ref.Matches(isCaseOf2_Ref)) + if (isCaseOf1_Ref.Matches(isCaseOf2_Ref)) { found = true; break; } } - if(!found) + if (!found) { return false; } @@ -480,23 +484,60 @@ private bool CompareIsCaseOf(List isCaseOf1, List isCaseOf internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") { + //TODO: Better way to use default values when null + if (string.IsNullOrEmpty(level)) + { + level = "deep"; + } + + if (string.IsNullOrEmpty(content)) + { + content = "normal"; + } + + if (string.IsNullOrEmpty(extent)) + { + extent = "withoutBlobValue"; + } + + if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) + { + obj = GetObjectReference(obj); + } //Handle Level var json = ApplyLevelModifier(level, obj); return json; } + private object GetObjectReference(object obj) + { + if (obj is AdminShellV20.AdministrationShell aas) + return aas.GetReference(); + else if (obj is Submodel submodel) + return submodel.GetReference(); + else if (obj is SubmodelElement submodelElement) + return submodelElement.GetReference(); + else + { + Console.WriteLine("Error: Object not handled for the Reference type modifier."); + return obj; + } + } + private object ApplyLevelModifier(string level, object obj) { - if(level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); + + if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) { - var contractResolver = new OutputModifierContractResolver(true); - var settings = new JsonSerializerSettings(); - if (contractResolver != null) - settings.ContractResolver = contractResolver; - var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - return json; + contractResolver.Deep = false; } - return null; + + var settings = new JsonSerializerSettings(); + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; } internal bool AddSubmodel(Submodel submodel) @@ -544,12 +585,12 @@ internal Submodel FindSubmodelWithReference(Reference submodelRef) if (submodelRef.Count != 1) return null; - foreach(var env in Packages) + foreach (var env in Packages) { - if(env != null) + if (env != null) { var submodel = env.AasEnv.FindSubmodel(new Identification(submodelRef.First.idType, submodelRef.First.value)); - if(submodel != null) + if (submodel != null) { return submodel; } @@ -603,12 +644,12 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS return FindSubmodelElementByPath(collection, idShorts[1], out parent); } } - } + } } else { var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); - if(smeWrapper != null) + if (smeWrapper != null) return smeWrapper.submodelElement; } @@ -644,7 +685,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) { foreach (Submodel submodel in env.AasEnv.Submodels) { - if(submodel.idShort.Equals(idShort)) + if (submodel.idShort.Equals(idShort)) { outputSubmodels.Add(submodel); } @@ -680,9 +721,71 @@ internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection sme return null; } - internal object InvokeOperation(SubmodelElement submodelElement) + internal object InvokeOperationSync(Operation operation, Models.OperationRequest operationRequest) + { + Models.OperationResult opResult = new Models.OperationResult(); + //Check the qualifier for demo + if (operation.HasQualifierOfType("Demo") != null) + { + opResult.OutputArguments = new List(); + opResult.OutputArguments.Add(new Models.OperationVariable()); + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; + Models.Result result = new Models.Result(); + result.Success = true; + opResult.ExecutionResult = result; + opResult.RequestId = operationRequest.RequestId; + } + + return opResult; + } + + internal Models.OperationHandle InvokeOperationAsync(Operation operation, Models.OperationRequest body) + { + Models.OperationHandle opHandle = new Models.OperationHandle(); + //Check the qualifier for demo + if (operation.HasQualifierOfType("Demo") != null) + { + opHandle.RequestId = body.RequestId; + opHandle.HandleId = Guid.NewGuid().ToString(); + } + + return opHandle; + } + + + //TestOperation invokation for demo + private void InvokeTestOperation(Models.OperationHandle opHandle) { - throw new NotImplementedException(); + //First invokation + Models.OperationResult opResult = new Models.OperationResult(); + opResult.OutputArguments = new List + { + new Models.OperationVariable() + }; + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.InitiatedEnum; + Models.Message message = new Models.Message + { + Code = "xxx", + MessageType = Models.Message.MessageTypeEnum.InfoEnum, + Text = "Initiated the operation", + Timestamp = DateTime.UtcNow.ToString() + }; + Models.Result result = new Models.Result + { + Messages = new List() { message } + }; + opResult.ExecutionResult = result; + opResult.RequestId = opHandle.RequestId; + + opResultAsyncDict.Add(opHandle.HandleId, opResult); + + Thread.Sleep(120000); // Sleep for two min + //Running + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.RunningEnum; + + Thread.Sleep(120000); // Sleep for two min + //Running + opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; } /// @@ -693,7 +796,7 @@ internal object InvokeOperation(SubmodelElement submodelElement) /// internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) { - + if (parentSME is SubmodelElementCollection parentSMEColl) { var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); @@ -707,7 +810,7 @@ internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement subm else { parentSMEColl.Add(submodelElement); - + } submodelElement.SetAllTimeStamps(DateTime.UtcNow); @@ -716,6 +819,23 @@ internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement subm return false; } + + internal bool AddAsset(Asset body, FindAasReturn aasReturn) + { + var existingAsset = Packages[aasReturn.IPackage].AasEnv.FindAsset(body.identification); + //asset is already present // Ideal case + if (existingAsset != null) + { + Packages[aasReturn.IPackage].AasEnv.Assets.Remove(existingAsset); + } + Packages[aasReturn.IPackage].AasEnv.Assets.Add(body); + + //Change the assetRef in AAS + aasReturn.AAS.assetRef = new AssetRef(new Reference(new Key("Asset", true, body.identification.idType, body.identification.id))); + return true; + } + + } /// diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs index a5f0b5c4c..372d1ba61 100644 --- a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -1,12 +1,8 @@ using IO.Swagger.Models; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Runtime.Serialization; using System.Text; -using System.Threading.Tasks; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index f77fe899a..94b10fb5a 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,11 +1,7 @@ using AdminShellNS; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; namespace IO.Swagger.Helpers { @@ -20,17 +16,41 @@ public class OutputModifierContractResolver : DefaultContractResolver public bool SubmodelHasElements = true; public bool SmcHasValue = true; public bool OpHasVariables = true; + private bool deep = true; + private string content = "normal"; - public OutputModifierContractResolver(bool deep = true) + + + + /// + /// Default level of the json response. + /// + public bool Deep { - if (!deep) + get => deep; + set { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - this.BlobHasValue = false; - this.AasHasViews = false; + if (value == false) + { + this.SubmodelHasElements = false; + this.SmcHasValue = false; + this.OpHasVariables = false; + this.BlobHasValue = false; + this.AasHasViews = false; + } + } + } + + /// + /// The enumeration Content indicates the kind of the response content’s serialization. + /// + public string Content + { + get => content; + set + { + content = value; } } @@ -61,5 +81,10 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ return property; } + + protected override IValueProvider CreateMemberValueProvider(MemberInfo member) + { + return base.CreateMemberValueProvider(member); + } } } diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs index 1e06c68d5..c774cf18b 100644 --- a/src/IO.Swagger/Models/AccessControl.cs +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessControl : IEquatable - { + { /// /// Gets or Sets AccessPermissionRule /// - [DataMember(Name="accessPermissionRule")] + [DataMember(Name = "accessPermissionRule")] public List AccessPermissionRule { get; set; } /// /// Gets or Sets DefaultEnvironmentAttributes /// - [DataMember(Name="defaultEnvironmentAttributes")] + [DataMember(Name = "defaultEnvironmentAttributes")] //TODO:Uncomment //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultEnvironmentAttributes { get; set; } public Reference DefaultEnvironmentAttributes { get; set; } @@ -46,7 +42,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets DefaultPermissions /// - [DataMember(Name="defaultPermissions")] + [DataMember(Name = "defaultPermissions")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultPermissions { get; set; } public Reference DefaultPermissions { get; set; } @@ -55,7 +51,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets DefaultSubjectAttributes /// - [DataMember(Name="defaultSubjectAttributes")] + [DataMember(Name = "defaultSubjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DefaultSubjectAttributes { get; set; } public Reference DefaultSubjectAttributes { get; set; } @@ -64,7 +60,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectableEnvironmentAttributes /// - [DataMember(Name="selectableEnvironmentAttributes")] + [DataMember(Name = "selectableEnvironmentAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableEnvironmentAttributes { get; set; } public Reference SelectableEnvironmentAttributes { get; set; } @@ -73,7 +69,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectablePermissions /// - [DataMember(Name="selectablePermissions")] + [DataMember(Name = "selectablePermissions")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectablePermissions { get; set; } public Reference SelectablePermissions { get; set; } @@ -82,7 +78,7 @@ public partial class AccessControl : IEquatable /// Gets or Sets SelectableSubjectAttributes /// - [DataMember(Name="selectableSubjectAttributes")] + [DataMember(Name = "selectableSubjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SelectableSubjectAttributes { get; set; } public Reference SelectableSubjectAttributes { get; set; } @@ -137,37 +133,37 @@ public bool Equals(AccessControl other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AccessPermissionRule == other.AccessPermissionRule || AccessPermissionRule != null && AccessPermissionRule.SequenceEqual(other.AccessPermissionRule) - ) && + ) && ( DefaultEnvironmentAttributes == other.DefaultEnvironmentAttributes || DefaultEnvironmentAttributes != null && DefaultEnvironmentAttributes.Equals(other.DefaultEnvironmentAttributes) - ) && + ) && ( DefaultPermissions == other.DefaultPermissions || DefaultPermissions != null && DefaultPermissions.Equals(other.DefaultPermissions) - ) && + ) && ( DefaultSubjectAttributes == other.DefaultSubjectAttributes || DefaultSubjectAttributes != null && DefaultSubjectAttributes.Equals(other.DefaultSubjectAttributes) - ) && + ) && ( SelectableEnvironmentAttributes == other.SelectableEnvironmentAttributes || SelectableEnvironmentAttributes != null && SelectableEnvironmentAttributes.Equals(other.SelectableEnvironmentAttributes) - ) && + ) && ( SelectablePermissions == other.SelectablePermissions || SelectablePermissions != null && SelectablePermissions.Equals(other.SelectablePermissions) - ) && + ) && ( SelectableSubjectAttributes == other.SelectableSubjectAttributes || SelectableSubjectAttributes != null && @@ -185,26 +181,26 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AccessPermissionRule != null) + if (AccessPermissionRule != null) hashCode = hashCode * 59 + AccessPermissionRule.GetHashCode(); - if (DefaultEnvironmentAttributes != null) + if (DefaultEnvironmentAttributes != null) hashCode = hashCode * 59 + DefaultEnvironmentAttributes.GetHashCode(); - if (DefaultPermissions != null) + if (DefaultPermissions != null) hashCode = hashCode * 59 + DefaultPermissions.GetHashCode(); - if (DefaultSubjectAttributes != null) + if (DefaultSubjectAttributes != null) hashCode = hashCode * 59 + DefaultSubjectAttributes.GetHashCode(); - if (SelectableEnvironmentAttributes != null) + if (SelectableEnvironmentAttributes != null) hashCode = hashCode * 59 + SelectableEnvironmentAttributes.GetHashCode(); - if (SelectablePermissions != null) + if (SelectablePermissions != null) hashCode = hashCode * 59 + SelectablePermissions.GetHashCode(); - if (SelectableSubjectAttributes != null) + if (SelectableSubjectAttributes != null) hashCode = hashCode * 59 + SelectableSubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessControl left, AccessControl right) { @@ -216,7 +212,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs index 292864002..c064fb200 100644 --- a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessControlPolicyPoints : IEquatable - { + { /// /// Gets or Sets PolicyAdministrationPoint /// [Required] - [DataMember(Name="policyAdministrationPoint")] + [DataMember(Name = "policyAdministrationPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyAdministrationPoint PolicyAdministrationPoint { get; set; } public PolicyAdministrationPoint PolicyAdministrationPoint { get; set; } @@ -41,7 +36,7 @@ public partial class AccessControlPolicyPoints : IEquatable [Required] - [DataMember(Name="policyDecisionPoint")] + [DataMember(Name = "policyDecisionPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyDecisionPoint PolicyDecisionPoint { get; set; } public PolicyDecisionPoint PolicyDecisionPoint { get; set; } @@ -51,7 +46,7 @@ public partial class AccessControlPolicyPoints : IEquatable [Required] - [DataMember(Name="policyEnforcementPoint")] + [DataMember(Name = "policyEnforcementPoint")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyEnforcementPoint //PolicyEnforcementPoint { get; set; } @@ -62,7 +57,7 @@ public partial class AccessControlPolicyPoints : IEquatable - [DataMember(Name="policyInformationPoints")] + [DataMember(Name = "policyInformationPoints")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasPolicyInformationPoints PolicyInformationPoints { get; set; } public PolicyInformationPoints PolicyInformationPoints { get; set; } @@ -114,22 +109,22 @@ public bool Equals(AccessControlPolicyPoints other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( PolicyAdministrationPoint == other.PolicyAdministrationPoint || PolicyAdministrationPoint != null && PolicyAdministrationPoint.Equals(other.PolicyAdministrationPoint) - ) && + ) && ( PolicyDecisionPoint == other.PolicyDecisionPoint || PolicyDecisionPoint != null && PolicyDecisionPoint.Equals(other.PolicyDecisionPoint) - ) && + ) && ( PolicyEnforcementPoint == other.PolicyEnforcementPoint || PolicyEnforcementPoint != null && PolicyEnforcementPoint.Equals(other.PolicyEnforcementPoint) - ) && + ) && ( PolicyInformationPoints == other.PolicyInformationPoints || PolicyInformationPoints != null && @@ -147,20 +142,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (PolicyAdministrationPoint != null) + if (PolicyAdministrationPoint != null) hashCode = hashCode * 59 + PolicyAdministrationPoint.GetHashCode(); - if (PolicyDecisionPoint != null) + if (PolicyDecisionPoint != null) hashCode = hashCode * 59 + PolicyDecisionPoint.GetHashCode(); - if (PolicyEnforcementPoint != null) + if (PolicyEnforcementPoint != null) hashCode = hashCode * 59 + PolicyEnforcementPoint.GetHashCode(); - if (PolicyInformationPoints != null) + if (PolicyInformationPoints != null) hashCode = hashCode * 59 + PolicyInformationPoints.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessControlPolicyPoints left, AccessControlPolicyPoints right) { @@ -172,7 +167,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs index 95a9b18a6..65f630acd 100644 --- a/src/IO.Swagger/Models/AccessPermissionRule.cs +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -7,37 +7,34 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AccessPermissionRule : Referable, IEquatable - { + { /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets PermissionsPerObject /// - [DataMember(Name="permissionsPerObject")] + [DataMember(Name = "permissionsPerObject")] public List PermissionsPerObject { get; set; } /// @@ -45,7 +42,7 @@ public partial class AccessPermissionRule : Referable, IEquatable [Required] - [DataMember(Name="targetSubjectAttributes")] + [DataMember(Name = "targetSubjectAttributes")] public List TargetSubjectAttributes { get; set; } /// @@ -67,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -94,17 +91,17 @@ public bool Equals(AccessPermissionRule other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( PermissionsPerObject == other.PermissionsPerObject || PermissionsPerObject != null && PermissionsPerObject.SequenceEqual(other.PermissionsPerObject) - ) && + ) && ( TargetSubjectAttributes == other.TargetSubjectAttributes || TargetSubjectAttributes != null && @@ -122,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (PermissionsPerObject != null) + if (PermissionsPerObject != null) hashCode = hashCode * 59 + PermissionsPerObject.GetHashCode(); - if (TargetSubjectAttributes != null) + if (TargetSubjectAttributes != null) hashCode = hashCode * 59 + TargetSubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AccessPermissionRule left, AccessPermissionRule right) { @@ -145,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs index c106e04bc..aceef7073 100644 --- a/src/IO.Swagger/Models/AdministrativeInformation.cs +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AdministrativeInformation : IEquatable - { + { /// /// Gets or Sets Revision /// - [DataMember(Name="revision")] + [DataMember(Name = "revision")] public string Revision { get; set; } /// /// Gets or Sets Version /// - [DataMember(Name="version")] + [DataMember(Name = "version")] public string Version { get; set; } /// @@ -85,12 +79,12 @@ public bool Equals(AdministrativeInformation other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Revision == other.Revision || Revision != null && Revision.Equals(other.Revision) - ) && + ) && ( Version == other.Version || Version != null && @@ -108,16 +102,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Revision != null) + if (Revision != null) hashCode = hashCode * 59 + Revision.GetHashCode(); - if (Version != null) + if (Version != null) hashCode = hashCode * 59 + Version.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AdministrativeInformation left, AdministrativeInformation right) { @@ -129,7 +123,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs index f3a9b5681..4e0cafe47 100644 --- a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AnnotatedRelationshipElement : RelationshipElement, IEquatable - { + { /// /// Gets or Sets Annotation /// - [DataMember(Name="annotation")] + [DataMember(Name = "annotation")] public List Annotation { get; set; } /// @@ -50,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -77,7 +73,7 @@ public bool Equals(AnnotatedRelationshipElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Annotation == other.Annotation || Annotation != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Annotation != null) + if (Annotation != null) hashCode = hashCode * 59 + Annotation.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AnnotatedRelationshipElement left, AnnotatedRelationshipElement right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs index 930317d36..7c52798be 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShell.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetAdministrationShell : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// @@ -38,35 +35,35 @@ public partial class AssetAdministrationShell : Identifiable, IEquatable [Required] - [DataMember(Name="assetInformation")] + [DataMember(Name = "assetInformation")] public AssetInformation AssetInformation { get; set; } /// /// Gets or Sets DerivedFrom /// - [DataMember(Name="derivedFrom")] + [DataMember(Name = "derivedFrom")] public Reference DerivedFrom { get; set; } /// /// Gets or Sets Security /// - [DataMember(Name="security")] + [DataMember(Name = "security")] public Security Security { get; set; } /// /// Gets or Sets Submodels /// - [DataMember(Name="submodels")] + [DataMember(Name = "submodels")] public List Submodels { get; set; } /// /// Gets or Sets Views /// - [DataMember(Name="views")] + [DataMember(Name = "views")] public List Views { get; set; } /// @@ -91,7 +88,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -118,32 +115,32 @@ public bool Equals(AssetAdministrationShell other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( AssetInformation == other.AssetInformation || AssetInformation != null && AssetInformation.Equals(other.AssetInformation) - ) && + ) && ( DerivedFrom == other.DerivedFrom || DerivedFrom != null && DerivedFrom.Equals(other.DerivedFrom) - ) && + ) && ( Security == other.Security || Security != null && Security.Equals(other.Security) - ) && + ) && ( Submodels == other.Submodels || Submodels != null && Submodels.SequenceEqual(other.Submodels) - ) && + ) && ( Views == other.Views || Views != null && @@ -161,24 +158,24 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (AssetInformation != null) + if (AssetInformation != null) hashCode = hashCode * 59 + AssetInformation.GetHashCode(); - if (DerivedFrom != null) + if (DerivedFrom != null) hashCode = hashCode * 59 + DerivedFrom.GetHashCode(); - if (Security != null) + if (Security != null) hashCode = hashCode * 59 + Security.GetHashCode(); - if (Submodels != null) + if (Submodels != null) hashCode = hashCode * 59 + Submodels.GetHashCode(); - if (Views != null) + if (Views != null) hashCode = hashCode * 59 + Views.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetAdministrationShell left, AssetAdministrationShell right) { @@ -190,7 +187,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs index 3f1819c13..015620adc 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetAdministrationShellEnvironment : IEquatable - { + { /// /// Gets or Sets AssetAdministrationShells /// - [DataMember(Name="assetAdministrationShells")] + [DataMember(Name = "assetAdministrationShells")] public List AssetAdministrationShells { get; set; } /// /// Gets or Sets ConceptDescriptions /// - [DataMember(Name="conceptDescriptions")] + [DataMember(Name = "conceptDescriptions")] public List ConceptDescriptions { get; set; } /// /// Gets or Sets Submodels /// - [DataMember(Name="submodels")] + [DataMember(Name = "submodels")] public List Submodels { get; set; } /// @@ -93,17 +89,17 @@ public bool Equals(AssetAdministrationShellEnvironment other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AssetAdministrationShells == other.AssetAdministrationShells || AssetAdministrationShells != null && AssetAdministrationShells.SequenceEqual(other.AssetAdministrationShells) - ) && + ) && ( ConceptDescriptions == other.ConceptDescriptions || ConceptDescriptions != null && ConceptDescriptions.SequenceEqual(other.ConceptDescriptions) - ) && + ) && ( Submodels == other.Submodels || Submodels != null && @@ -121,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AssetAdministrationShells != null) + if (AssetAdministrationShells != null) hashCode = hashCode * 59 + AssetAdministrationShells.GetHashCode(); - if (ConceptDescriptions != null) + if (ConceptDescriptions != null) hashCode = hashCode * 59 + ConceptDescriptions.GetHashCode(); - if (Submodels != null) + if (Submodels != null) hashCode = hashCode * 59 + Submodels.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetAdministrationShellEnvironment left, AssetAdministrationShellEnvironment right) { @@ -144,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs index 8ab61ca3e..82210194d 100644 --- a/src/IO.Swagger/Models/AssetInformation.cs +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class AssetInformation : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(AssetInformation left, AssetInformation right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs index e236f583e..53615779d 100644 --- a/src/IO.Swagger/Models/AssetKind.cs +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets AssetKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AssetKind + { + /// + /// Enum TypeEnum for Type + /// + [EnumMember(Value = "Type")] + TypeEnum = 0, /// - /// Gets or Sets AssetKind + /// Enum InstanceEnum for Instance /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum AssetKind - { - /// - /// Enum TypeEnum for Type - /// - [EnumMember(Value = "Type")] - TypeEnum = 0, - /// - /// Enum InstanceEnum for Instance - /// - [EnumMember(Value = "Instance")] - InstanceEnum = 1 } + [EnumMember(Value = "Instance")] + InstanceEnum = 1 + } } diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs index 318151203..e32d77dff 100644 --- a/src/IO.Swagger/Models/BasicEvent.cs +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class BasicEvent : ModelEvent, IEquatable - { + { /// /// Gets or Sets Observed /// [Required] - [DataMember(Name="observed")] + [DataMember(Name = "observed")] public Reference Observed { get; set; } /// @@ -51,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -78,7 +73,7 @@ public bool Equals(BasicEvent other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Observed == other.Observed || Observed != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Observed != null) + if (Observed != null) hashCode = hashCode * 59 + Observed.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(BasicEvent left, BasicEvent right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs index 100026f1b..b53c09db5 100644 --- a/src/IO.Swagger/Models/Blob.cs +++ b/src/IO.Swagger/Models/Blob.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Blob : SubmodelElement, IEquatable - { + { /// /// Gets or Sets MimeType /// [Required] - [DataMember(Name="mimeType")] + [DataMember(Name = "mimeType")] public string MimeType { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(Blob other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( MimeType == other.MimeType || MimeType != null && MimeType.Equals(other.MimeType) - ) && + ) && ( Value == other.Value || Value != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (MimeType != null) + if (MimeType != null) hashCode = hashCode * 59 + MimeType.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Blob left, Blob right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs index aa57ec7ff..0d13579d2 100644 --- a/src/IO.Swagger/Models/BlobCertificate.cs +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class BlobCertificate : IEquatable - { + { /// /// Gets or Sets _BlobCertificate /// - [DataMember(Name="blobCertificate")] + [DataMember(Name = "blobCertificate")] //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasBlob _BlobCertificate { get; set; } public Blob _BlobCertificate { get; set; } @@ -38,14 +34,14 @@ public partial class BlobCertificate : IEquatable /// Gets or Sets ContainedExtension /// - [DataMember(Name="containedExtension")] + [DataMember(Name = "containedExtension")] public List ContainedExtension { get; set; } /// /// Gets or Sets LastCertificate /// - [DataMember(Name="lastCertificate")] + [DataMember(Name = "lastCertificate")] public bool? LastCertificate { get; set; } /// @@ -94,17 +90,17 @@ public bool Equals(BlobCertificate other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _BlobCertificate == other._BlobCertificate || _BlobCertificate != null && _BlobCertificate.Equals(other._BlobCertificate) - ) && + ) && ( ContainedExtension == other.ContainedExtension || ContainedExtension != null && ContainedExtension.SequenceEqual(other.ContainedExtension) - ) && + ) && ( LastCertificate == other.LastCertificate || LastCertificate != null && @@ -122,18 +118,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_BlobCertificate != null) + if (_BlobCertificate != null) hashCode = hashCode * 59 + _BlobCertificate.GetHashCode(); - if (ContainedExtension != null) + if (ContainedExtension != null) hashCode = hashCode * 59 + ContainedExtension.GetHashCode(); - if (LastCertificate != null) + if (LastCertificate != null) hashCode = hashCode * 59 + LastCertificate.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(BlobCertificate left, BlobCertificate right) { @@ -145,7 +141,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs index a52f19279..afce09069 100644 --- a/src/IO.Swagger/Models/Capability.cs +++ b/src/IO.Swagger/Models/Capability.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Capability : SubmodelElement, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Capability left, Capability right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs index ea6808243..f7421a5e6 100644 --- a/src/IO.Swagger/Models/Certificate.cs +++ b/src/IO.Swagger/Models/Certificate.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Certificate : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Certificate left, Certificate right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs index daee04c35..3aeaf2f3e 100644 --- a/src/IO.Swagger/Models/ConceptDescription.cs +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ConceptDescription : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets IsCaseOf /// - [DataMember(Name="isCaseOf")] + [DataMember(Name = "isCaseOf")] public List IsCaseOf { get; set; } /// @@ -58,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -85,12 +81,12 @@ public bool Equals(ConceptDescription other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( IsCaseOf == other.IsCaseOf || IsCaseOf != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (IsCaseOf != null) + if (IsCaseOf != null) hashCode = hashCode * 59 + IsCaseOf.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ConceptDescription left, ConceptDescription right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs index ec4b27a12..fcaeebc4a 100644 --- a/src/IO.Swagger/Models/Constraint.cs +++ b/src/IO.Swagger/Models/Constraint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Constraint : IEquatable - { + { /// /// Gets or Sets ModelType /// [Required] - [DataMember(Name="modelType")] + [DataMember(Name = "modelType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelType ModelType { get; set; } public ModelType ModelType { get; set; } @@ -80,7 +75,7 @@ public bool Equals(Constraint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ModelType == other.ModelType || ModelType != null && @@ -98,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ModelType != null) + if (ModelType != null) hashCode = hashCode * 59 + ModelType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Constraint left, Constraint right) { @@ -117,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs index 03e2b6ab0..1afee42c4 100644 --- a/src/IO.Swagger/Models/DataElement.cs +++ b/src/IO.Swagger/Models/DataElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataElement left, DataElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs index 73470a843..a8e3dbeb0 100644 --- a/src/IO.Swagger/Models/DataSpecificationContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationContent : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationContent left, DataSpecificationContent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs index 35597f732..770354aae 100644 --- a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -7,44 +7,41 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable - { + { /// /// Gets or Sets DataType /// - [DataMember(Name="dataType")] + [DataMember(Name = "dataType")] public string DataType { get; set; } /// /// Gets or Sets Definition /// - [DataMember(Name="definition")] + [DataMember(Name = "definition")] public List Definition { get; set; } /// /// Gets or Sets LevelType /// - [DataMember(Name="levelType")] + [DataMember(Name = "levelType")] public List LevelType { get; set; } /// @@ -52,56 +49,56 @@ public partial class DataSpecificationIEC61360Content : ValueObject, IEquatable< /// [Required] - [DataMember(Name="preferredName")] + [DataMember(Name = "preferredName")] public List PreferredName { get; set; } /// /// Gets or Sets ShortName /// - [DataMember(Name="shortName")] + [DataMember(Name = "shortName")] public List ShortName { get; set; } /// /// Gets or Sets SourceOfDefinition /// - [DataMember(Name="sourceOfDefinition")] + [DataMember(Name = "sourceOfDefinition")] public string SourceOfDefinition { get; set; } /// /// Gets or Sets Symbol /// - [DataMember(Name="symbol")] + [DataMember(Name = "symbol")] public string Symbol { get; set; } /// /// Gets or Sets Unit /// - [DataMember(Name="unit")] + [DataMember(Name = "unit")] public string Unit { get; set; } /// /// Gets or Sets UnitId /// - [DataMember(Name="unitId")] + [DataMember(Name = "unitId")] public Reference UnitId { get; set; } /// /// Gets or Sets ValueFormat /// - [DataMember(Name="valueFormat")] + [DataMember(Name = "valueFormat")] public string ValueFormat { get; set; } /// /// Gets or Sets ValueList /// - [DataMember(Name="valueList")] + [DataMember(Name = "valueList")] public ValueList ValueList { get; set; } /// @@ -131,7 +128,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -158,57 +155,57 @@ public bool Equals(DataSpecificationIEC61360Content other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( DataType == other.DataType || DataType != null && DataType.Equals(other.DataType) - ) && + ) && ( Definition == other.Definition || Definition != null && Definition.SequenceEqual(other.Definition) - ) && + ) && ( LevelType == other.LevelType || LevelType != null && LevelType.SequenceEqual(other.LevelType) - ) && + ) && ( PreferredName == other.PreferredName || PreferredName != null && PreferredName.SequenceEqual(other.PreferredName) - ) && + ) && ( ShortName == other.ShortName || ShortName != null && ShortName.SequenceEqual(other.ShortName) - ) && + ) && ( SourceOfDefinition == other.SourceOfDefinition || SourceOfDefinition != null && SourceOfDefinition.Equals(other.SourceOfDefinition) - ) && + ) && ( Symbol == other.Symbol || Symbol != null && Symbol.Equals(other.Symbol) - ) && + ) && ( Unit == other.Unit || Unit != null && Unit.Equals(other.Unit) - ) && + ) && ( UnitId == other.UnitId || UnitId != null && UnitId.Equals(other.UnitId) - ) && + ) && ( ValueFormat == other.ValueFormat || ValueFormat != null && ValueFormat.Equals(other.ValueFormat) - ) && + ) && ( ValueList == other.ValueList || ValueList != null && @@ -226,34 +223,34 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (DataType != null) + if (DataType != null) hashCode = hashCode * 59 + DataType.GetHashCode(); - if (Definition != null) + if (Definition != null) hashCode = hashCode * 59 + Definition.GetHashCode(); - if (LevelType != null) + if (LevelType != null) hashCode = hashCode * 59 + LevelType.GetHashCode(); - if (PreferredName != null) + if (PreferredName != null) hashCode = hashCode * 59 + PreferredName.GetHashCode(); - if (ShortName != null) + if (ShortName != null) hashCode = hashCode * 59 + ShortName.GetHashCode(); - if (SourceOfDefinition != null) + if (SourceOfDefinition != null) hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); - if (Symbol != null) + if (Symbol != null) hashCode = hashCode * 59 + Symbol.GetHashCode(); - if (Unit != null) + if (Unit != null) hashCode = hashCode * 59 + Unit.GetHashCode(); - if (UnitId != null) + if (UnitId != null) hashCode = hashCode * 59 + UnitId.GetHashCode(); - if (ValueFormat != null) + if (ValueFormat != null) hashCode = hashCode * 59 + ValueFormat.GetHashCode(); - if (ValueList != null) + if (ValueList != null) hashCode = hashCode * 59 + ValueList.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationIEC61360Content left, DataSpecificationIEC61360Content right) { @@ -265,7 +262,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs index f72ad4d3b..e7324e909 100644 --- a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class DataSpecificationPhysicalUnitContent : IEquatable - { + { /// /// Gets or Sets ConversionFactor /// - [DataMember(Name="conversionFactor")] + [DataMember(Name = "conversionFactor")] public string ConversionFactor { get; set; } /// @@ -38,70 +35,70 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="definition")] + [DataMember(Name = "definition")] public List Definition { get; set; } /// /// Gets or Sets DinNotation /// - [DataMember(Name="dinNotation")] + [DataMember(Name = "dinNotation")] public string DinNotation { get; set; } /// /// Gets or Sets EceCode /// - [DataMember(Name="eceCode")] + [DataMember(Name = "eceCode")] public string EceCode { get; set; } /// /// Gets or Sets EceName /// - [DataMember(Name="eceName")] + [DataMember(Name = "eceName")] public string EceName { get; set; } /// /// Gets or Sets NistName /// - [DataMember(Name="nistName")] + [DataMember(Name = "nistName")] public string NistName { get; set; } /// /// Gets or Sets RegistrationAuthorityId /// - [DataMember(Name="registrationAuthorityId")] + [DataMember(Name = "registrationAuthorityId")] public string RegistrationAuthorityId { get; set; } /// /// Gets or Sets SiName /// - [DataMember(Name="siName")] + [DataMember(Name = "siName")] public string SiName { get; set; } /// /// Gets or Sets SiNotation /// - [DataMember(Name="siNotation")] + [DataMember(Name = "siNotation")] public string SiNotation { get; set; } /// /// Gets or Sets SourceOfDefinition /// - [DataMember(Name="sourceOfDefinition")] + [DataMember(Name = "sourceOfDefinition")] public string SourceOfDefinition { get; set; } /// /// Gets or Sets Supplier /// - [DataMember(Name="supplier")] + [DataMember(Name = "supplier")] public string Supplier { get; set; } /// @@ -109,7 +106,7 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="unitName")] + [DataMember(Name = "unitName")] public string UnitName { get; set; } /// @@ -117,7 +114,7 @@ public partial class DataSpecificationPhysicalUnitContent : IEquatable [Required] - [DataMember(Name="unitSymbol")] + [DataMember(Name = "unitSymbol")] public string UnitSymbol { get; set; } /// @@ -176,67 +173,67 @@ public bool Equals(DataSpecificationPhysicalUnitContent other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ConversionFactor == other.ConversionFactor || ConversionFactor != null && ConversionFactor.Equals(other.ConversionFactor) - ) && + ) && ( Definition == other.Definition || Definition != null && Definition.SequenceEqual(other.Definition) - ) && + ) && ( DinNotation == other.DinNotation || DinNotation != null && DinNotation.Equals(other.DinNotation) - ) && + ) && ( EceCode == other.EceCode || EceCode != null && EceCode.Equals(other.EceCode) - ) && + ) && ( EceName == other.EceName || EceName != null && EceName.Equals(other.EceName) - ) && + ) && ( NistName == other.NistName || NistName != null && NistName.Equals(other.NistName) - ) && + ) && ( RegistrationAuthorityId == other.RegistrationAuthorityId || RegistrationAuthorityId != null && RegistrationAuthorityId.Equals(other.RegistrationAuthorityId) - ) && + ) && ( SiName == other.SiName || SiName != null && SiName.Equals(other.SiName) - ) && + ) && ( SiNotation == other.SiNotation || SiNotation != null && SiNotation.Equals(other.SiNotation) - ) && + ) && ( SourceOfDefinition == other.SourceOfDefinition || SourceOfDefinition != null && SourceOfDefinition.Equals(other.SourceOfDefinition) - ) && + ) && ( Supplier == other.Supplier || Supplier != null && Supplier.Equals(other.Supplier) - ) && + ) && ( UnitName == other.UnitName || UnitName != null && UnitName.Equals(other.UnitName) - ) && + ) && ( UnitSymbol == other.UnitSymbol || UnitSymbol != null && @@ -254,38 +251,38 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ConversionFactor != null) + if (ConversionFactor != null) hashCode = hashCode * 59 + ConversionFactor.GetHashCode(); - if (Definition != null) + if (Definition != null) hashCode = hashCode * 59 + Definition.GetHashCode(); - if (DinNotation != null) + if (DinNotation != null) hashCode = hashCode * 59 + DinNotation.GetHashCode(); - if (EceCode != null) + if (EceCode != null) hashCode = hashCode * 59 + EceCode.GetHashCode(); - if (EceName != null) + if (EceName != null) hashCode = hashCode * 59 + EceName.GetHashCode(); - if (NistName != null) + if (NistName != null) hashCode = hashCode * 59 + NistName.GetHashCode(); - if (RegistrationAuthorityId != null) + if (RegistrationAuthorityId != null) hashCode = hashCode * 59 + RegistrationAuthorityId.GetHashCode(); - if (SiName != null) + if (SiName != null) hashCode = hashCode * 59 + SiName.GetHashCode(); - if (SiNotation != null) + if (SiNotation != null) hashCode = hashCode * 59 + SiNotation.GetHashCode(); - if (SourceOfDefinition != null) + if (SourceOfDefinition != null) hashCode = hashCode * 59 + SourceOfDefinition.GetHashCode(); - if (Supplier != null) + if (Supplier != null) hashCode = hashCode * 59 + Supplier.GetHashCode(); - if (UnitName != null) + if (UnitName != null) hashCode = hashCode * 59 + UnitName.GetHashCode(); - if (UnitSymbol != null) + if (UnitSymbol != null) hashCode = hashCode * 59 + UnitSymbol.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(DataSpecificationPhysicalUnitContent left, DataSpecificationPhysicalUnitContent right) { @@ -297,7 +294,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs index c21e05e0f..ec35e951a 100644 --- a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class EmbeddedDataSpecification : IEquatable - { + { /// /// Gets or Sets DataSpecification /// [Required] - [DataMember(Name="dataSpecification")] + [DataMember(Name = "dataSpecification")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference DataSpecification { get; set; } public Reference DataSpecification { get; set; } @@ -41,7 +36,7 @@ public partial class EmbeddedDataSpecification : IEquatable [Required] - [DataMember(Name="dataSpecificationContent")] + [DataMember(Name = "dataSpecificationContent")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasDataSpecificationContent DataSpecificationContent { get; set; } public DataSpecificationContent DataSpecificationContent { get; set; } @@ -91,12 +86,12 @@ public bool Equals(EmbeddedDataSpecification other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( DataSpecification == other.DataSpecification || DataSpecification != null && DataSpecification.Equals(other.DataSpecification) - ) && + ) && ( DataSpecificationContent == other.DataSpecificationContent || DataSpecificationContent != null && @@ -114,16 +109,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (DataSpecification != null) + if (DataSpecification != null) hashCode = hashCode * 59 + DataSpecification.GetHashCode(); - if (DataSpecificationContent != null) + if (DataSpecificationContent != null) hashCode = hashCode * 59 + DataSpecificationContent.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(EmbeddedDataSpecification left, EmbeddedDataSpecification right) { @@ -135,7 +130,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs index 49a3d9a09..0b1046298 100644 --- a/src/IO.Swagger/Models/Entity.cs +++ b/src/IO.Swagger/Models/Entity.cs @@ -7,52 +7,49 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Entity : SubmodelElement, IEquatable - { + { /// /// Gets or Sets EntityType /// [Required] - [DataMember(Name="entityType")] + [DataMember(Name = "entityType")] public EntityType EntityType { get; set; } /// /// Gets or Sets GlobalAssetId /// - [DataMember(Name="globalAssetId")] + [DataMember(Name = "globalAssetId")] public Reference GlobalAssetId { get; set; } /// /// Gets or Sets SpecificAssetIds /// - [DataMember(Name="specificAssetIds")] + [DataMember(Name = "specificAssetIds")] public List SpecificAssetIds { get; set; } /// /// Gets or Sets Statements /// - [DataMember(Name="statements")] + [DataMember(Name = "statements")] public List Statements { get; set; } /// @@ -75,7 +72,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -102,22 +99,22 @@ public bool Equals(Entity other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EntityType == other.EntityType || EntityType != null && EntityType.Equals(other.EntityType) - ) && + ) && ( GlobalAssetId == other.GlobalAssetId || GlobalAssetId != null && GlobalAssetId.Equals(other.GlobalAssetId) - ) && + ) && ( SpecificAssetIds == other.SpecificAssetIds || SpecificAssetIds != null && SpecificAssetIds.SequenceEqual(other.SpecificAssetIds) - ) && + ) && ( Statements == other.Statements || Statements != null && @@ -135,20 +132,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EntityType != null) + if (EntityType != null) hashCode = hashCode * 59 + EntityType.GetHashCode(); - if (GlobalAssetId != null) + if (GlobalAssetId != null) hashCode = hashCode * 59 + GlobalAssetId.GetHashCode(); - if (SpecificAssetIds != null) + if (SpecificAssetIds != null) hashCode = hashCode * 59 + SpecificAssetIds.GetHashCode(); - if (Statements != null) + if (Statements != null) hashCode = hashCode * 59 + Statements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Entity left, Entity right) { @@ -160,7 +157,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs index 569dcd10d..d06093904 100644 --- a/src/IO.Swagger/Models/EntityType.cs +++ b/src/IO.Swagger/Models/EntityType.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets EntityType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum EntityType + { + /// + /// Enum CoManagedEntityEnum for CoManagedEntity + /// + [EnumMember(Value = "CoManagedEntity")] + CoManagedEntityEnum = 0, /// - /// Gets or Sets EntityType + /// Enum SelfManagedEntityEnum for SelfManagedEntity /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum EntityType - { - /// - /// Enum CoManagedEntityEnum for CoManagedEntity - /// - [EnumMember(Value = "CoManagedEntity")] - CoManagedEntityEnum = 0, - /// - /// Enum SelfManagedEntityEnum for SelfManagedEntity - /// - [EnumMember(Value = "SelfManagedEntity")] - SelfManagedEntityEnum = 1 } + [EnumMember(Value = "SelfManagedEntity")] + SelfManagedEntityEnum = 1 + } } diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs index 48d5cad95..509f42692 100644 --- a/src/IO.Swagger/Models/Extension.cs +++ b/src/IO.Swagger/Models/Extension.cs @@ -7,52 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Extension : HasSemantics, IEquatable - { + { /// /// Gets or Sets Name /// [Required] - [DataMember(Name="name")] + [DataMember(Name = "name")] public string Name { get; set; } /// /// Gets or Sets RefersTo /// - [DataMember(Name="refersTo")] + [DataMember(Name = "refersTo")] public Reference RefersTo { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] public ValueTypeEnum ValueType { get; set; } /// @@ -75,7 +70,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -102,22 +97,22 @@ public bool Equals(Extension other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Name == other.Name || Name != null && Name.Equals(other.Name) - ) && + ) && ( RefersTo == other.RefersTo || RefersTo != null && RefersTo.Equals(other.RefersTo) - ) && + ) && ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -135,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Name != null) + if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); - if (RefersTo != null) + if (RefersTo != null) hashCode = hashCode * 59 + RefersTo.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Extension left, Extension right) { @@ -160,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs index 330434ae0..e1a4ce7f8 100644 --- a/src/IO.Swagger/Models/File.cs +++ b/src/IO.Swagger/Models/File.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class File : SubmodelElement, IEquatable - { + { /// /// Gets or Sets MimeType /// [Required] - [DataMember(Name="mimeType")] + [DataMember(Name = "mimeType")] public string MimeType { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(File other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( MimeType == other.MimeType || MimeType != null && MimeType.Equals(other.MimeType) - ) && + ) && ( Value == other.Value || Value != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (MimeType != null) + if (MimeType != null) hashCode = hashCode * 59 + MimeType.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(File left, File right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs index 1214dc664..2e98ffb87 100644 --- a/src/IO.Swagger/Models/Formula.cs +++ b/src/IO.Swagger/Models/Formula.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Formula : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Formula left, Formula right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs index 1b3123530..276ab1d21 100644 --- a/src/IO.Swagger/Models/GlobalReference.cs +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class GlobalReference : Reference, IEquatable - { + { /// /// Gets or Sets Value /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// @@ -51,7 +48,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -78,7 +75,7 @@ public bool Equals(GlobalReference other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -96,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(GlobalReference left, GlobalReference right) { @@ -115,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs index e901e1f31..428b707cf 100644 --- a/src/IO.Swagger/Models/HasDataSpecification.cs +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasDataSpecification : IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(HasDataSpecification other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasDataSpecification left, HasDataSpecification right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs index 3f0120412..2d4b0289b 100644 --- a/src/IO.Swagger/Models/HasExtensions.cs +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasExtensions : IEquatable - { + { /// /// Gets or Sets Extensions /// - [DataMember(Name="extensions")] + [DataMember(Name = "extensions")] public List Extensions { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(HasExtensions other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Extensions == other.Extensions || Extensions != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Extensions != null) + if (Extensions != null) hashCode = hashCode * 59 + Extensions.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasExtensions left, HasExtensions right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs index bfc6dbf15..9f42763ec 100644 --- a/src/IO.Swagger/Models/HasSemantics.cs +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class HasSemantics : IEquatable - { + { /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -79,7 +73,7 @@ public bool Equals(HasSemantics other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( SemanticId == other.SemanticId || SemanticId != null && @@ -97,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(HasSemantics left, HasSemantics right) { @@ -116,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs index 486255b3f..c9bccffab 100644 --- a/src/IO.Swagger/Models/Identifiable.cs +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -7,30 +7,25 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Identifiable : Referable, IEquatable - { + { /// /// Gets or Sets Administration /// - [DataMember(Name="administration")] + [DataMember(Name = "administration")] public AdministrativeInformation Administration { get; set; } /// @@ -38,7 +33,7 @@ public partial class Identifiable : Referable, IEquatable /// [Required] - [DataMember(Name="identification")] + [DataMember(Name = "identification")] public string Identification { get; set; } /// @@ -59,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -86,12 +81,12 @@ public bool Equals(Identifiable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Administration == other.Administration || Administration != null && Administration.Equals(other.Administration) - ) && + ) && ( Identification == other.Identification || Identification != null && @@ -109,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Administration != null) + if (Administration != null) hashCode = hashCode * 59 + Administration.GetHashCode(); - if (Identification != null) + if (Identification != null) hashCode = hashCode * 59 + Identification.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Identifiable left, Identifiable right) { @@ -130,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs index e71676d8b..e2f40777b 100644 --- a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class IdentifierKeyValuePair : HasSemantics, IEquatable - { + { /// /// Gets or Sets Key /// [Required] - [DataMember(Name="key")] + [DataMember(Name = "key")] public string Key { get; set; } /// @@ -39,7 +34,7 @@ public partial class IdentifierKeyValuePair : HasSemantics, IEquatable [Required] - [DataMember(Name="subjectId")] + [DataMember(Name = "subjectId")] public Reference SubjectId { get; set; } /// @@ -47,7 +42,7 @@ public partial class IdentifierKeyValuePair : HasSemantics, IEquatable [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -69,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -96,17 +91,17 @@ public bool Equals(IdentifierKeyValuePair other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Key == other.Key || Key != null && Key.Equals(other.Key) - ) && + ) && ( SubjectId == other.SubjectId || SubjectId != null && SubjectId.Equals(other.SubjectId) - ) && + ) && ( Value == other.Value || Value != null && @@ -124,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Key != null) + if (Key != null) hashCode = hashCode * 59 + Key.GetHashCode(); - if (SubjectId != null) + if (SubjectId != null) hashCode = hashCode * 59 + SubjectId.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(IdentifierKeyValuePair left, IdentifierKeyValuePair right) { @@ -147,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs index eeed899eb..25c6aae9e 100644 --- a/src/IO.Swagger/Models/Key.cs +++ b/src/IO.Swagger/Models/Key.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Key : IEquatable - { + { /// /// Gets or Sets Type /// [Required] - [DataMember(Name="type")] + [DataMember(Name = "type")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasKeyElements Type { get; set; } public KeyElements Type { get; set; } @@ -41,7 +36,7 @@ public partial class Key : IEquatable /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// @@ -89,12 +84,12 @@ public bool Equals(Key other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Type == other.Type || Type != null && Type.Equals(other.Type) - ) && + ) && ( Value == other.Value || Value != null && @@ -112,16 +107,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Type != null) + if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Key left, Key right) { @@ -133,7 +128,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs index ab4fe4203..8411b8dbb 100644 --- a/src/IO.Swagger/Models/KeyElements.cs +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -7,138 +7,131 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets KeyElements - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum KeyElements - { - /// - /// Enum AssetAdministrationShellEnum for AssetAdministrationShell - /// - [EnumMember(Value = "AssetAdministrationShell")] - AssetAdministrationShellEnum = 0, - /// - /// Enum AccessPermissionRuleEnum for AccessPermissionRule - /// - [EnumMember(Value = "AccessPermissionRule")] - AccessPermissionRuleEnum = 1, - /// - /// Enum ConceptDescriptionEnum for ConceptDescription - /// - [EnumMember(Value = "ConceptDescription")] - ConceptDescriptionEnum = 2, - /// - /// Enum SubmodelEnum for Submodel - /// - [EnumMember(Value = "Submodel")] - SubmodelEnum = 3, - /// - /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement - /// - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElementEnum = 4, - /// - /// Enum BasicEventEnum for BasicEvent - /// - [EnumMember(Value = "BasicEvent")] - BasicEventEnum = 5, - /// - /// Enum BlobEnum for Blob - /// - [EnumMember(Value = "Blob")] - BlobEnum = 6, - /// - /// Enum CapabilityEnum for Capability - /// - [EnumMember(Value = "Capability")] - CapabilityEnum = 7, - /// - /// Enum DataElementEnum for DataElement - /// - [EnumMember(Value = "DataElement")] - DataElementEnum = 8, - /// - /// Enum FileEnum for File - /// - [EnumMember(Value = "File")] - FileEnum = 9, - /// - /// Enum EntityEnum for Entity - /// - [EnumMember(Value = "Entity")] - EntityEnum = 10, - /// - /// Enum EventEnum for Event - /// - [EnumMember(Value = "Event")] - EventEnum = 11, - /// - /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty - /// - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguagePropertyEnum = 12, - /// - /// Enum OperationEnum for Operation - /// - [EnumMember(Value = "Operation")] - OperationEnum = 13, - /// - /// Enum PropertyEnum for Property - /// - [EnumMember(Value = "Property")] - PropertyEnum = 14, - /// - /// Enum RangeEnum for Range - /// - [EnumMember(Value = "Range")] - RangeEnum = 15, - /// - /// Enum ReferenceElementEnum for ReferenceElement - /// - [EnumMember(Value = "ReferenceElement")] - ReferenceElementEnum = 16, - /// - /// Enum RelationshipElementEnum for RelationshipElement - /// - [EnumMember(Value = "RelationshipElement")] - RelationshipElementEnum = 17, - /// - /// Enum SubmodelElementEnum for SubmodelElement - /// - [EnumMember(Value = "SubmodelElement")] - SubmodelElementEnum = 18, - /// - /// Enum SubmodelElementListEnum for SubmodelElementList - /// - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementListEnum = 19, - /// - /// Enum SubmodelElementStructEnum for SubmodelElementStruct - /// - [EnumMember(Value = "SubmodelElementStruct")] - SubmodelElementStructEnum = 20, - /// - /// Enum ViewEnum for View - /// - [EnumMember(Value = "View")] - ViewEnum = 21, - /// - /// Enum FragmentReferenceEnum for FragmentReference - /// - [EnumMember(Value = "FragmentReference")] - FragmentReferenceEnum = 22 } +{ + /// + /// Gets or Sets KeyElements + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum KeyElements + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum AccessPermissionRuleEnum for AccessPermissionRule + /// + [EnumMember(Value = "AccessPermissionRule")] + AccessPermissionRuleEnum = 1, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 2, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 3, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 4, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 5, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 6, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 7, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 8, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 9, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 10, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 22 + } } diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs index 88d7f5203..436f236cb 100644 --- a/src/IO.Swagger/Models/LangString.cs +++ b/src/IO.Swagger/Models/LangString.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class LangString : IEquatable - { + { /// /// Gets or Sets Language /// [Required] - [DataMember(Name="language")] + [DataMember(Name = "language")] public string Language { get; set; } /// @@ -39,7 +34,7 @@ public partial class LangString : IEquatable /// [Required] - [DataMember(Name="text")] + [DataMember(Name = "text")] public string Text { get; set; } /// @@ -87,12 +82,12 @@ public bool Equals(LangString other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Language == other.Language || Language != null && Language.Equals(other.Language) - ) && + ) && ( Text == other.Text || Text != null && @@ -110,16 +105,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Language != null) + if (Language != null) hashCode = hashCode * 59 + Language.GetHashCode(); - if (Text != null) + if (Text != null) hashCode = hashCode * 59 + Text.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(LangString left, LangString right) { @@ -131,7 +126,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs index a638d02b6..a6ac1fdd5 100644 --- a/src/IO.Swagger/Models/LevelType.cs +++ b/src/IO.Swagger/Models/LevelType.cs @@ -7,43 +7,36 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets LevelType + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum LevelType + { + /// + /// Enum MinEnum for Min + /// + [EnumMember(Value = "Min")] + MinEnum = 0, + /// + /// Enum MaxEnum for Max + /// + [EnumMember(Value = "Max")] + MaxEnum = 1, + /// + /// Enum NomEnum for Nom + /// + [EnumMember(Value = "Nom")] + NomEnum = 2, /// - /// Gets or Sets LevelType + /// Enum TypEnum for Typ /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum LevelType - { - /// - /// Enum MinEnum for Min - /// - [EnumMember(Value = "Min")] - MinEnum = 0, - /// - /// Enum MaxEnum for Max - /// - [EnumMember(Value = "Max")] - MaxEnum = 1, - /// - /// Enum NomEnum for Nom - /// - [EnumMember(Value = "Nom")] - NomEnum = 2, - /// - /// Enum TypEnum for Typ - /// - [EnumMember(Value = "Typ")] - TypEnum = 3 } + [EnumMember(Value = "Typ")] + TypEnum = 3 + } } diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs index b83d19d4c..7f8b3e662 100644 --- a/src/IO.Swagger/Models/Message.cs +++ b/src/IO.Swagger/Models/Message.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Message : IEquatable - { + { /// /// Gets or Sets Code /// - [DataMember(Name="code")] + [DataMember(Name = "code")] public string Code { get; set; } /// @@ -63,27 +57,28 @@ public enum MessageTypeEnum /// Enum ExceptionEnum for Exception /// [EnumMember(Value = "Exception")] - ExceptionEnum = 4 } + ExceptionEnum = 4 + } /// /// Gets or Sets MessageType /// - [DataMember(Name="messageType")] + [DataMember(Name = "messageType")] public MessageTypeEnum? MessageType { get; set; } /// /// Gets or Sets Text /// - [DataMember(Name="text")] + [DataMember(Name = "text")] public string Text { get; set; } /// /// Gets or Sets Timestamp /// - [DataMember(Name="timestamp")] + [DataMember(Name = "timestamp")] public string Timestamp { get; set; } /// @@ -133,22 +128,22 @@ public bool Equals(Message other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Code == other.Code || Code != null && Code.Equals(other.Code) - ) && + ) && ( MessageType == other.MessageType || MessageType != null && MessageType.Equals(other.MessageType) - ) && + ) && ( Text == other.Text || Text != null && Text.Equals(other.Text) - ) && + ) && ( Timestamp == other.Timestamp || Timestamp != null && @@ -166,20 +161,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Code != null) + if (Code != null) hashCode = hashCode * 59 + Code.GetHashCode(); - if (MessageType != null) + if (MessageType != null) hashCode = hashCode * 59 + MessageType.GetHashCode(); - if (Text != null) + if (Text != null) hashCode = hashCode * 59 + Text.GetHashCode(); - if (Timestamp != null) + if (Timestamp != null) hashCode = hashCode * 59 + Timestamp.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Message left, Message right) { @@ -191,7 +186,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs index 49065b6ef..d44e568c8 100644 --- a/src/IO.Swagger/Models/ModelEvent.cs +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelEvent : SubmodelElement, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelEvent left, ModelEvent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs index a297f5f82..4bb50c07f 100644 --- a/src/IO.Swagger/Models/ModelReference.cs +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -7,30 +7,27 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelReference : Reference, IEquatable - { + { /// /// Gets or Sets ReferredSemanticId /// - [DataMember(Name="referredSemanticId")] + [DataMember(Name = "referredSemanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ReferredSemanticId { get; set; } public Reference ReferredSemanticId { get; set; } @@ -40,7 +37,7 @@ public partial class ModelReference : Reference, IEquatable /// [Required] - [DataMember(Name="keys")] + [DataMember(Name = "keys")] public List Keys { get; set; } /// @@ -61,7 +58,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -88,12 +85,12 @@ public bool Equals(ModelReference other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ReferredSemanticId == other.ReferredSemanticId || ReferredSemanticId != null && ReferredSemanticId.Equals(other.ReferredSemanticId) - ) && + ) && ( Keys == other.Keys || Keys != null && @@ -111,16 +108,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ReferredSemanticId != null) + if (ReferredSemanticId != null) hashCode = hashCode * 59 + ReferredSemanticId.GetHashCode(); - if (Keys != null) + if (Keys != null) hashCode = hashCode * 59 + Keys.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelReference left, ModelReference right) { @@ -132,7 +129,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs index b75e6b0f8..6b785aee2 100644 --- a/src/IO.Swagger/Models/ModelType.cs +++ b/src/IO.Swagger/Models/ModelType.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ModelType : IEquatable - { + { /// /// Gets or Sets Name /// [Required] - [DataMember(Name="name")] + [DataMember(Name = "name")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasModelTypes Name { get; set; } public ModelTypes Name { get; set; } @@ -80,7 +75,7 @@ public bool Equals(ModelType other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Name == other.Name || Name != null && @@ -98,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Name != null) + if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ModelType left, ModelType right) { @@ -117,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs index 2a7d418c9..80f71ca5e 100644 --- a/src/IO.Swagger/Models/ModelTypes.cs +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -7,158 +7,151 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets ModelTypes - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ModelTypes - { - /// - /// Enum AssetAdministrationShellEnum for AssetAdministrationShell - /// - [EnumMember(Value = "AssetAdministrationShell")] - AssetAdministrationShellEnum = 0, - /// - /// Enum ConceptDescriptionEnum for ConceptDescription - /// - [EnumMember(Value = "ConceptDescription")] - ConceptDescriptionEnum = 1, - /// - /// Enum SubmodelEnum for Submodel - /// - [EnumMember(Value = "Submodel")] - SubmodelEnum = 2, - /// - /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement - /// - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElementEnum = 3, - /// - /// Enum BasicEventEnum for BasicEvent - /// - [EnumMember(Value = "BasicEvent")] - BasicEventEnum = 4, - /// - /// Enum BlobEnum for Blob - /// - [EnumMember(Value = "Blob")] - BlobEnum = 5, - /// - /// Enum CapabilityEnum for Capability - /// - [EnumMember(Value = "Capability")] - CapabilityEnum = 6, - /// - /// Enum DataElementEnum for DataElement - /// - [EnumMember(Value = "DataElement")] - DataElementEnum = 7, - /// - /// Enum FileEnum for File - /// - [EnumMember(Value = "File")] - FileEnum = 8, - /// - /// Enum EntityEnum for Entity - /// - [EnumMember(Value = "Entity")] - EntityEnum = 9, - /// - /// Enum EventEnum for Event - /// - [EnumMember(Value = "Event")] - EventEnum = 10, - /// - /// Enum ModelReferenceEnum for ModelReference - /// - [EnumMember(Value = "ModelReference")] - ModelReferenceEnum = 11, - /// - /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty - /// - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguagePropertyEnum = 12, - /// - /// Enum OperationEnum for Operation - /// - [EnumMember(Value = "Operation")] - OperationEnum = 13, - /// - /// Enum PropertyEnum for Property - /// - [EnumMember(Value = "Property")] - PropertyEnum = 14, - /// - /// Enum RangeEnum for Range - /// - [EnumMember(Value = "Range")] - RangeEnum = 15, - /// - /// Enum ReferenceElementEnum for ReferenceElement - /// - [EnumMember(Value = "ReferenceElement")] - ReferenceElementEnum = 16, - /// - /// Enum RelationshipElementEnum for RelationshipElement - /// - [EnumMember(Value = "RelationshipElement")] - RelationshipElementEnum = 17, - /// - /// Enum SubmodelElementEnum for SubmodelElement - /// - [EnumMember(Value = "SubmodelElement")] - SubmodelElementEnum = 18, - /// - /// Enum SubmodelElementListEnum for SubmodelElementList - /// - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementListEnum = 19, - /// - /// Enum SubmodelElementStructEnum for SubmodelElementStruct - /// - [EnumMember(Value = "SubmodelElementStruct")] - SubmodelElementStructEnum = 20, - /// - /// Enum ViewEnum for View - /// - [EnumMember(Value = "View")] - ViewEnum = 21, - /// - /// Enum GlobalReferenceEnum for GlobalReference - /// - [EnumMember(Value = "GlobalReference")] - GlobalReferenceEnum = 22, - /// - /// Enum FragmentReferenceEnum for FragmentReference - /// - [EnumMember(Value = "FragmentReference")] - FragmentReferenceEnum = 23, - /// - /// Enum ConstraintEnum for Constraint - /// - [EnumMember(Value = "Constraint")] - ConstraintEnum = 24, - /// - /// Enum FormulaEnum for Formula - /// - [EnumMember(Value = "Formula")] - FormulaEnum = 25, - /// - /// Enum QualifierEnum for Qualifier - /// - [EnumMember(Value = "Qualifier")] - QualifierEnum = 26 } +{ + /// + /// Gets or Sets ModelTypes + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelTypes + { + /// + /// Enum AssetAdministrationShellEnum for AssetAdministrationShell + /// + [EnumMember(Value = "AssetAdministrationShell")] + AssetAdministrationShellEnum = 0, + /// + /// Enum ConceptDescriptionEnum for ConceptDescription + /// + [EnumMember(Value = "ConceptDescription")] + ConceptDescriptionEnum = 1, + /// + /// Enum SubmodelEnum for Submodel + /// + [EnumMember(Value = "Submodel")] + SubmodelEnum = 2, + /// + /// Enum AnnotatedRelationshipElementEnum for AnnotatedRelationshipElement + /// + [EnumMember(Value = "AnnotatedRelationshipElement")] + AnnotatedRelationshipElementEnum = 3, + /// + /// Enum BasicEventEnum for BasicEvent + /// + [EnumMember(Value = "BasicEvent")] + BasicEventEnum = 4, + /// + /// Enum BlobEnum for Blob + /// + [EnumMember(Value = "Blob")] + BlobEnum = 5, + /// + /// Enum CapabilityEnum for Capability + /// + [EnumMember(Value = "Capability")] + CapabilityEnum = 6, + /// + /// Enum DataElementEnum for DataElement + /// + [EnumMember(Value = "DataElement")] + DataElementEnum = 7, + /// + /// Enum FileEnum for File + /// + [EnumMember(Value = "File")] + FileEnum = 8, + /// + /// Enum EntityEnum for Entity + /// + [EnumMember(Value = "Entity")] + EntityEnum = 9, + /// + /// Enum EventEnum for Event + /// + [EnumMember(Value = "Event")] + EventEnum = 10, + /// + /// Enum ModelReferenceEnum for ModelReference + /// + [EnumMember(Value = "ModelReference")] + ModelReferenceEnum = 11, + /// + /// Enum MultiLanguagePropertyEnum for MultiLanguageProperty + /// + [EnumMember(Value = "MultiLanguageProperty")] + MultiLanguagePropertyEnum = 12, + /// + /// Enum OperationEnum for Operation + /// + [EnumMember(Value = "Operation")] + OperationEnum = 13, + /// + /// Enum PropertyEnum for Property + /// + [EnumMember(Value = "Property")] + PropertyEnum = 14, + /// + /// Enum RangeEnum for Range + /// + [EnumMember(Value = "Range")] + RangeEnum = 15, + /// + /// Enum ReferenceElementEnum for ReferenceElement + /// + [EnumMember(Value = "ReferenceElement")] + ReferenceElementEnum = 16, + /// + /// Enum RelationshipElementEnum for RelationshipElement + /// + [EnumMember(Value = "RelationshipElement")] + RelationshipElementEnum = 17, + /// + /// Enum SubmodelElementEnum for SubmodelElement + /// + [EnumMember(Value = "SubmodelElement")] + SubmodelElementEnum = 18, + /// + /// Enum SubmodelElementListEnum for SubmodelElementList + /// + [EnumMember(Value = "SubmodelElementList")] + SubmodelElementListEnum = 19, + /// + /// Enum SubmodelElementStructEnum for SubmodelElementStruct + /// + [EnumMember(Value = "SubmodelElementStruct")] + SubmodelElementStructEnum = 20, + /// + /// Enum ViewEnum for View + /// + [EnumMember(Value = "View")] + ViewEnum = 21, + /// + /// Enum GlobalReferenceEnum for GlobalReference + /// + [EnumMember(Value = "GlobalReference")] + GlobalReferenceEnum = 22, + /// + /// Enum FragmentReferenceEnum for FragmentReference + /// + [EnumMember(Value = "FragmentReference")] + FragmentReferenceEnum = 23, + /// + /// Enum ConstraintEnum for Constraint + /// + [EnumMember(Value = "Constraint")] + ConstraintEnum = 24, + /// + /// Enum FormulaEnum for Formula + /// + [EnumMember(Value = "Formula")] + FormulaEnum = 25, + /// + /// Enum QualifierEnum for Qualifier + /// + [EnumMember(Value = "Qualifier")] + QualifierEnum = 26 + } } diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs index 3aaf4f82e..6aa0183e5 100644 --- a/src/IO.Swagger/Models/ModelingKind.cs +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -7,33 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ +{ + /// + /// Gets or Sets ModelingKind + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ModelingKind + { + /// + /// Enum TemplateEnum for Template + /// + [EnumMember(Value = "Template")] + TemplateEnum = 0, /// - /// Gets or Sets ModelingKind + /// Enum InstanceEnum for Instance /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ModelingKind - { - /// - /// Enum TemplateEnum for Template - /// - [EnumMember(Value = "Template")] - TemplateEnum = 0, - /// - /// Enum InstanceEnum for Instance - /// - [EnumMember(Value = "Instance")] - InstanceEnum = 1 } + [EnumMember(Value = "Instance")] + InstanceEnum = 1 + } } diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs index 952db25c5..18bbd8992 100644 --- a/src/IO.Swagger/Models/MultiLanguageProperty.cs +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class MultiLanguageProperty : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] public Reference ValueId { get; set; } /// @@ -58,7 +54,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -85,12 +81,12 @@ public bool Equals(MultiLanguageProperty other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.SequenceEqual(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(MultiLanguageProperty left, MultiLanguageProperty right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs index 66fb952f5..3c09f5e23 100644 --- a/src/IO.Swagger/Models/ObjectAttributes.cs +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ObjectAttributes : IEquatable - { + { /// /// Gets or Sets ObjectAttribute /// - [DataMember(Name="objectAttribute")] + [DataMember(Name = "objectAttribute")] public List ObjectAttribute { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(ObjectAttributes other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ObjectAttribute == other.ObjectAttribute || ObjectAttribute != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ObjectAttribute != null) + if (ObjectAttribute != null) hashCode = hashCode * 59 + ObjectAttribute.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ObjectAttributes left, ObjectAttributes right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs index 1f33b2292..1b74da745 100644 --- a/src/IO.Swagger/Models/OneOfCertificate.cs +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfCertificate : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfCertificate left, OneOfCertificate right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs index a26901a55..e1a74771d 100644 --- a/src/IO.Swagger/Models/OneOfConstraint.cs +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfConstraint : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfConstraint left, OneOfConstraint right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs index f898be81d..dee5eafc8 100644 --- a/src/IO.Swagger/Models/OneOfDataElement.cs +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfDataElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfDataElement left, OneOfDataElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs index a7081005a..98c6cda04 100644 --- a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfDataSpecificationContent : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfDataSpecificationContent left, OneOfDataSpecificationContent right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs index 10cded410..eb1d1e3bc 100644 --- a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfOperationVariableValue : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfOperationVariableValue left, OneOfOperationVariableValue right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs index f92a58231..b74711b83 100644 --- a/src/IO.Swagger/Models/OneOfReference.cs +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfReference : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfReference left, OneOfReference right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs index b3c6d1148..4a354c283 100644 --- a/src/IO.Swagger/Models/OneOfSubmodelElement.cs +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OneOfSubmodelElement : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OneOfSubmodelElement left, OneOfSubmodelElement right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs index 78b7bd9ce..fe2a28372 100644 --- a/src/IO.Swagger/Models/Operation.cs +++ b/src/IO.Swagger/Models/Operation.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Operation : SubmodelElement, IEquatable - { + { /// /// Gets or Sets InoutputVariable /// - [DataMember(Name="inoutputVariable")] + [DataMember(Name = "inoutputVariable")] public List InoutputVariable { get; set; } /// /// Gets or Sets InputVariable /// - [DataMember(Name="inputVariable")] + [DataMember(Name = "inputVariable")] public List InputVariable { get; set; } /// /// Gets or Sets OutputVariable /// - [DataMember(Name="outputVariable")] + [DataMember(Name = "outputVariable")] public List OutputVariable { get; set; } /// @@ -66,7 +62,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -93,17 +89,17 @@ public bool Equals(Operation other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( InoutputVariable == other.InoutputVariable || InoutputVariable != null && InoutputVariable.SequenceEqual(other.InoutputVariable) - ) && + ) && ( InputVariable == other.InputVariable || InputVariable != null && InputVariable.SequenceEqual(other.InputVariable) - ) && + ) && ( OutputVariable == other.OutputVariable || OutputVariable != null && @@ -121,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (InoutputVariable != null) + if (InoutputVariable != null) hashCode = hashCode * 59 + InoutputVariable.GetHashCode(); - if (InputVariable != null) + if (InputVariable != null) hashCode = hashCode * 59 + InputVariable.GetHashCode(); - if (OutputVariable != null) + if (OutputVariable != null) hashCode = hashCode * 59 + OutputVariable.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Operation left, Operation right) { @@ -144,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationHandle.cs b/src/IO.Swagger/Models/OperationHandle.cs new file mode 100644 index 000000000..a048bff6d --- /dev/null +++ b/src/IO.Swagger/Models/OperationHandle.cs @@ -0,0 +1,19 @@ +namespace IO.Swagger.Models +{ + /// + /// The returned handle of an operation’s asynchronous invocation used to request the current state of the operation’s execution. + /// + public partial class OperationHandle + { + /// + /// Client Request Id + /// + public string RequestId { get; set; } + /// + /// Handle id + /// + public string HandleId { get; set; } + + + } +} diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs index 7201d0be6..6e1536833 100644 --- a/src/IO.Swagger/Models/OperationRequest.cs +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -7,51 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationRequest : IEquatable - { + { /// /// Gets or Sets InoutputArguments /// - [DataMember(Name="inoutputArguments")] + [DataMember(Name = "inoutputArguments")] public List InoutputArguments { get; set; } /// /// Gets or Sets InputArguments /// - [DataMember(Name="inputArguments")] + [DataMember(Name = "inputArguments")] public List InputArguments { get; set; } /// /// Gets or Sets RequestId /// - [DataMember(Name="requestId")] + [DataMember(Name = "requestId")] public string RequestId { get; set; } /// /// Gets or Sets Timeout /// - [DataMember(Name="timeout")] + [DataMember(Name = "timeout")] public int? Timeout { get; set; } /// @@ -101,22 +97,22 @@ public bool Equals(OperationRequest other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( InoutputArguments == other.InoutputArguments || InoutputArguments != null && InoutputArguments.SequenceEqual(other.InoutputArguments) - ) && + ) && ( InputArguments == other.InputArguments || InputArguments != null && InputArguments.SequenceEqual(other.InputArguments) - ) && + ) && ( RequestId == other.RequestId || RequestId != null && RequestId.Equals(other.RequestId) - ) && + ) && ( Timeout == other.Timeout || Timeout != null && @@ -134,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (InoutputArguments != null) + if (InoutputArguments != null) hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); - if (InputArguments != null) + if (InputArguments != null) hashCode = hashCode * 59 + InputArguments.GetHashCode(); - if (RequestId != null) + if (RequestId != null) hashCode = hashCode * 59 + RequestId.GetHashCode(); - if (Timeout != null) + if (Timeout != null) hashCode = hashCode * 59 + Timeout.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationRequest left, OperationRequest right) { @@ -159,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs index a443d7e69..46ac8532d 100644 --- a/src/IO.Swagger/Models/OperationResult.cs +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationResult : IEquatable - { + { /// /// Gets or Sets ExecutionResult /// - [DataMember(Name="executionResult")] + [DataMember(Name = "executionResult")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasResult ExecutionResult { get; set; } public Result ExecutionResult { get; set; } @@ -70,34 +66,35 @@ public enum ExecutionStateEnum /// Enum TimeoutEnum for Timeout /// [EnumMember(Value = "Timeout")] - TimeoutEnum = 5 } + TimeoutEnum = 5 + } /// /// Gets or Sets ExecutionState /// - [DataMember(Name="executionState")] + [DataMember(Name = "executionState")] public ExecutionStateEnum? ExecutionState { get; set; } /// /// Gets or Sets InoutputArguments /// - [DataMember(Name="inoutputArguments")] + [DataMember(Name = "inoutputArguments")] public List InoutputArguments { get; set; } /// /// Gets or Sets OutputArguments /// - [DataMember(Name="outputArguments")] + [DataMember(Name = "outputArguments")] public List OutputArguments { get; set; } /// /// Gets or Sets RequestId /// - [DataMember(Name="requestId")] + [DataMember(Name = "requestId")] public string RequestId { get; set; } /// @@ -148,27 +145,27 @@ public bool Equals(OperationResult other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExecutionResult == other.ExecutionResult || ExecutionResult != null && ExecutionResult.Equals(other.ExecutionResult) - ) && + ) && ( ExecutionState == other.ExecutionState || ExecutionState != null && ExecutionState.Equals(other.ExecutionState) - ) && + ) && ( InoutputArguments == other.InoutputArguments || InoutputArguments != null && InoutputArguments.SequenceEqual(other.InoutputArguments) - ) && + ) && ( OutputArguments == other.OutputArguments || OutputArguments != null && OutputArguments.SequenceEqual(other.OutputArguments) - ) && + ) && ( RequestId == other.RequestId || RequestId != null && @@ -186,22 +183,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExecutionResult != null) + if (ExecutionResult != null) hashCode = hashCode * 59 + ExecutionResult.GetHashCode(); - if (ExecutionState != null) + if (ExecutionState != null) hashCode = hashCode * 59 + ExecutionState.GetHashCode(); - if (InoutputArguments != null) + if (InoutputArguments != null) hashCode = hashCode * 59 + InoutputArguments.GetHashCode(); - if (OutputArguments != null) + if (OutputArguments != null) hashCode = hashCode * 59 + OutputArguments.GetHashCode(); - if (RequestId != null) + if (RequestId != null) hashCode = hashCode * 59 + RequestId.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationResult left, OperationResult right) { @@ -213,7 +210,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs index 1bb9242d3..d8a0c2e37 100644 --- a/src/IO.Swagger/Models/OperationVariable.cs +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class OperationVariable : IEquatable - { + { /// /// Gets or Sets Value /// [Required] - [DataMember(Name="value")] + [DataMember(Name = "value")] public OneOfOperationVariableValue Value { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(OperationVariable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(OperationVariable left, OperationVariable right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs index 3df8196a2..3215153ba 100644 --- a/src/IO.Swagger/Models/Permission.cs +++ b/src/IO.Swagger/Models/Permission.cs @@ -7,25 +7,20 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Permission : IEquatable - { + { /// /// Gets or Sets KindOfPermission /// @@ -51,14 +46,15 @@ public enum KindOfPermissionEnum /// Enum UndefinedEnum for Undefined /// [EnumMember(Value = "Undefined")] - UndefinedEnum = 3 } + UndefinedEnum = 3 + } /// /// Gets or Sets KindOfPermission /// [Required] - [DataMember(Name="kindOfPermission")] + [DataMember(Name = "kindOfPermission")] public KindOfPermissionEnum? KindOfPermission { get; set; } /// @@ -66,7 +62,7 @@ public enum KindOfPermissionEnum /// [Required] - [DataMember(Name="permission")] + [DataMember(Name = "permission")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Permission { get; set; } public Reference _Permission { get; set; } @@ -116,12 +112,12 @@ public bool Equals(Permission other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( KindOfPermission == other.KindOfPermission || KindOfPermission != null && KindOfPermission.Equals(other.KindOfPermission) - ) && + ) && ( _Permission == other._Permission || _Permission != null && @@ -139,16 +135,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (KindOfPermission != null) + if (KindOfPermission != null) hashCode = hashCode * 59 + KindOfPermission.GetHashCode(); - if (_Permission != null) + if (_Permission != null) hashCode = hashCode * 59 + _Permission.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Permission left, Permission right) { @@ -160,7 +156,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs index e4604d13c..af7c828fd 100644 --- a/src/IO.Swagger/Models/PermissionsPerObject.cs +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PermissionsPerObject : IEquatable - { + { /// /// Gets or Sets _Object /// - [DataMember(Name="object")] + [DataMember(Name = "object")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference _Object { get; set; } public Reference _Object { get; set; } @@ -39,14 +35,14 @@ public partial class PermissionsPerObject : IEquatable /// Gets or Sets Permission /// - [DataMember(Name="permission")] + [DataMember(Name = "permission")] public List Permission { get; set; } /// /// Gets or Sets TargetObjectAttributes /// - [DataMember(Name="targetObjectAttributes")] + [DataMember(Name = "targetObjectAttributes")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasObjectAttributes TargetObjectAttributes { get; set; } public ObjectAttributes TargetObjectAttributes { get; set; } @@ -97,17 +93,17 @@ public bool Equals(PermissionsPerObject other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _Object == other._Object || _Object != null && _Object.Equals(other._Object) - ) && + ) && ( Permission == other.Permission || Permission != null && Permission.SequenceEqual(other.Permission) - ) && + ) && ( TargetObjectAttributes == other.TargetObjectAttributes || TargetObjectAttributes != null && @@ -125,18 +121,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_Object != null) + if (_Object != null) hashCode = hashCode * 59 + _Object.GetHashCode(); - if (Permission != null) + if (Permission != null) hashCode = hashCode * 59 + Permission.GetHashCode(); - if (TargetObjectAttributes != null) + if (TargetObjectAttributes != null) hashCode = hashCode * 59 + TargetObjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PermissionsPerObject left, PermissionsPerObject right) { @@ -148,7 +144,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs index c5224f43e..a5bad16e1 100644 --- a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -7,38 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyAdministrationPoint : IEquatable - { + { /// /// Gets or Sets ExternalAccessControl /// [Required] - [DataMember(Name="externalAccessControl")] + [DataMember(Name = "externalAccessControl")] public bool? ExternalAccessControl { get; set; } /// /// Gets or Sets LocalAccessControl /// - [DataMember(Name="localAccessControl")] + [DataMember(Name = "localAccessControl")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControl LocalAccessControl { get; set; } public AccessControl LocalAccessControl { get; set; } @@ -88,12 +83,12 @@ public bool Equals(PolicyAdministrationPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalAccessControl == other.ExternalAccessControl || ExternalAccessControl != null && ExternalAccessControl.Equals(other.ExternalAccessControl) - ) && + ) && ( LocalAccessControl == other.LocalAccessControl || LocalAccessControl != null && @@ -111,16 +106,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalAccessControl != null) + if (ExternalAccessControl != null) hashCode = hashCode * 59 + ExternalAccessControl.GetHashCode(); - if (LocalAccessControl != null) + if (LocalAccessControl != null) hashCode = hashCode * 59 + LocalAccessControl.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyAdministrationPoint left, PolicyAdministrationPoint right) { @@ -132,7 +127,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs index 736a37c49..16380b049 100644 --- a/src/IO.Swagger/Models/PolicyDecisionPoint.cs +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyDecisionPoint : IEquatable - { + { /// /// Gets or Sets ExternalPolicyDecisionPoints /// [Required] - [DataMember(Name="externalPolicyDecisionPoints")] + [DataMember(Name = "externalPolicyDecisionPoints")] public bool? ExternalPolicyDecisionPoints { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(PolicyDecisionPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalPolicyDecisionPoints == other.ExternalPolicyDecisionPoints || ExternalPolicyDecisionPoints != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalPolicyDecisionPoints != null) + if (ExternalPolicyDecisionPoints != null) hashCode = hashCode * 59 + ExternalPolicyDecisionPoints.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyDecisionPoint left, PolicyDecisionPoint right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs index 97f2ed0d3..99d4742c2 100644 --- a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyEnforcementPoint : IEquatable - { + { /// /// Gets or Sets ExternalPolicyEnforcementPoint /// [Required] - [DataMember(Name="externalPolicyEnforcementPoint")] + [DataMember(Name = "externalPolicyEnforcementPoint")] public bool? ExternalPolicyEnforcementPoint { get; set; } /// @@ -78,7 +73,7 @@ public bool Equals(PolicyEnforcementPoint other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalPolicyEnforcementPoint == other.ExternalPolicyEnforcementPoint || ExternalPolicyEnforcementPoint != null && @@ -96,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalPolicyEnforcementPoint != null) + if (ExternalPolicyEnforcementPoint != null) hashCode = hashCode * 59 + ExternalPolicyEnforcementPoint.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyEnforcementPoint left, PolicyEnforcementPoint right) { @@ -115,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs index 6cbe41c71..134741e2a 100644 --- a/src/IO.Swagger/Models/PolicyInformationPoints.cs +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -7,38 +7,35 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class PolicyInformationPoints : IEquatable - { + { /// /// Gets or Sets ExternalInformationPoint /// [Required] - [DataMember(Name="externalInformationPoint")] + [DataMember(Name = "externalInformationPoint")] public bool? ExternalInformationPoint { get; set; } /// /// Gets or Sets InternalInformationPoint /// - [DataMember(Name="internalInformationPoint")] + [DataMember(Name = "internalInformationPoint")] public List InternalInformationPoint { get; set; } /// @@ -86,12 +83,12 @@ public bool Equals(PolicyInformationPoints other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ExternalInformationPoint == other.ExternalInformationPoint || ExternalInformationPoint != null && ExternalInformationPoint.Equals(other.ExternalInformationPoint) - ) && + ) && ( InternalInformationPoint == other.InternalInformationPoint || InternalInformationPoint != null && @@ -109,16 +106,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ExternalInformationPoint != null) + if (ExternalInformationPoint != null) hashCode = hashCode * 59 + ExternalInformationPoint.GetHashCode(); - if (InternalInformationPoint != null) + if (InternalInformationPoint != null) hashCode = hashCode * 59 + InternalInformationPoint.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(PolicyInformationPoints left, PolicyInformationPoints right) { @@ -130,7 +127,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs index 0c2eef1dd..78b8b316e 100644 --- a/src/IO.Swagger/Models/Property.cs +++ b/src/IO.Swagger/Models/Property.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Property : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +40,7 @@ public partial class Property : SubmodelElement, IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -70,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -97,17 +91,17 @@ public bool Equals(Property other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -125,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Property left, Property right) { @@ -148,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs index 91093fcaf..f2c610ef8 100644 --- a/src/IO.Swagger/Models/Qualifiable.cs +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Qualifiable : IEquatable - { + { /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(Qualifiable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Qualifiers == other.Qualifiers || Qualifiers != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Qualifiable left, Qualifiable right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs index 229d0ab9d..f0c5efae5 100644 --- a/src/IO.Swagger/Models/Qualifier.cs +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -7,37 +7,32 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Qualifier : HasSemantics, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +41,7 @@ public partial class Qualifier : HasSemantics, IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -56,7 +51,7 @@ public partial class Qualifier : HasSemantics, IEquatable /// [Required] - [DataMember(Name="type")] + [DataMember(Name = "type")] public string Type { get; set; } /// @@ -79,7 +74,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -106,22 +101,22 @@ public bool Equals(Qualifier other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && ValueType.Equals(other.ValueType) - ) && + ) && ( Type == other.Type || Type != null && @@ -139,20 +134,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); - if (Type != null) + if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Qualifier left, Qualifier right) { @@ -164,7 +159,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs index db644e080..793b60112 100644 --- a/src/IO.Swagger/Models/Range.cs +++ b/src/IO.Swagger/Models/Range.cs @@ -7,37 +7,32 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Range : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Max /// - [DataMember(Name="max")] + [DataMember(Name = "max")] public string Max { get; set; } /// /// Gets or Sets Min /// - [DataMember(Name="min")] + [DataMember(Name = "min")] public string Min { get; set; } /// @@ -45,7 +40,7 @@ public partial class Range : SubmodelElement, IEquatable /// [Required] - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] public ValueTypeEnum ValueType { get; set; } /// @@ -67,7 +62,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -94,17 +89,17 @@ public bool Equals(Range other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Max == other.Max || Max != null && Max.Equals(other.Max) - ) && + ) && ( Min == other.Min || Min != null && Min.Equals(other.Min) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -122,18 +117,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Max != null) + if (Max != null) hashCode = hashCode * 59 + Max.GetHashCode(); - if (Min != null) + if (Min != null) hashCode = hashCode * 59 + Min.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Range left, Range right) { @@ -145,7 +140,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs index 3528845d5..f2f646d3f 100644 --- a/src/IO.Swagger/Models/Referable.cs +++ b/src/IO.Swagger/Models/Referable.cs @@ -7,44 +7,41 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Referable : HasExtensions, IEquatable - { + { /// /// Gets or Sets Category /// - [DataMember(Name="category")] + [DataMember(Name = "category")] public string Category { get; set; } /// /// Gets or Sets Description /// - [DataMember(Name="description")] + [DataMember(Name = "description")] public List Description { get; set; } /// /// Gets or Sets DisplayName /// - [DataMember(Name="displayName")] + [DataMember(Name = "displayName")] public string DisplayName { get; set; } /// @@ -52,7 +49,7 @@ public partial class Referable : HasExtensions, IEquatable /// [Required] - [DataMember(Name="idShort")] + [DataMember(Name = "idShort")] public string IdShort { get; set; } /// @@ -60,7 +57,7 @@ public partial class Referable : HasExtensions, IEquatable /// [Required] - [DataMember(Name="modelType")] + [DataMember(Name = "modelType")] public ModelType ModelType { get; set; } /// @@ -84,7 +81,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -111,27 +108,27 @@ public bool Equals(Referable other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Category == other.Category || Category != null && Category.Equals(other.Category) - ) && + ) && ( Description == other.Description || Description != null && Description.SequenceEqual(other.Description) - ) && + ) && ( DisplayName == other.DisplayName || DisplayName != null && DisplayName.Equals(other.DisplayName) - ) && + ) && ( IdShort == other.IdShort || IdShort != null && IdShort.Equals(other.IdShort) - ) && + ) && ( ModelType == other.ModelType || ModelType != null && @@ -149,22 +146,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Category != null) + if (Category != null) hashCode = hashCode * 59 + Category.GetHashCode(); - if (Description != null) + if (Description != null) hashCode = hashCode * 59 + Description.GetHashCode(); - if (DisplayName != null) + if (DisplayName != null) hashCode = hashCode * 59 + DisplayName.GetHashCode(); - if (IdShort != null) + if (IdShort != null) hashCode = hashCode * 59 + IdShort.GetHashCode(); - if (ModelType != null) + if (ModelType != null) hashCode = hashCode * 59 + ModelType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Referable left, Referable right) { @@ -176,7 +173,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs index 8ef828da3..c03e3f40f 100644 --- a/src/IO.Swagger/Models/Reference.cs +++ b/src/IO.Swagger/Models/Reference.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Reference : IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Reference left, Reference right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs index 29583b3c2..7d0f2fc80 100644 --- a/src/IO.Swagger/Models/ReferenceElement.cs +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ReferenceElement : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public Reference Value { get; set; } /// @@ -50,7 +44,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -77,7 +71,7 @@ public bool Equals(ReferenceElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -95,14 +89,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ReferenceElement left, ReferenceElement right) { @@ -114,7 +108,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs index 10ae5a544..026c4943b 100644 --- a/src/IO.Swagger/Models/RelationshipElement.cs +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -7,31 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class RelationshipElement : SubmodelElement, IEquatable - { + { /// /// Gets or Sets First /// [Required] - [DataMember(Name="first")] + [DataMember(Name = "first")] public Reference First { get; set; } /// @@ -39,7 +34,7 @@ public partial class RelationshipElement : SubmodelElement, IEquatable [Required] - [DataMember(Name="second")] + [DataMember(Name = "second")] public Reference Second { get; set; } /// @@ -60,7 +55,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,12 +82,12 @@ public bool Equals(RelationshipElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( First == other.First || First != null && First.Equals(other.First) - ) && + ) && ( Second == other.Second || Second != null && @@ -110,16 +105,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (First != null) + if (First != null) hashCode = hashCode * 59 + First.GetHashCode(); - if (Second != null) + if (Second != null) hashCode = hashCode * 59 + Second.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(RelationshipElement left, RelationshipElement right) { @@ -131,7 +126,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs index c5ccfb1ce..bcc0ecab2 100644 --- a/src/IO.Swagger/Models/Result.cs +++ b/src/IO.Swagger/Models/Result.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Result : IEquatable - { + { /// /// Gets or Sets Messages /// - [DataMember(Name="messages")] + [DataMember(Name = "messages")] public List Messages { get; set; } /// /// Gets or Sets Success /// - [DataMember(Name="success")] + [DataMember(Name = "success")] public bool? Success { get; set; } /// @@ -85,12 +81,12 @@ public bool Equals(Result other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Messages == other.Messages || Messages != null && Messages.SequenceEqual(other.Messages) - ) && + ) && ( Success == other.Success || Success != null && @@ -108,16 +104,16 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Messages != null) + if (Messages != null) hashCode = hashCode * 59 + Messages.GetHashCode(); - if (Success != null) + if (Success != null) hashCode = hashCode * 59 + Success.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Result left, Result right) { @@ -129,7 +125,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs index 2db4764ee..4b83b4d6e 100644 --- a/src/IO.Swagger/Models/Security.cs +++ b/src/IO.Swagger/Models/Security.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Security : IEquatable - { + { /// /// Gets or Sets AccessControlPolicyPoints /// [Required] - [DataMember(Name="accessControlPolicyPoints")] + [DataMember(Name = "accessControlPolicyPoints")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasAccessControlPolicyPoints AccessControlPolicyPoints { get; set; } public AccessControlPolicyPoints AccessControlPolicyPoints { get; set; } @@ -40,14 +37,14 @@ public partial class Security : IEquatable /// Gets or Sets Certificate /// - [DataMember(Name="certificate")] + [DataMember(Name = "certificate")] public List Certificate { get; set; } /// /// Gets or Sets RequiredCertificateExtension /// - [DataMember(Name="requiredCertificateExtension")] + [DataMember(Name = "requiredCertificateExtension")] public List RequiredCertificateExtension { get; set; } /// @@ -96,17 +93,17 @@ public bool Equals(Security other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( AccessControlPolicyPoints == other.AccessControlPolicyPoints || AccessControlPolicyPoints != null && AccessControlPolicyPoints.Equals(other.AccessControlPolicyPoints) - ) && + ) && ( Certificate == other.Certificate || Certificate != null && Certificate.SequenceEqual(other.Certificate) - ) && + ) && ( RequiredCertificateExtension == other.RequiredCertificateExtension || RequiredCertificateExtension != null && @@ -124,18 +121,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (AccessControlPolicyPoints != null) + if (AccessControlPolicyPoints != null) hashCode = hashCode * 59 + AccessControlPolicyPoints.GetHashCode(); - if (Certificate != null) + if (Certificate != null) hashCode = hashCode * 59 + Certificate.GetHashCode(); - if (RequiredCertificateExtension != null) + if (RequiredCertificateExtension != null) hashCode = hashCode * 59 + RequiredCertificateExtension.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Security left, Security right) { @@ -147,7 +144,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs index 6e30f03b8..2f3470763 100644 --- a/src/IO.Swagger/Models/SubjectAttributes.cs +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -7,30 +7,26 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubjectAttributes : IEquatable - { + { /// /// Gets or Sets _SubjectAttributes /// - [DataMember(Name="subjectAttributes")] + [DataMember(Name = "subjectAttributes")] public List _SubjectAttributes { get; set; } /// @@ -77,7 +73,7 @@ public bool Equals(SubjectAttributes other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( _SubjectAttributes == other._SubjectAttributes || _SubjectAttributes != null && @@ -95,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (_SubjectAttributes != null) + if (_SubjectAttributes != null) hashCode = hashCode * 59 + _SubjectAttributes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubjectAttributes left, SubjectAttributes right) { @@ -114,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs index 6d686a7ff..3daa131ec 100644 --- a/src/IO.Swagger/Models/Submodel.cs +++ b/src/IO.Swagger/Models/Submodel.cs @@ -7,44 +7,40 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class Submodel : Identifiable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -53,14 +49,14 @@ public partial class Submodel : Identifiable, IEquatable /// Gets or Sets Kind /// - [DataMember(Name="kind")] + [DataMember(Name = "kind")] public ModelingKind Kind { get; set; } /// /// Gets or Sets SubmodelElements /// - [DataMember(Name="submodelElements")] + [DataMember(Name = "submodelElements")] public List SubmodelElements { get; set; } /// @@ -84,7 +80,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -111,27 +107,27 @@ public bool Equals(Submodel other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( Kind == other.Kind || Kind != null && Kind.Equals(other.Kind) - ) && + ) && ( SubmodelElements == other.SubmodelElements || SubmodelElements != null && @@ -149,22 +145,22 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (Kind != null) + if (Kind != null) hashCode = hashCode * 59 + Kind.GetHashCode(); - if (SubmodelElements != null) + if (SubmodelElements != null) hashCode = hashCode * 59 + SubmodelElements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(Submodel left, Submodel right) { @@ -176,7 +172,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs index a2f20eb03..4a6af08b9 100644 --- a/src/IO.Swagger/Models/SubmodelElement.cs +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElement : Referable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -46,14 +42,14 @@ public partial class SubmodelElement : Referable, IEquatable /// Gets or Sets Qualifiers /// - [DataMember(Name="qualifiers")] + [DataMember(Name = "qualifiers")] public List Qualifiers { get; set; } /// /// Gets or Sets Kind /// - [DataMember(Name="kind")] + [DataMember(Name = "kind")] public ModelingKind Kind { get; set; } /// @@ -76,7 +72,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -103,22 +99,22 @@ public bool Equals(SubmodelElement other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( Qualifiers == other.Qualifiers || Qualifiers != null && Qualifiers.SequenceEqual(other.Qualifiers) - ) && + ) && ( Kind == other.Kind || Kind != null && @@ -136,20 +132,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (Qualifiers != null) + if (Qualifiers != null) hashCode = hashCode * 59 + Qualifiers.GetHashCode(); - if (Kind != null) + if (Kind != null) hashCode = hashCode * 59 + Kind.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElement left, SubmodelElement right) { @@ -161,7 +157,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs index 3e2e75550..f6e3d7b80 100644 --- a/src/IO.Swagger/Models/SubmodelElementList.cs +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -7,51 +7,47 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElementList : SubmodelElement, IEquatable - { + { /// /// Gets or Sets SemanticIdValues /// - [DataMember(Name="semanticIdValues")] + [DataMember(Name = "semanticIdValues")] public Reference SemanticIdValues { get; set; } /// /// Gets or Sets SubmodelElementTypeValues /// - [DataMember(Name="submodelElementTypeValues")] + [DataMember(Name = "submodelElementTypeValues")] public ModelType SubmodelElementTypeValues { get; set; } /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public List Value { get; set; } /// /// Gets or Sets ValueTypeValues /// - [DataMember(Name="valueTypeValues")] + [DataMember(Name = "valueTypeValues")] public ValueTypeEnum ValueTypeValues { get; set; } /// @@ -74,7 +70,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -101,22 +97,22 @@ public bool Equals(SubmodelElementList other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( SemanticIdValues == other.SemanticIdValues || SemanticIdValues != null && SemanticIdValues.Equals(other.SemanticIdValues) - ) && + ) && ( SubmodelElementTypeValues == other.SubmodelElementTypeValues || SubmodelElementTypeValues != null && SubmodelElementTypeValues.Equals(other.SubmodelElementTypeValues) - ) && + ) && ( Value == other.Value || Value != null && Value.SequenceEqual(other.Value) - ) && + ) && ( ValueTypeValues == other.ValueTypeValues || ValueTypeValues != null && @@ -134,20 +130,20 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (SemanticIdValues != null) + if (SemanticIdValues != null) hashCode = hashCode * 59 + SemanticIdValues.GetHashCode(); - if (SubmodelElementTypeValues != null) + if (SubmodelElementTypeValues != null) hashCode = hashCode * 59 + SubmodelElementTypeValues.GetHashCode(); - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueTypeValues != null) + if (ValueTypeValues != null) hashCode = hashCode * 59 + ValueTypeValues.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElementList left, SubmodelElementList right) { @@ -159,7 +155,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs index a08559806..4c7c99b89 100644 --- a/src/IO.Swagger/Models/SubmodelElementStruct.cs +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -7,30 +7,24 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class SubmodelElementStruct : SubmodelElement, IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasSubmodelElement Value { get; set; } public SubmodelElement Value { get; set; } @@ -52,7 +46,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -79,7 +73,7 @@ public bool Equals(SubmodelElementStruct other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && @@ -97,14 +91,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(SubmodelElementStruct left, SubmodelElementStruct right) { @@ -116,7 +110,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs index 8308d84f8..1c5e676ef 100644 --- a/src/IO.Swagger/Models/ValueList.cs +++ b/src/IO.Swagger/Models/ValueList.cs @@ -7,31 +7,28 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueList : IEquatable - { + { /// /// Gets or Sets ValueReferencePairTypes /// [Required] - [DataMember(Name="valueReferencePairTypes")] + [DataMember(Name = "valueReferencePairTypes")] public List ValueReferencePairTypes { get; set; } /// @@ -78,7 +75,7 @@ public bool Equals(ValueList other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( ValueReferencePairTypes == other.ValueReferencePairTypes || ValueReferencePairTypes != null && @@ -96,14 +93,14 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (ValueReferencePairTypes != null) + if (ValueReferencePairTypes != null) hashCode = hashCode * 59 + ValueReferencePairTypes.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueList left, ValueList right) { @@ -115,7 +112,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs index bbb677815..9cf0ad5ca 100644 --- a/src/IO.Swagger/Models/ValueObject.cs +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -7,37 +7,31 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueObject : IEquatable - { + { /// /// Gets or Sets Value /// - [DataMember(Name="value")] + [DataMember(Name = "value")] public string Value { get; set; } /// /// Gets or Sets ValueId /// - [DataMember(Name="valueId")] + [DataMember(Name = "valueId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference ValueId { get; set; } public Reference ValueId { get; set; } @@ -46,7 +40,7 @@ public partial class ValueObject : IEquatable /// Gets or Sets ValueType /// - [DataMember(Name="valueType")] + [DataMember(Name = "valueType")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasValueTypeEnum ValueType { get; set; } public ValueTypeEnum ValueType { get; set; } @@ -97,17 +91,17 @@ public bool Equals(ValueObject other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( Value == other.Value || Value != null && Value.Equals(other.Value) - ) && + ) && ( ValueId == other.ValueId || ValueId != null && ValueId.Equals(other.ValueId) - ) && + ) && ( ValueType == other.ValueType || ValueType != null && @@ -125,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Value != null) + if (Value != null) hashCode = hashCode * 59 + Value.GetHashCode(); - if (ValueId != null) + if (ValueId != null) hashCode = hashCode * 59 + ValueId.GetHashCode(); - if (ValueType != null) + if (ValueType != null) hashCode = hashCode * 59 + ValueType.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueObject left, ValueObject right) { @@ -148,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs index af6705d11..c55a081e6 100644 --- a/src/IO.Swagger/Models/ValueReferencePairType.cs +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -7,25 +7,19 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class ValueReferencePairType : ValueObject, IEquatable - { + { /// /// Returns the string presentation of the object /// @@ -42,7 +36,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -87,7 +81,7 @@ public override int GetHashCode() } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(ValueReferencePairType left, ValueReferencePairType right) { @@ -99,7 +93,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs index a573295c3..fea2b2eee 100644 --- a/src/IO.Swagger/Models/ValueTypeEnum.cs +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -7,243 +7,236 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; +using System.Runtime.Serialization; namespace IO.Swagger.Models -{ - /// - /// Gets or Sets ValueTypeEnum - /// - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum ValueTypeEnum - { - /// - /// Enum AnyUriEnum for anyUri - /// - [EnumMember(Value = "anyUri")] - AnyUriEnum = 0, - /// - /// Enum Base64BinaryEnum for base64Binary - /// - [EnumMember(Value = "base64Binary")] - Base64BinaryEnum = 1, - /// - /// Enum BooleanEnum for boolean - /// - [EnumMember(Value = "boolean")] - BooleanEnum = 2, - /// - /// Enum DateEnum for date - /// - [EnumMember(Value = "date")] - DateEnum = 3, - /// - /// Enum DateTimeEnum for dateTime - /// - [EnumMember(Value = "dateTime")] - DateTimeEnum = 4, - /// - /// Enum DateTimeStampEnum for dateTimeStamp - /// - [EnumMember(Value = "dateTimeStamp")] - DateTimeStampEnum = 5, - /// - /// Enum DecimalEnum for decimal - /// - [EnumMember(Value = "decimal")] - DecimalEnum = 6, - /// - /// Enum IntegerEnum for integer - /// - [EnumMember(Value = "integer")] - IntegerEnum = 7, - /// - /// Enum LongEnum for long - /// - [EnumMember(Value = "long")] - LongEnum = 8, - /// - /// Enum IntEnum for int - /// - [EnumMember(Value = "int")] - IntEnum = 9, - /// - /// Enum ShortEnum for short - /// - [EnumMember(Value = "short")] - ShortEnum = 10, - /// - /// Enum ByteEnum for byte - /// - [EnumMember(Value = "byte")] - ByteEnum = 11, - /// - /// Enum NonNegativeIntegerEnum for nonNegativeInteger - /// - [EnumMember(Value = "nonNegativeInteger")] - NonNegativeIntegerEnum = 12, - /// - /// Enum PositiveIntegerEnum for positiveInteger - /// - [EnumMember(Value = "positiveInteger")] - PositiveIntegerEnum = 13, - /// - /// Enum UnsignedLongEnum for unsignedLong - /// - [EnumMember(Value = "unsignedLong")] - UnsignedLongEnum = 14, - /// - /// Enum UnsignedIntEnum for unsignedInt - /// - [EnumMember(Value = "unsignedInt")] - UnsignedIntEnum = 15, - /// - /// Enum UnsignedShortEnum for unsignedShort - /// - [EnumMember(Value = "unsignedShort")] - UnsignedShortEnum = 16, - /// - /// Enum UnsignedByteEnum for unsignedByte - /// - [EnumMember(Value = "unsignedByte")] - UnsignedByteEnum = 17, - /// - /// Enum NonPositiveIntegerEnum for nonPositiveInteger - /// - [EnumMember(Value = "nonPositiveInteger")] - NonPositiveIntegerEnum = 18, - /// - /// Enum NegativeIntegerEnum for negativeInteger - /// - [EnumMember(Value = "negativeInteger")] - NegativeIntegerEnum = 19, - /// - /// Enum DoubleEnum for double - /// - [EnumMember(Value = "double")] - DoubleEnum = 20, - /// - /// Enum DurationEnum for duration - /// - [EnumMember(Value = "duration")] - DurationEnum = 21, - /// - /// Enum DayTimeDurationEnum for dayTimeDuration - /// - [EnumMember(Value = "dayTimeDuration")] - DayTimeDurationEnum = 22, - /// - /// Enum YearMonthDurationEnum for yearMonthDuration - /// - [EnumMember(Value = "yearMonthDuration")] - YearMonthDurationEnum = 23, - /// - /// Enum FloatEnum for float - /// - [EnumMember(Value = "float")] - FloatEnum = 24, - /// - /// Enum GDayEnum for gDay - /// - [EnumMember(Value = "gDay")] - GDayEnum = 25, - /// - /// Enum GMonthEnum for gMonth - /// - [EnumMember(Value = "gMonth")] - GMonthEnum = 26, - /// - /// Enum GMonthDayEnum for gMonthDay - /// - [EnumMember(Value = "gMonthDay")] - GMonthDayEnum = 27, - /// - /// Enum GYearEnum for gYear - /// - [EnumMember(Value = "gYear")] - GYearEnum = 28, - /// - /// Enum GYearMonthEnum for gYearMonth - /// - [EnumMember(Value = "gYearMonth")] - GYearMonthEnum = 29, - /// - /// Enum HexBinaryEnum for hexBinary - /// - [EnumMember(Value = "hexBinary")] - HexBinaryEnum = 30, - /// - /// Enum NOTATIONEnum for NOTATION - /// - [EnumMember(Value = "NOTATION")] - NOTATIONEnum = 31, - /// - /// Enum QNameEnum for QName - /// - [EnumMember(Value = "QName")] - QNameEnum = 32, - /// - /// Enum StringEnum for string - /// - [EnumMember(Value = "string")] - StringEnum = 33, - /// - /// Enum NormalizedStringEnum for normalizedString - /// - [EnumMember(Value = "normalizedString")] - NormalizedStringEnum = 34, - /// - /// Enum TokenEnum for token - /// - [EnumMember(Value = "token")] - TokenEnum = 35, - /// - /// Enum LanguageEnum for language - /// - [EnumMember(Value = "language")] - LanguageEnum = 36, - /// - /// Enum NameEnum for Name - /// - [EnumMember(Value = "Name")] - NameEnum = 37, - /// - /// Enum NCNameEnum for NCName - /// - [EnumMember(Value = "NCName")] - NCNameEnum = 38, - /// - /// Enum ENTITYEnum for ENTITY - /// - [EnumMember(Value = "ENTITY")] - ENTITYEnum = 39, - /// - /// Enum IDEnum for ID - /// - [EnumMember(Value = "ID")] - IDEnum = 40, - /// - /// Enum IDREFEnum for IDREF - /// - [EnumMember(Value = "IDREF")] - IDREFEnum = 41, - /// - /// Enum NMTOKENEnum for NMTOKEN - /// - [EnumMember(Value = "NMTOKEN")] - NMTOKENEnum = 42, - /// - /// Enum TimeEnum for time - /// - [EnumMember(Value = "time")] - TimeEnum = 43 } +{ + /// + /// Gets or Sets ValueTypeEnum + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ValueTypeEnum + { + /// + /// Enum AnyUriEnum for anyUri + /// + [EnumMember(Value = "anyUri")] + AnyUriEnum = 0, + /// + /// Enum Base64BinaryEnum for base64Binary + /// + [EnumMember(Value = "base64Binary")] + Base64BinaryEnum = 1, + /// + /// Enum BooleanEnum for boolean + /// + [EnumMember(Value = "boolean")] + BooleanEnum = 2, + /// + /// Enum DateEnum for date + /// + [EnumMember(Value = "date")] + DateEnum = 3, + /// + /// Enum DateTimeEnum for dateTime + /// + [EnumMember(Value = "dateTime")] + DateTimeEnum = 4, + /// + /// Enum DateTimeStampEnum for dateTimeStamp + /// + [EnumMember(Value = "dateTimeStamp")] + DateTimeStampEnum = 5, + /// + /// Enum DecimalEnum for decimal + /// + [EnumMember(Value = "decimal")] + DecimalEnum = 6, + /// + /// Enum IntegerEnum for integer + /// + [EnumMember(Value = "integer")] + IntegerEnum = 7, + /// + /// Enum LongEnum for long + /// + [EnumMember(Value = "long")] + LongEnum = 8, + /// + /// Enum IntEnum for int + /// + [EnumMember(Value = "int")] + IntEnum = 9, + /// + /// Enum ShortEnum for short + /// + [EnumMember(Value = "short")] + ShortEnum = 10, + /// + /// Enum ByteEnum for byte + /// + [EnumMember(Value = "byte")] + ByteEnum = 11, + /// + /// Enum NonNegativeIntegerEnum for nonNegativeInteger + /// + [EnumMember(Value = "nonNegativeInteger")] + NonNegativeIntegerEnum = 12, + /// + /// Enum PositiveIntegerEnum for positiveInteger + /// + [EnumMember(Value = "positiveInteger")] + PositiveIntegerEnum = 13, + /// + /// Enum UnsignedLongEnum for unsignedLong + /// + [EnumMember(Value = "unsignedLong")] + UnsignedLongEnum = 14, + /// + /// Enum UnsignedIntEnum for unsignedInt + /// + [EnumMember(Value = "unsignedInt")] + UnsignedIntEnum = 15, + /// + /// Enum UnsignedShortEnum for unsignedShort + /// + [EnumMember(Value = "unsignedShort")] + UnsignedShortEnum = 16, + /// + /// Enum UnsignedByteEnum for unsignedByte + /// + [EnumMember(Value = "unsignedByte")] + UnsignedByteEnum = 17, + /// + /// Enum NonPositiveIntegerEnum for nonPositiveInteger + /// + [EnumMember(Value = "nonPositiveInteger")] + NonPositiveIntegerEnum = 18, + /// + /// Enum NegativeIntegerEnum for negativeInteger + /// + [EnumMember(Value = "negativeInteger")] + NegativeIntegerEnum = 19, + /// + /// Enum DoubleEnum for double + /// + [EnumMember(Value = "double")] + DoubleEnum = 20, + /// + /// Enum DurationEnum for duration + /// + [EnumMember(Value = "duration")] + DurationEnum = 21, + /// + /// Enum DayTimeDurationEnum for dayTimeDuration + /// + [EnumMember(Value = "dayTimeDuration")] + DayTimeDurationEnum = 22, + /// + /// Enum YearMonthDurationEnum for yearMonthDuration + /// + [EnumMember(Value = "yearMonthDuration")] + YearMonthDurationEnum = 23, + /// + /// Enum FloatEnum for float + /// + [EnumMember(Value = "float")] + FloatEnum = 24, + /// + /// Enum GDayEnum for gDay + /// + [EnumMember(Value = "gDay")] + GDayEnum = 25, + /// + /// Enum GMonthEnum for gMonth + /// + [EnumMember(Value = "gMonth")] + GMonthEnum = 26, + /// + /// Enum GMonthDayEnum for gMonthDay + /// + [EnumMember(Value = "gMonthDay")] + GMonthDayEnum = 27, + /// + /// Enum GYearEnum for gYear + /// + [EnumMember(Value = "gYear")] + GYearEnum = 28, + /// + /// Enum GYearMonthEnum for gYearMonth + /// + [EnumMember(Value = "gYearMonth")] + GYearMonthEnum = 29, + /// + /// Enum HexBinaryEnum for hexBinary + /// + [EnumMember(Value = "hexBinary")] + HexBinaryEnum = 30, + /// + /// Enum NOTATIONEnum for NOTATION + /// + [EnumMember(Value = "NOTATION")] + NOTATIONEnum = 31, + /// + /// Enum QNameEnum for QName + /// + [EnumMember(Value = "QName")] + QNameEnum = 32, + /// + /// Enum StringEnum for string + /// + [EnumMember(Value = "string")] + StringEnum = 33, + /// + /// Enum NormalizedStringEnum for normalizedString + /// + [EnumMember(Value = "normalizedString")] + NormalizedStringEnum = 34, + /// + /// Enum TokenEnum for token + /// + [EnumMember(Value = "token")] + TokenEnum = 35, + /// + /// Enum LanguageEnum for language + /// + [EnumMember(Value = "language")] + LanguageEnum = 36, + /// + /// Enum NameEnum for Name + /// + [EnumMember(Value = "Name")] + NameEnum = 37, + /// + /// Enum NCNameEnum for NCName + /// + [EnumMember(Value = "NCName")] + NCNameEnum = 38, + /// + /// Enum ENTITYEnum for ENTITY + /// + [EnumMember(Value = "ENTITY")] + ENTITYEnum = 39, + /// + /// Enum IDEnum for ID + /// + [EnumMember(Value = "ID")] + IDEnum = 40, + /// + /// Enum IDREFEnum for IDREF + /// + [EnumMember(Value = "IDREF")] + IDREFEnum = 41, + /// + /// Enum NMTOKENEnum for NMTOKEN + /// + [EnumMember(Value = "NMTOKEN")] + NMTOKENEnum = 42, + /// + /// Enum TimeEnum for time + /// + [EnumMember(Value = "time")] + TimeEnum = 43 + } } diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs index b0016246c..d30d14912 100644 --- a/src/IO.Swagger/Models/View.cs +++ b/src/IO.Swagger/Models/View.cs @@ -7,37 +7,33 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using Newtonsoft.Json; using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text; namespace IO.Swagger.Models -{ +{ /// /// /// [DataContract] public partial class View : Referable, IEquatable - { + { /// /// Gets or Sets EmbeddedDataSpecifications /// - [DataMember(Name="embeddedDataSpecifications")] + [DataMember(Name = "embeddedDataSpecifications")] public List EmbeddedDataSpecifications { get; set; } /// /// Gets or Sets SemanticId /// - [DataMember(Name="semanticId")] + [DataMember(Name = "semanticId")] //TODO: //public HttpsapiSwaggerhubComdomainsPlattformI40SharedDomainModelsFinalDraftcomponentsschemasReference SemanticId { get; set; } public Reference SemanticId { get; set; } @@ -46,7 +42,7 @@ public partial class View : Referable, IEquatable /// Gets or Sets ContainedElements /// - [DataMember(Name="containedElements")] + [DataMember(Name = "containedElements")] public List ContainedElements { get; set; } /// @@ -68,7 +64,7 @@ public override string ToString() /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public new string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -95,17 +91,17 @@ public bool Equals(View other) if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return + return ( EmbeddedDataSpecifications == other.EmbeddedDataSpecifications || EmbeddedDataSpecifications != null && EmbeddedDataSpecifications.SequenceEqual(other.EmbeddedDataSpecifications) - ) && + ) && ( SemanticId == other.SemanticId || SemanticId != null && SemanticId.Equals(other.SemanticId) - ) && + ) && ( ContainedElements == other.ContainedElements || ContainedElements != null && @@ -123,18 +119,18 @@ public override int GetHashCode() { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (EmbeddedDataSpecifications != null) + if (EmbeddedDataSpecifications != null) hashCode = hashCode * 59 + EmbeddedDataSpecifications.GetHashCode(); - if (SemanticId != null) + if (SemanticId != null) hashCode = hashCode * 59 + SemanticId.GetHashCode(); - if (ContainedElements != null) + if (ContainedElements != null) hashCode = hashCode * 59 + ContainedElements.GetHashCode(); return hashCode; } } #region Operators - #pragma warning disable 1591 +#pragma warning disable 1591 public static bool operator ==(View left, View right) { @@ -146,7 +142,7 @@ public override int GetHashCode() return !Equals(left, right); } - #pragma warning restore 1591 +#pragma warning restore 1591 #endregion Operators } } diff --git a/src/IO.Swagger/Program.cs b/src/IO.Swagger/Program.cs index cdbbe15a7..6d6775779 100644 --- a/src/IO.Swagger/Program.cs +++ b/src/IO.Swagger/Program.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; namespace IO.Swagger { diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs index 39fcd6c69..32d3f4494 100644 --- a/src/IO.Swagger/Startup.cs +++ b/src/IO.Swagger/Startup.cs @@ -7,9 +7,7 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using System; -using System.IO; -using Microsoft.AspNetCore.Authentication; +using IO.Swagger.Filters; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -19,9 +17,8 @@ using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; -using Swashbuckle.AspNetCore.Swagger; -using Swashbuckle.AspNetCore.SwaggerGen; -using IO.Swagger.Filters; +using System; +using System.IO; namespace IO.Swagger @@ -77,9 +74,9 @@ public void ConfigureServices(IServiceCollection services) Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", Contact = new OpenApiContact() { - Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", - Url = new Uri("https://github.com/swagger-api/swagger-codegen"), - Email = "" + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" }, TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") }); From 33bb55c8ccdd451b881a7f94e27275329c2a7b5e Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Fri, 21 Jan 2022 13:12:00 +0100 Subject: [PATCH 20/53] Corrected the code formatting --- src/AasxServerStandardBib/AdminShell.cs | 5 ----- src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs | 4 ++-- .../Controllers/AssetAdministrationShellRepositoryApi.cs | 6 +++--- src/IO.Swagger/Filters/BasePathFilter.cs | 4 ++-- .../Filters/GeneratePathParamsValidationFilter.cs | 4 ++-- src/IO.Swagger/Helpers/AASHelper.cs | 6 +++--- src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs | 6 +++--- src/IO.Swagger/Helpers/OutputModifierContractResolver.cs | 4 ++-- src/IO.Swagger/Models/AccessControl.cs | 2 +- src/IO.Swagger/Models/AccessControlPolicyPoints.cs | 2 +- src/IO.Swagger/Models/AccessPermissionRule.cs | 2 +- src/IO.Swagger/Models/AdministrativeInformation.cs | 2 +- src/IO.Swagger/Models/AnnotatedRelationshipElement.cs | 2 +- src/IO.Swagger/Models/AssetAdministrationShell.cs | 2 +- .../Models/AssetAdministrationShellEnvironment.cs | 2 +- src/IO.Swagger/Models/AssetInformation.cs | 2 +- src/IO.Swagger/Models/AssetKind.cs | 2 +- src/IO.Swagger/Models/BasicEvent.cs | 2 +- src/IO.Swagger/Models/Blob.cs | 2 +- src/IO.Swagger/Models/BlobCertificate.cs | 2 +- src/IO.Swagger/Models/Capability.cs | 2 +- src/IO.Swagger/Models/Certificate.cs | 2 +- src/IO.Swagger/Models/ConceptDescription.cs | 2 +- src/IO.Swagger/Models/Constraint.cs | 2 +- src/IO.Swagger/Models/DataElement.cs | 2 +- src/IO.Swagger/Models/DataSpecificationContent.cs | 2 +- src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs | 2 +- .../Models/DataSpecificationPhysicalUnitContent.cs | 2 +- src/IO.Swagger/Models/EmbeddedDataSpecification.cs | 2 +- src/IO.Swagger/Models/Entity.cs | 2 +- src/IO.Swagger/Models/EntityType.cs | 2 +- src/IO.Swagger/Models/Extension.cs | 2 +- src/IO.Swagger/Models/File.cs | 2 +- src/IO.Swagger/Models/Formula.cs | 2 +- src/IO.Swagger/Models/GlobalReference.cs | 2 +- src/IO.Swagger/Models/HasDataSpecification.cs | 2 +- src/IO.Swagger/Models/HasExtensions.cs | 2 +- src/IO.Swagger/Models/HasSemantics.cs | 2 +- src/IO.Swagger/Models/Identifiable.cs | 2 +- src/IO.Swagger/Models/IdentifierKeyValuePair.cs | 2 +- src/IO.Swagger/Models/Key.cs | 2 +- src/IO.Swagger/Models/KeyElements.cs | 2 +- src/IO.Swagger/Models/LangString.cs | 2 +- src/IO.Swagger/Models/LevelType.cs | 2 +- src/IO.Swagger/Models/Message.cs | 2 +- src/IO.Swagger/Models/ModelEvent.cs | 2 +- src/IO.Swagger/Models/ModelReference.cs | 2 +- src/IO.Swagger/Models/ModelType.cs | 2 +- src/IO.Swagger/Models/ModelTypes.cs | 2 +- src/IO.Swagger/Models/ModelingKind.cs | 2 +- src/IO.Swagger/Models/MultiLanguageProperty.cs | 2 +- src/IO.Swagger/Models/ObjectAttributes.cs | 2 +- src/IO.Swagger/Models/OneOfCertificate.cs | 2 +- src/IO.Swagger/Models/OneOfConstraint.cs | 2 +- src/IO.Swagger/Models/OneOfDataElement.cs | 2 +- src/IO.Swagger/Models/OneOfDataSpecificationContent.cs | 2 +- src/IO.Swagger/Models/OneOfOperationVariableValue.cs | 2 +- src/IO.Swagger/Models/OneOfReference.cs | 2 +- src/IO.Swagger/Models/OneOfSubmodelElement.cs | 2 +- src/IO.Swagger/Models/Operation.cs | 2 +- src/IO.Swagger/Models/OperationRequest.cs | 2 +- src/IO.Swagger/Models/OperationResult.cs | 2 +- src/IO.Swagger/Models/OperationVariable.cs | 2 +- src/IO.Swagger/Models/Permission.cs | 2 +- src/IO.Swagger/Models/PermissionsPerObject.cs | 2 +- src/IO.Swagger/Models/PolicyAdministrationPoint.cs | 2 +- src/IO.Swagger/Models/PolicyDecisionPoint.cs | 2 +- src/IO.Swagger/Models/PolicyEnforcementPoint.cs | 2 +- src/IO.Swagger/Models/PolicyInformationPoints.cs | 2 +- src/IO.Swagger/Models/Property.cs | 2 +- src/IO.Swagger/Models/Qualifiable.cs | 2 +- src/IO.Swagger/Models/Qualifier.cs | 2 +- src/IO.Swagger/Models/Range.cs | 2 +- src/IO.Swagger/Models/Referable.cs | 2 +- src/IO.Swagger/Models/Reference.cs | 2 +- src/IO.Swagger/Models/ReferenceElement.cs | 2 +- src/IO.Swagger/Models/RelationshipElement.cs | 2 +- src/IO.Swagger/Models/Result.cs | 2 +- src/IO.Swagger/Models/Security.cs | 2 +- src/IO.Swagger/Models/SubjectAttributes.cs | 2 +- src/IO.Swagger/Models/Submodel.cs | 2 +- src/IO.Swagger/Models/SubmodelElement.cs | 2 +- src/IO.Swagger/Models/SubmodelElementList.cs | 2 +- src/IO.Swagger/Models/SubmodelElementStruct.cs | 2 +- src/IO.Swagger/Models/ValueList.cs | 2 +- src/IO.Swagger/Models/ValueObject.cs | 2 +- src/IO.Swagger/Models/ValueReferencePairType.cs | 2 +- src/IO.Swagger/Models/ValueTypeEnum.cs | 2 +- src/IO.Swagger/Models/View.cs | 2 +- src/IO.Swagger/Startup.cs | 4 ++-- 90 files changed, 100 insertions(+), 105 deletions(-) diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 844ccb5be..65ce34882 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -10,19 +10,14 @@ This source code may use other Open Source software components (see LICENSE.txt) using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Globalization; using System.IO; -using System.IO.Packaging; using System.Linq; using System.Reflection; -using System.Runtime; using System.Text; -using System.Text.RegularExpressions; using System.Xml; using System.Xml.Serialization; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace AdminShellNS { diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs index 604012536..97b193c67 100644 --- a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -1,9 +1,9 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; -using System.ComponentModel.DataAnnotations; -using System.Reflection; namespace IO.Swagger.Attributes { diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index a78908d31..b860ca821 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -7,6 +7,9 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using AdminShellNS; using IO.Swagger.Attributes; using IO.Swagger.Helpers; @@ -15,9 +18,6 @@ using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Swashbuckle.AspNetCore.Annotations; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; namespace IO.Swagger.Controllers { diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs index a94d6a70c..eef6989b3 100644 --- a/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -1,7 +1,7 @@ -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; using System.Linq; using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index a2138c86c..1845e56ac 100644 --- a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -1,8 +1,8 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -using System.ComponentModel.DataAnnotations; -using System.Linq; namespace IO.Swagger.Filters { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 55dfe86b2..a2e3a8c4d 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -1,9 +1,9 @@ -using AdminShellNS; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Threading; +using AdminShellNS; +using Newtonsoft.Json; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers diff --git a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs index 372d1ba61..75f3f3e6f 100644 --- a/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -1,8 +1,8 @@ -using IO.Swagger.Models; -using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using IO.Swagger.Models; +using Newtonsoft.Json; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index 94b10fb5a..c050ad220 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,7 +1,7 @@ -using AdminShellNS; +using System.Reflection; +using AdminShellNS; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System.Reflection; namespace IO.Swagger.Helpers { diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs index c774cf18b..10907a021 100644 --- a/src/IO.Swagger/Models/AccessControl.cs +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs index c064fb200..c2460d28d 100644 --- a/src/IO.Swagger/Models/AccessControlPolicyPoints.cs +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AccessPermissionRule.cs b/src/IO.Swagger/Models/AccessPermissionRule.cs index 65f630acd..dd94cafa3 100644 --- a/src/IO.Swagger/Models/AccessPermissionRule.cs +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AdministrativeInformation.cs b/src/IO.Swagger/Models/AdministrativeInformation.cs index aceef7073..7d4b2c292 100644 --- a/src/IO.Swagger/Models/AdministrativeInformation.cs +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs index 4e0cafe47..112315725 100644 --- a/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetAdministrationShell.cs b/src/IO.Swagger/Models/AssetAdministrationShell.cs index 7c52798be..458e1f6f6 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShell.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs index 015620adc..88f67df84 100644 --- a/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetInformation.cs b/src/IO.Swagger/Models/AssetInformation.cs index 82210194d..46de259e0 100644 --- a/src/IO.Swagger/Models/AssetInformation.cs +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/AssetKind.cs b/src/IO.Swagger/Models/AssetKind.cs index 53615779d..71b390e66 100644 --- a/src/IO.Swagger/Models/AssetKind.cs +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/BasicEvent.cs b/src/IO.Swagger/Models/BasicEvent.cs index e32d77dff..bcb4dea85 100644 --- a/src/IO.Swagger/Models/BasicEvent.cs +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Blob.cs b/src/IO.Swagger/Models/Blob.cs index b53c09db5..b5d431a4b 100644 --- a/src/IO.Swagger/Models/Blob.cs +++ b/src/IO.Swagger/Models/Blob.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/BlobCertificate.cs b/src/IO.Swagger/Models/BlobCertificate.cs index 0d13579d2..b984cfdbb 100644 --- a/src/IO.Swagger/Models/BlobCertificate.cs +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Capability.cs b/src/IO.Swagger/Models/Capability.cs index afce09069..5291e1137 100644 --- a/src/IO.Swagger/Models/Capability.cs +++ b/src/IO.Swagger/Models/Capability.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Certificate.cs b/src/IO.Swagger/Models/Certificate.cs index f7421a5e6..8b2a9e043 100644 --- a/src/IO.Swagger/Models/Certificate.cs +++ b/src/IO.Swagger/Models/Certificate.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ConceptDescription.cs b/src/IO.Swagger/Models/ConceptDescription.cs index 3aeaf2f3e..e56650cf8 100644 --- a/src/IO.Swagger/Models/ConceptDescription.cs +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Constraint.cs b/src/IO.Swagger/Models/Constraint.cs index fcaeebc4a..fd02efdd4 100644 --- a/src/IO.Swagger/Models/Constraint.cs +++ b/src/IO.Swagger/Models/Constraint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataElement.cs b/src/IO.Swagger/Models/DataElement.cs index 1afee42c4..fa40c49a6 100644 --- a/src/IO.Swagger/Models/DataElement.cs +++ b/src/IO.Swagger/Models/DataElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationContent.cs b/src/IO.Swagger/Models/DataSpecificationContent.cs index a8e3dbeb0..a2fd64638 100644 --- a/src/IO.Swagger/Models/DataSpecificationContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs index 770354aae..89c150803 100644 --- a/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs index e7324e909..e6cce21df 100644 --- a/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs index ec35e951a..1ec412c74 100644 --- a/src/IO.Swagger/Models/EmbeddedDataSpecification.cs +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Entity.cs b/src/IO.Swagger/Models/Entity.cs index 0b1046298..060f340c1 100644 --- a/src/IO.Swagger/Models/Entity.cs +++ b/src/IO.Swagger/Models/Entity.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/EntityType.cs b/src/IO.Swagger/Models/EntityType.cs index d06093904..1d4873919 100644 --- a/src/IO.Swagger/Models/EntityType.cs +++ b/src/IO.Swagger/Models/EntityType.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Extension.cs b/src/IO.Swagger/Models/Extension.cs index 509f42692..7f30262af 100644 --- a/src/IO.Swagger/Models/Extension.cs +++ b/src/IO.Swagger/Models/Extension.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/File.cs b/src/IO.Swagger/Models/File.cs index e1a4ce7f8..d0e782f38 100644 --- a/src/IO.Swagger/Models/File.cs +++ b/src/IO.Swagger/Models/File.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Formula.cs b/src/IO.Swagger/Models/Formula.cs index 2e98ffb87..a9f019c1d 100644 --- a/src/IO.Swagger/Models/Formula.cs +++ b/src/IO.Swagger/Models/Formula.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/GlobalReference.cs b/src/IO.Swagger/Models/GlobalReference.cs index 276ab1d21..6bbaf6048 100644 --- a/src/IO.Swagger/Models/GlobalReference.cs +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasDataSpecification.cs b/src/IO.Swagger/Models/HasDataSpecification.cs index 428b707cf..620fbe985 100644 --- a/src/IO.Swagger/Models/HasDataSpecification.cs +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasExtensions.cs b/src/IO.Swagger/Models/HasExtensions.cs index 2d4b0289b..d91f3043d 100644 --- a/src/IO.Swagger/Models/HasExtensions.cs +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/HasSemantics.cs b/src/IO.Swagger/Models/HasSemantics.cs index 9f42763ec..a5b4bee0c 100644 --- a/src/IO.Swagger/Models/HasSemantics.cs +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Identifiable.cs b/src/IO.Swagger/Models/Identifiable.cs index c9bccffab..b275ca9c1 100644 --- a/src/IO.Swagger/Models/Identifiable.cs +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs index e2f40777b..a6fe72e20 100644 --- a/src/IO.Swagger/Models/IdentifierKeyValuePair.cs +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Key.cs b/src/IO.Swagger/Models/Key.cs index 25c6aae9e..ebf984a98 100644 --- a/src/IO.Swagger/Models/Key.cs +++ b/src/IO.Swagger/Models/Key.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/KeyElements.cs b/src/IO.Swagger/Models/KeyElements.cs index 8411b8dbb..ca9e15f15 100644 --- a/src/IO.Swagger/Models/KeyElements.cs +++ b/src/IO.Swagger/Models/KeyElements.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/LangString.cs b/src/IO.Swagger/Models/LangString.cs index 436f236cb..c2c7de816 100644 --- a/src/IO.Swagger/Models/LangString.cs +++ b/src/IO.Swagger/Models/LangString.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/LevelType.cs b/src/IO.Swagger/Models/LevelType.cs index a6ac1fdd5..f57e17244 100644 --- a/src/IO.Swagger/Models/LevelType.cs +++ b/src/IO.Swagger/Models/LevelType.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Message.cs b/src/IO.Swagger/Models/Message.cs index 7f8b3e662..958130530 100644 --- a/src/IO.Swagger/Models/Message.cs +++ b/src/IO.Swagger/Models/Message.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelEvent.cs b/src/IO.Swagger/Models/ModelEvent.cs index d44e568c8..ce0ac1cd1 100644 --- a/src/IO.Swagger/Models/ModelEvent.cs +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelReference.cs b/src/IO.Swagger/Models/ModelReference.cs index 4bb50c07f..c48969a34 100644 --- a/src/IO.Swagger/Models/ModelReference.cs +++ b/src/IO.Swagger/Models/ModelReference.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelType.cs b/src/IO.Swagger/Models/ModelType.cs index 6b785aee2..d76707295 100644 --- a/src/IO.Swagger/Models/ModelType.cs +++ b/src/IO.Swagger/Models/ModelType.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelTypes.cs b/src/IO.Swagger/Models/ModelTypes.cs index 80f71ca5e..74241bc09 100644 --- a/src/IO.Swagger/Models/ModelTypes.cs +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ModelingKind.cs b/src/IO.Swagger/Models/ModelingKind.cs index 6aa0183e5..5748c03df 100644 --- a/src/IO.Swagger/Models/ModelingKind.cs +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/MultiLanguageProperty.cs b/src/IO.Swagger/Models/MultiLanguageProperty.cs index 18bbd8992..10a361a2a 100644 --- a/src/IO.Swagger/Models/MultiLanguageProperty.cs +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ObjectAttributes.cs b/src/IO.Swagger/Models/ObjectAttributes.cs index 3c09f5e23..f6a602e2e 100644 --- a/src/IO.Swagger/Models/ObjectAttributes.cs +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfCertificate.cs b/src/IO.Swagger/Models/OneOfCertificate.cs index 1b74da745..16ebeaa44 100644 --- a/src/IO.Swagger/Models/OneOfCertificate.cs +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfConstraint.cs b/src/IO.Swagger/Models/OneOfConstraint.cs index e1a74771d..72936972a 100644 --- a/src/IO.Swagger/Models/OneOfConstraint.cs +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfDataElement.cs b/src/IO.Swagger/Models/OneOfDataElement.cs index dee5eafc8..4e5a895dd 100644 --- a/src/IO.Swagger/Models/OneOfDataElement.cs +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs index 98c6cda04..f0c77bc45 100644 --- a/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs index eb1d1e3bc..22e9c606e 100644 --- a/src/IO.Swagger/Models/OneOfOperationVariableValue.cs +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfReference.cs b/src/IO.Swagger/Models/OneOfReference.cs index b74711b83..b53ec7af5 100644 --- a/src/IO.Swagger/Models/OneOfReference.cs +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OneOfSubmodelElement.cs b/src/IO.Swagger/Models/OneOfSubmodelElement.cs index 4a354c283..c82dd42d8 100644 --- a/src/IO.Swagger/Models/OneOfSubmodelElement.cs +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Operation.cs b/src/IO.Swagger/Models/Operation.cs index fe2a28372..4f821d2bb 100644 --- a/src/IO.Swagger/Models/Operation.cs +++ b/src/IO.Swagger/Models/Operation.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationRequest.cs b/src/IO.Swagger/Models/OperationRequest.cs index 6e1536833..6fe68f239 100644 --- a/src/IO.Swagger/Models/OperationRequest.cs +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationResult.cs b/src/IO.Swagger/Models/OperationResult.cs index 46ac8532d..48103ebf4 100644 --- a/src/IO.Swagger/Models/OperationResult.cs +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/OperationVariable.cs b/src/IO.Swagger/Models/OperationVariable.cs index d8a0c2e37..cd09578d4 100644 --- a/src/IO.Swagger/Models/OperationVariable.cs +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Permission.cs b/src/IO.Swagger/Models/Permission.cs index 3215153ba..0b0b86889 100644 --- a/src/IO.Swagger/Models/Permission.cs +++ b/src/IO.Swagger/Models/Permission.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PermissionsPerObject.cs b/src/IO.Swagger/Models/PermissionsPerObject.cs index af7c828fd..14f5c6d6c 100644 --- a/src/IO.Swagger/Models/PermissionsPerObject.cs +++ b/src/IO.Swagger/Models/PermissionsPerObject.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs index a5bad16e1..e8d85d230 100644 --- a/src/IO.Swagger/Models/PolicyAdministrationPoint.cs +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyDecisionPoint.cs b/src/IO.Swagger/Models/PolicyDecisionPoint.cs index 16380b049..94e63c455 100644 --- a/src/IO.Swagger/Models/PolicyDecisionPoint.cs +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs index 99d4742c2..cadf0746e 100644 --- a/src/IO.Swagger/Models/PolicyEnforcementPoint.cs +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/PolicyInformationPoints.cs b/src/IO.Swagger/Models/PolicyInformationPoints.cs index 134741e2a..4cabb3dee 100644 --- a/src/IO.Swagger/Models/PolicyInformationPoints.cs +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Property.cs b/src/IO.Swagger/Models/Property.cs index 78b8b316e..59745986f 100644 --- a/src/IO.Swagger/Models/Property.cs +++ b/src/IO.Swagger/Models/Property.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Qualifiable.cs b/src/IO.Swagger/Models/Qualifiable.cs index f2c610ef8..192da91e6 100644 --- a/src/IO.Swagger/Models/Qualifiable.cs +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Qualifier.cs b/src/IO.Swagger/Models/Qualifier.cs index f0c5efae5..339c7bdf9 100644 --- a/src/IO.Swagger/Models/Qualifier.cs +++ b/src/IO.Swagger/Models/Qualifier.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Range.cs b/src/IO.Swagger/Models/Range.cs index 793b60112..027cb9a2b 100644 --- a/src/IO.Swagger/Models/Range.cs +++ b/src/IO.Swagger/Models/Range.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Referable.cs b/src/IO.Swagger/Models/Referable.cs index f2f646d3f..d5d689834 100644 --- a/src/IO.Swagger/Models/Referable.cs +++ b/src/IO.Swagger/Models/Referable.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Reference.cs b/src/IO.Swagger/Models/Reference.cs index c03e3f40f..919adbc73 100644 --- a/src/IO.Swagger/Models/Reference.cs +++ b/src/IO.Swagger/Models/Reference.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ReferenceElement.cs b/src/IO.Swagger/Models/ReferenceElement.cs index 7d0f2fc80..de80c2cf7 100644 --- a/src/IO.Swagger/Models/ReferenceElement.cs +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/RelationshipElement.cs b/src/IO.Swagger/Models/RelationshipElement.cs index 026c4943b..3d10e6079 100644 --- a/src/IO.Swagger/Models/RelationshipElement.cs +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -7,11 +7,11 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Result.cs b/src/IO.Swagger/Models/Result.cs index bcc0ecab2..342f27a50 100644 --- a/src/IO.Swagger/Models/Result.cs +++ b/src/IO.Swagger/Models/Result.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Security.cs b/src/IO.Swagger/Models/Security.cs index 4b83b4d6e..c578671fb 100644 --- a/src/IO.Swagger/Models/Security.cs +++ b/src/IO.Swagger/Models/Security.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubjectAttributes.cs b/src/IO.Swagger/Models/SubjectAttributes.cs index 2f3470763..10a305f80 100644 --- a/src/IO.Swagger/Models/SubjectAttributes.cs +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/Submodel.cs b/src/IO.Swagger/Models/Submodel.cs index 3daa131ec..f2bbcaddf 100644 --- a/src/IO.Swagger/Models/Submodel.cs +++ b/src/IO.Swagger/Models/Submodel.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElement.cs b/src/IO.Swagger/Models/SubmodelElement.cs index 4a6af08b9..0bcebfe49 100644 --- a/src/IO.Swagger/Models/SubmodelElement.cs +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElementList.cs b/src/IO.Swagger/Models/SubmodelElementList.cs index f6e3d7b80..bb33d2f35 100644 --- a/src/IO.Swagger/Models/SubmodelElementList.cs +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/SubmodelElementStruct.cs b/src/IO.Swagger/Models/SubmodelElementStruct.cs index 4c7c99b89..c1bc9f033 100644 --- a/src/IO.Swagger/Models/SubmodelElementStruct.cs +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueList.cs b/src/IO.Swagger/Models/ValueList.cs index 1c5e676ef..87e8bdcef 100644 --- a/src/IO.Swagger/Models/ValueList.cs +++ b/src/IO.Swagger/Models/ValueList.cs @@ -7,13 +7,13 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueObject.cs b/src/IO.Swagger/Models/ValueObject.cs index 9cf0ad5ca..c83fda12e 100644 --- a/src/IO.Swagger/Models/ValueObject.cs +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueReferencePairType.cs b/src/IO.Swagger/Models/ValueReferencePairType.cs index c55a081e6..f21741a11 100644 --- a/src/IO.Swagger/Models/ValueReferencePairType.cs +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -7,10 +7,10 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/ValueTypeEnum.cs b/src/IO.Swagger/Models/ValueTypeEnum.cs index fea2b2eee..70bf2d1e1 100644 --- a/src/IO.Swagger/Models/ValueTypeEnum.cs +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -7,8 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System.Runtime.Serialization; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Models/View.cs b/src/IO.Swagger/Models/View.cs index d30d14912..a4c83b19d 100644 --- a/src/IO.Swagger/Models/View.cs +++ b/src/IO.Swagger/Models/View.cs @@ -7,12 +7,12 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ -using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; +using Newtonsoft.Json; namespace IO.Swagger.Models { diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs index 32d3f4494..9d5e2d370 100644 --- a/src/IO.Swagger/Startup.cs +++ b/src/IO.Swagger/Startup.cs @@ -7,6 +7,8 @@ * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ +using System; +using System.IO; using IO.Swagger.Filters; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -17,8 +19,6 @@ using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; -using System; -using System.IO; namespace IO.Swagger From bb69aa9008f3769180aa42b29f7d6542957bb7cb Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 31 Jan 2022 07:58:23 +0100 Subject: [PATCH 21/53] Support for "Content" and "Extent" modifiers -Support for Basic Authentication --- src/AasxServerBlazor/AasxServerBlazor.csproj | 1 + src/AasxServerBlazor/Startup.cs | 104 +++++++++- src/AasxServerStandardBib/AdminShell.cs | 71 +++++++ .../ValueOnlyJsonConverter.cs | 74 ++++++++ .../AssetAdministrationShellRepositoryApi.cs | 114 ++++++++--- src/IO.Swagger/Helpers/AASHelper.cs | 178 +++++++++++++++--- .../Helpers/BasicAuthenticationHandler.cs | 95 ++++++++++ .../Helpers/JsonSerializerExtension.cs | 23 +++ .../Helpers/OutputModifierContractResolver.cs | 156 ++++++++++++--- src/IO.Swagger/Services/UserService.cs | 38 ++++ 10 files changed, 763 insertions(+), 91 deletions(-) create mode 100644 src/AasxServerStandardBib/ValueOnlyJsonConverter.cs create mode 100644 src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs create mode 100644 src/IO.Swagger/Helpers/JsonSerializerExtension.cs create mode 100644 src/IO.Swagger/Services/UserService.cs diff --git a/src/AasxServerBlazor/AasxServerBlazor.csproj b/src/AasxServerBlazor/AasxServerBlazor.csproj index 5b5bb5515..747580085 100644 --- a/src/AasxServerBlazor/AasxServerBlazor.csproj +++ b/src/AasxServerBlazor/AasxServerBlazor.csproj @@ -17,6 +17,7 @@ + diff --git a/src/AasxServerBlazor/Startup.cs b/src/AasxServerBlazor/Startup.cs index 1d1621d39..4f8b6430a 100644 --- a/src/AasxServerBlazor/Startup.cs +++ b/src/AasxServerBlazor/Startup.cs @@ -1,8 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using AasxServerBlazor.Data; +using IO.Swagger.Filters; +using IO.Swagger.Helpers; +using IO.Swagger.Services; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Hosting; @@ -10,16 +15,27 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; namespace AasxServerBlazor { public class Startup { + private readonly IWebHostEnvironment _hostingEnv; + + /* public Startup(IConfiguration configuration) { Configuration = configuration; } - + */ + public Startup(IWebHostEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. @@ -30,6 +46,79 @@ public void ConfigureServices(IServiceCollection services) services.AddServerSideBlazor(); services.AddSingleton(); services.AddCors(); + + services.AddControllers(); + + // Add framework services. + services + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); + }) + .AddXmlSerializerFormatters(); + + // configure DI for application services + services.AddScoped(); + // configure basic authentication + services.AddAuthentication("BasicAuthentication") + .AddScheme("BasicAuthentication", null); services.AddAuthentication(); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("Final-Draft", new OpenApiInfo + { + Version = "Final-Draft", + Title = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository", + Description = "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository (ASP.NET Core 3.1)", + Contact = new OpenApiContact() + { + Name = "Michael Hoffmeister, Torben Miny, Andreas Orzelski, Manuel Sauer, Constantin Ziesche", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), + Email = "" + }, + TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") + }); + + c.AddSecurityDefinition("basic", new OpenApiSecurityScheme + { + Name = "Authorization", + Type = SecuritySchemeType.Http, + Scheme = "basic", + In = ParameterLocation.Header, + Description = "Basic Authorization header using the Bearer scheme." + }); + + c.AddSecurityRequirement(new OpenApiSecurityRequirement + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference + { + Type = ReferenceType.SecurityScheme, + Id = "basic" + } + }, + new string[] {} + } + }); + + c.EnableAnnotations(); + c.CustomSchemaIds(type => type.FullName); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -49,6 +138,18 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseStaticFiles(); app.UseRouting(); + app.UseAuthentication(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/Final-Draft/swagger.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "DotAAS Part 2 | HTTP/REST | Asset Administration Shell Repository Original"); + }); app.UseEndpoints(endpoints => { @@ -62,6 +163,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) HttpTransportType.LongPolling; }); endpoints.MapFallbackToPage("/_Host"); + endpoints.MapControllers(); }); app.UseCors(x => x diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 65ce34882..535907831 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -10,6 +10,7 @@ This source code may use other Open Source software components (see LICENSE.txt) using System; using System.Collections; using System.Collections.Generic; +using System.Dynamic; using System.Globalization; using System.IO; using System.Linq; @@ -5176,6 +5177,11 @@ public override void Validate(AasValidationRecordList results) ModelingKind.Validate(results, kind, this); KeyList.Validate(results, semanticId?.Keys, this); } + + public virtual object ToValueOnlySerialization() + { + throw new NotImplementedException(); + } } [XmlType(TypeName = "submodelElement")] @@ -6439,6 +6445,7 @@ public JsonValueTypeCast(string name) } } + //[JsonConverter(typeof(IO.Swagger.Helpers.ValueOnlyJsonConverter))] public class Property : DataElement { // for JSON only @@ -6558,6 +6565,14 @@ public bool IsTrue() return null; } + public override object ToValueOnlySerialization() + { + var valueObject = new Dictionary + { + { idShort, value } + }; + return valueObject; + } } public class MultiLanguageProperty : DataElement @@ -6637,6 +6652,18 @@ public override string ValueAsText(string defaultLang = null) return "" + value?.GetDefaultStr(defaultLang); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary(); + foreach (LangStr langStr in value.langString) + { + valueDict.Add(langStr.lang, langStr.str); + } + + output.Add(idShort, valueDict); + return output; + } } public class Range : DataElement @@ -6711,6 +6738,18 @@ public override string ValueAsText(string defaultLang = null) return "" + min + " .. " + max; } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "min", min }, + { "max", max } + }; + + output.Add(idShort, valueDict); + return output; + } } public class Blob : DataElement @@ -6869,6 +6908,19 @@ public override string ValueAsText(string defaultLang = null) { return "" + value; } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + { "value", value } + }; + + output.Add(idShort, valueDict); + return output; + } } public class ReferenceElement : DataElement @@ -6929,6 +6981,24 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("ReferenceElement", "Ref"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var list = new List>(); + foreach (var key in value.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + list.Add(valueDict); + } + + output.Add(idShort, list); + return output; + } } public class RelationshipElement : DataElement @@ -6997,6 +7067,7 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("RelationshipElement", "Rel"); } + } public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren diff --git a/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs b/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs new file mode 100644 index 000000000..12039fcb1 --- /dev/null +++ b/src/AasxServerStandardBib/ValueOnlyJsonConverter.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Newtonsoft.Json; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Helpers +{ + /// + /// This class is responsible for the ValueOnly-Serialization + /// + public class ValueOnlyJsonConverter : JsonConverter + { + private readonly bool IsValueOnly; + private object m_object; + + public ValueOnlyJsonConverter() + { + } + + public ValueOnlyJsonConverter(bool isValueOnly, object obj) + { + this.IsValueOnly = isValueOnly; + m_object = obj; + } + + + + /// + /// Determines whether this instance can convert the specified object type. + /// + /// + /// + public override bool CanConvert(Type objectType) + { + return true; + } + + /// + /// Reads the JSON representation of the object. + /// + /// + /// + /// + /// + /// + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + /// + /// Writes the JSON representation of the object. + /// + /// + /// + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + var exists = serializer.Converters.Any(e => e.GetType() == typeof(ValueOnlyJsonConverter) && ((ValueOnlyJsonConverter)e).IsValueOnly == true); + if (exists) + { + if (m_object is Property property) + { + Console.WriteLine($"############### {property.ToValueOnlySerialization()} ########################"); + writer.WriteValue(property.ToValueOnlySerialization()); + } + } + } + + + } +} diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index b860ca821..938928744 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -14,6 +14,7 @@ using IO.Swagger.Attributes; using IO.Swagger.Helpers; using IO.Swagger.Models; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; @@ -24,6 +25,7 @@ namespace IO.Swagger.Controllers /// /// /// + [Authorize] [ApiController] public class AssetAdministrationShellRepositoryApiController : ControllerBase { @@ -196,15 +198,27 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(byte[])); - string exampleJson = null; - exampleJson = "\"\""; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(byte[]); //TODO: Change the data returned - return new ObjectResult(example); + List payload = new List(); + foreach (string aasId in aasIds) + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); + if (aasReturn != null) + { + payload.Add(aasReturn.AAS); + } + } + + //TODO: NotSure + foreach (string submodelId in submodelIds) + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + if (submodel != null) + { + payload.Add(submodel); + } + } + + return new ObjectResult(payload); } /// @@ -463,10 +477,8 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] s { return new ObjectResult(aasReturn.AAS); } - else if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) - { - return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); - } + + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); } return NotFound(); @@ -558,15 +570,38 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); } /// @@ -584,15 +619,32 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(OperationResult)); - string exampleJson = null; - exampleJson = "{\n \"outputArguments\" : [ null, null ],\n \"requestId\" : \"requestId\",\n \"executionResult\" : \"{}\",\n \"executionState\" : \"Initiated\",\n \"inoutputArguments\" : [ {\n \"value\" : \"\"\n }, {\n \"value\" : \"\"\n } ]\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(OperationResult); //TODO: Change the data returned - return new ObjectResult(example); + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); } /// diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index a2e3a8c4d..df78178ba 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -1,9 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; using System.Text.RegularExpressions; using System.Threading; using AdminShellNS; using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers @@ -14,10 +18,7 @@ namespace IO.Swagger.Helpers public class AASHelper { private static AdminShellPackageEnv[] Packages; - /// - /// HandleId to operation result mapping for InvokeAsyncResult - /// - private static Dictionary opResultAsyncDict; + private Timer m_simulationTimer; /// /// Constructor @@ -25,7 +26,6 @@ public class AASHelper public AASHelper() { Packages = AasxServer.Program.env; - opResultAsyncDict = new Dictionary(); } internal Submodel FindSubmodelWithinAAS(string aasIdentifier, string submodelIdentifier) @@ -500,15 +500,125 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string extent = "withoutBlobValue"; } + OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); + + if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) + { + contractResolver.Deep = false; + } + + contractResolver.Content = content; + contractResolver.Extent = extent; + if (content.Equals("reference", StringComparison.OrdinalIgnoreCase)) { obj = GetObjectReference(obj); } - //Handle Level - var json = ApplyLevelModifier(level, obj); + + if (content.Equals("path", StringComparison.OrdinalIgnoreCase)) + { + List idShortPath = new List(); + GetIdShortPath(obj, level, idShortPath); + return idShortPath; + } + + var settings = new JsonSerializerSettings(); + if (content.Equals("value", StringComparison.OrdinalIgnoreCase)) + { + //settings.Converters.Add(new ValueOnlyJsonConverter(true, obj)); + //var jsonTest = JsonConvert.SerializeObject(obj, settings); + object output = GetValueOnly(obj, level); + var jsonOutput = JsonConvert.SerializeObject(output, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); + return jsonOutput; + } + + if (contractResolver != null) + settings.ContractResolver = contractResolver; + var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); + return json; } + private object GetValueOnly(object obj, string level) + { + try + { + if (obj is Submodel submodel) + { + List values = new List(); + foreach (var smElement in submodel.submodelElements) + { + object value = GetValueOnly(smElement.submodelElement, level); + values.Add(value); + } + return values; + } + else if (obj is SubmodelElementCollection collection) + { + if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + List values = new List(); + foreach (var smElement in collection.value) + { + object value = GetValueOnly(smElement.submodelElement, level); + values.Add(value); + } + return values; + } + } + else if (obj is SubmodelElement submodelElement) + { + return submodelElement.ToValueOnlySerialization(); + } + else + { + Console.WriteLine("Not supported"); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + } + return null; + } + + private void GetIdShortPath(object obj, string level, List idShortPath) + { + if (obj is Submodel submodel) + { + idShortPath.Add(submodel.idShort); + foreach (var smElement in submodel.submodelElements) + { + GetIdShortPath(smElement.submodelElement, level, idShortPath); + } + } + else if (obj is SubmodelElementCollection collection) + { + idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + { + foreach (var smEle in collection.value) + { + GetIdShortPath(smEle.submodelElement, level, idShortPath); + } + } + } + else if (obj is Entity entity) + { + idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + //TODO: look for definition and children* + } + else if (obj is SubmodelElement smEle) + { + idShortPath.Add(idShortPath.Last() + "." + smEle.idShort); + } + else + { + Console.WriteLine($"Outout modifier pathis not applicable to {obj.GetType()}"); + } + } + private object GetObjectReference(object obj) { if (obj is AdminShellV20.AdministrationShell aas) @@ -524,22 +634,6 @@ private object GetObjectReference(object obj) } } - private object ApplyLevelModifier(string level, object obj) - { - OutputModifierContractResolver contractResolver = new OutputModifierContractResolver(); - - if (level.Equals("core", StringComparison.OrdinalIgnoreCase)) - { - contractResolver.Deep = false; - } - - var settings = new JsonSerializerSettings(); - if (contractResolver != null) - settings.ContractResolver = contractResolver; - var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - return json; - } - internal bool AddSubmodel(Submodel submodel) { bool emptyPackageAvailable = false; @@ -676,6 +770,12 @@ internal object FindAllSubmodelsBySemanticId(SemanticId reqSemaniticId) return outputSubmodels; } + internal object GetOperationAsyncResult(string handleId) + { + AsyncOperationResultStorage.opResultAsyncDict.TryGetValue(handleId, out Models.OperationResult opResult); + return opResult; + } + internal List FindAllSubmodelsByIdShort(string idShort) { var outputSubmodels = new List(); @@ -747,6 +847,7 @@ internal Models.OperationHandle InvokeOperationAsync(Operation operation, Models { opHandle.RequestId = body.RequestId; opHandle.HandleId = Guid.NewGuid().ToString(); + InvokeTestOperation(opHandle); } return opHandle; @@ -777,15 +878,21 @@ private void InvokeTestOperation(Models.OperationHandle opHandle) opResult.ExecutionResult = result; opResult.RequestId = opHandle.RequestId; - opResultAsyncDict.Add(opHandle.HandleId, opResult); + AsyncOperationResultStorage.opResultAsyncDict.Add(opHandle.HandleId, opResult); - Thread.Sleep(120000); // Sleep for two min - //Running - opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.RunningEnum; + m_simulationTimer = new Timer(DoSimulation, null, 5000, 5000); + } + + private void DoSimulation(object state) + { + var random = new Random(); + var values = Enum.GetValues(typeof(Models.OperationResult.ExecutionStateEnum)); - Thread.Sleep(120000); // Sleep for two min - //Running - opResult.ExecutionState = Models.OperationResult.ExecutionStateEnum.CompletedEnum; + foreach (var handleId in AsyncOperationResultStorage.opResultAsyncDict.Keys) + { + var value = (Models.OperationResult.ExecutionStateEnum)values.GetValue(random.Next(values.Length)); + AsyncOperationResultStorage.opResultAsyncDict[handleId].ExecutionState = value; + } } /// @@ -846,4 +953,15 @@ public class FindAasReturn public AdminShell.AdministrationShell AAS { get; set; } = null; public int IPackage { get; set; } = -1; } + + /// + /// Test class to store handle id and operation execution results + /// + public static class AsyncOperationResultStorage + { + /// + /// HandleId vs Operation Result of the corresponding Opration + /// + public static Dictionary opResultAsyncDict = new Dictionary(); + } } diff --git a/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs b/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs new file mode 100644 index 000000000..ea0695cc6 --- /dev/null +++ b/src/IO.Swagger/Helpers/BasicAuthenticationHandler.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using IO.Swagger.Services; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Helpers +{ + /// + /// + /// + public class BasicAuthenticationHandler : AuthenticationHandler + { + private readonly IUserService _userService; + + /// + /// Constructor + /// + /// + /// + /// + /// + /// + public BasicAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder, + ISystemClock clock, + IUserService userService) + : base(options, logger, encoder, clock) + { + _userService = userService; + } + + protected override Task HandleChallengeAsync(AuthenticationProperties properties) + { + Response.Headers["WWW-Authenticate"] = "Basic"; + return base.HandleChallengeAsync(properties); + } + + + + /// + /// + /// + /// + protected override Task HandleAuthenticateAsync() + { + // skip authentication if endpoint has [AllowAnonymous] attribute + var endpoint = Context.GetEndpoint(); + if (endpoint?.Metadata?.GetMetadata() != null) + return Task.FromResult(AuthenticateResult.NoResult()); + + if (!Request.Headers.ContainsKey("Authorization")) + return Task.FromResult(AuthenticateResult.Fail("Missing Authorization Header")); + bool isAuthenticated; + + string username; + try + { + var authHeader = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]); + var credentialBytes = Convert.FromBase64String(authHeader.Parameter); + var credentials = Encoding.UTF8.GetString(credentialBytes).Split(new[] { ':' }, 2); + username = credentials[0]; + var password = credentials[1]; + isAuthenticated = _userService.Authenticate(username, password); + } + catch + { + return Task.FromResult(AuthenticateResult.Fail("Invalid Authorization Header")); + } + + if (!isAuthenticated) + return Task.FromResult(AuthenticateResult.Fail("Invalid Username or Password")); + + var claims = new[] { + new Claim(ClaimTypes.Name, username), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return Task.FromResult(AuthenticateResult.Success(ticket)); + } + } +} diff --git a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs b/src/IO.Swagger/Helpers/JsonSerializerExtension.cs new file mode 100644 index 000000000..e20fd9fb7 --- /dev/null +++ b/src/IO.Swagger/Helpers/JsonSerializerExtension.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace IO.Swagger.Helpers +{ + public static class JsonSerializerExtension + { + private static readonly ConditionalWeakTable CwtUseSensitive = new ConditionalWeakTable(); + + public static JsonSerializer UseSensitive(this JsonSerializer options) + { + CwtUseSensitive.AddOrUpdate(options, null); + return options; + } + + public static bool HasSensitive(this JsonSerializer options) => + CwtUseSensitive.TryGetValue(options, out _); + } +} diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index c050ad220..389905057 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -1,7 +1,11 @@ -using System.Reflection; +using System; +using System.Collections.Generic; +using System.Reflection; using AdminShellNS; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Helpers { @@ -11,13 +15,25 @@ namespace IO.Swagger.Helpers /// public class OutputModifierContractResolver : DefaultContractResolver { - public bool AasHasViews = true; - public bool BlobHasValue = false; // only true, if extent modifier is withBLOBValue - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; private bool deep = true; private string content = "normal"; + private string extent = "withoutBlobValue"; + + /// + /// string: PropertyName to be excluded + /// Type: Class from which property needs to be excluded + /// + private Dictionary> excludingProperties; + + + /// + /// Constructor + /// + public OutputModifierContractResolver() + { + this.excludingProperties = new Dictionary>(); + AddToExcludingProperties(typeof(Blob), "value"); // By Default withoutBLOB + } @@ -31,17 +47,36 @@ public bool Deep get => deep; set { + //Core if (value == false) { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - this.BlobHasValue = false; - this.AasHasViews = false; + AddToExcludingProperties(typeof(AdministrationShell), "views"); + AddToExcludingProperties(typeof(Blob), "value"); + AddToExcludingProperties(typeof(SubmodelElementCollection), "value"); + AddToExcludingProperties(typeof(Operation), "in"); + AddToExcludingProperties(typeof(Operation), "out"); + } } } + + private void AddToExcludingProperties(Type type, string propName) + { + if (excludingProperties.ContainsKey(type)) + { + excludingProperties.TryGetValue(type, out List propNames); + if (!propNames.Contains(propName)) + { + propNames.Add(propName); + } + } + else + { + excludingProperties.Add(type, new List { propName }); + } + } + /// /// The enumeration Content indicates the kind of the response content’s serialization. /// @@ -51,9 +86,61 @@ public string Content set { content = value; + if (value.Equals("trimmed", StringComparison.OrdinalIgnoreCase)) + { + AddToExcludingProperties(typeof(AdministrationShell), "security"); + AddToExcludingProperties(typeof(AdministrationShell), "views"); + AddToExcludingProperties(typeof(AdministrationShell), "asset"); + AddToExcludingProperties(typeof(AdministrationShell), "submodels"); + AddToExcludingProperties(typeof(Submodel), "submodelElements"); + AddToExcludingProperties(typeof(SubmodelElementCollection), "value"); // TODO: Later as per data V3 + AddToExcludingProperties(typeof(Entity), "statements"); + AddToExcludingProperties(typeof(Entity), "asset"); // TODO: Later as per data V3 + AddToExcludingProperties(typeof(BasicEvent), "observed"); + AddToExcludingProperties(typeof(Property), "value"); + AddToExcludingProperties(typeof(Property), "valueId"); + AddToExcludingProperties(typeof(MultiLanguageProperty), "value"); + AddToExcludingProperties(typeof(MultiLanguageProperty), "valueId"); + AddToExcludingProperties(typeof(AdminShellV20.Range), "min"); + AddToExcludingProperties(typeof(AdminShellV20.Range), "max"); + AddToExcludingProperties(typeof(RelationshipElement), "first"); + AddToExcludingProperties(typeof(RelationshipElement), "second"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "first"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "second"); + AddToExcludingProperties(typeof(AnnotatedRelationshipElement), "annotations"); + AddToExcludingProperties(typeof(Blob), "mimeType"); + AddToExcludingProperties(typeof(Blob), "value"); + AddToExcludingProperties(typeof(File), "mimeType"); + AddToExcludingProperties(typeof(File), "value"); + + } + } + } + + /// + /// The enumeration Extent indicates whether to include BLOB or not. + /// + public string Extent + { + get => extent; + set + { + extent = value; + if (value.Equals("WithBLOBValue", StringComparison.OrdinalIgnoreCase)) + { + if (excludingProperties.ContainsKey(typeof(Blob))) + { + excludingProperties.Remove(typeof(Blob)); + } + } } } + /// + /// + /// + public Dictionary> ExcludingProperties { get => excludingProperties; set => excludingProperties = value; } + /// /// /// @@ -63,28 +150,39 @@ public string Content protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { JsonProperty property = base.CreateProperty(member, memberSerialization); + bool excluded = false; + if (excludingProperties.ContainsKey(property.DeclaringType)) + { + excludingProperties.TryGetValue(property.DeclaringType, out List propNames); + foreach (string propName in propNames) + { + if (property.PropertyName == propName) + { + property.ShouldSerialize = + instance => + { + excluded = true; + return false; + }; + } + } + } - if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && property.PropertyName == "submodelElements") - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && (property.PropertyName == "in" || property.PropertyName == "out")) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && property.PropertyName == "views") - property.ShouldSerialize = instance => { return false; }; + //Encode the value + if (!excluded && property.DeclaringType == typeof(Blob)) + { + property.ShouldSerialize = + instance => + { + var value = Base64UrlEncoder.Encode(((Blob)instance).value); + ((Blob)instance).value = value; + return true; + }; + } return property; } - protected override IValueProvider CreateMemberValueProvider(MemberInfo member) - { - return base.CreateMemberValueProvider(member); - } } + } diff --git a/src/IO.Swagger/Services/UserService.cs b/src/IO.Swagger/Services/UserService.cs new file mode 100644 index 000000000..1c2f4eb8d --- /dev/null +++ b/src/IO.Swagger/Services/UserService.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace IO.Swagger.Services +{ + /// + /// + /// + public interface IUserService + { + /// + /// + /// + /// + /// + /// + bool Authenticate(string username, string password); + } + + /// + /// + /// + public class UserService : IUserService + { + /// + /// + /// + /// + /// + /// + public bool Authenticate(string username, string password) + { + return (!AasxServer.Program.noSecurity) || (username.Equals("admin") && password.Equals("admin")); + } + } +} From 6db1a086e85c7c1b9d91e1c545903858c2514e94 Mon Sep 17 00:00:00 2001 From: Andreas Orzelski Date: Fri, 14 Jan 2022 07:38:11 +0100 Subject: [PATCH 22/53] Change launchSettings.json --- src/IO.Swagger/Properties/launchSettings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/IO.Swagger/Properties/launchSettings.json b/src/IO.Swagger/Properties/launchSettings.json index 7ef03b4e0..3bc67e449 100644 --- a/src/IO.Swagger/Properties/launchSettings.json +++ b/src/IO.Swagger/Properties/launchSettings.json @@ -18,13 +18,13 @@ }, "web": { "commandName": "Project", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", "launchBrowser": true, "launchUrl": "swagger", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Users\\tikjui\\source\\repos\\IDTA Project\\aasx-server\\content-for-demo\\aasxs\" --edit", - "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" }, "Docker": { "commandName": "Docker", From 816771047ec80cb74ce0c31fbd20806e5fbae2ae Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 31 Jan 2022 16:08:12 +0100 Subject: [PATCH 23/53] Removing Basic Authentification --- src/AasxServerBlazor/Startup.cs | 60 ++++++++--------- src/AasxServerStandardBib/AdminShell.cs | 66 +++++++++++++++++++ .../AssetAdministrationShellRepositoryApi.cs | 2 +- 3 files changed, 97 insertions(+), 31 deletions(-) diff --git a/src/AasxServerBlazor/Startup.cs b/src/AasxServerBlazor/Startup.cs index 4f8b6430a..7a19223e4 100644 --- a/src/AasxServerBlazor/Startup.cs +++ b/src/AasxServerBlazor/Startup.cs @@ -63,11 +63,11 @@ public void ConfigureServices(IServiceCollection services) }) .AddXmlSerializerFormatters(); - // configure DI for application services - services.AddScoped(); - // configure basic authentication - services.AddAuthentication("BasicAuthentication") - .AddScheme("BasicAuthentication", null); services.AddAuthentication(); + //// configure DI for application services + //services.AddScoped(); + //// configure basic authentication + //services.AddAuthentication("BasicAuthentication") + // .AddScheme("BasicAuthentication", null); services.AddAuthentication(); services @@ -87,29 +87,29 @@ public void ConfigureServices(IServiceCollection services) TermsOfService = new Uri("https://github.com/admin-shell-io/aas-specs") }); - c.AddSecurityDefinition("basic", new OpenApiSecurityScheme - { - Name = "Authorization", - Type = SecuritySchemeType.Http, - Scheme = "basic", - In = ParameterLocation.Header, - Description = "Basic Authorization header using the Bearer scheme." - }); - - c.AddSecurityRequirement(new OpenApiSecurityRequirement - { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = "basic" - } - }, - new string[] {} - } - }); + //c.AddSecurityDefinition("basic", new OpenApiSecurityScheme + //{ + // Name = "Authorization", + // Type = SecuritySchemeType.Http, + // Scheme = "basic", + // In = ParameterLocation.Header, + // Description = "Basic Authorization header using the Bearer scheme." + //}); + + //c.AddSecurityRequirement(new OpenApiSecurityRequirement + //{ + // { + // new OpenApiSecurityScheme + // { + // Reference = new OpenApiReference + // { + // Type = ReferenceType.SecurityScheme, + // Id = "basic" + // } + // }, + // new string[] {} + // } + //}); c.EnableAnnotations(); c.CustomSchemaIds(type => type.FullName); @@ -138,8 +138,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseStaticFiles(); app.UseRouting(); - app.UseAuthentication(); - app.UseAuthorization(); + //app.UseAuthentication(); + //app.UseAuthorization(); app.UseSwagger(); app.UseSwaggerUI(c => diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 535907831..9cfe78390 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -7068,6 +7068,38 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("RelationshipElement", "Rel"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var listFirst = new List>(); + foreach (var key in first.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listFirst.Add(valueDict); + } + + var listSecond = new List>(); + foreach (var key in second.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listSecond.Add(valueDict); + } + + dynamic relObj = new ExpandoObject(); + relObj.first = listFirst; + relObj.second = listSecond; + output.Add(idShort, relObj); + return output; + } } public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren @@ -7192,6 +7224,40 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary>>(); + + var listFirst = new List>(); + foreach (var key in first.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listFirst.Add(valueDict); + } + + var listSecond = new List>(); + foreach (var key in second.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + listSecond.Add(valueDict); + } + + dynamic relObj = new ExpandoObject(); + relObj.first = listFirst; + relObj.second = listSecond; + relObj.annotation = annotations; + output.Add(idShort, relObj); + return output; + } } public class Capability : SubmodelElement diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 938928744..3895fe4a4 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -25,7 +25,7 @@ namespace IO.Swagger.Controllers /// /// /// - [Authorize] + //[Authorize] [ApiController] public class AssetAdministrationShellRepositoryApiController : ControllerBase { From 1a0083f3ce03f29d37b5d18eaad49ead4ea9b18f Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Wed, 2 Feb 2022 11:46:57 +0100 Subject: [PATCH 24/53] Wrapping Server Side exception --- .../AssetAdministrationShellRepositoryApi.cs | 1617 ++++++++++------- src/IO.Swagger/Helpers/AASHelper.cs | 92 +- 2 files changed, 991 insertions(+), 718 deletions(-) diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 3895fe4a4..4c0c7396d 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; using AdminShellNS; using IO.Swagger.Attributes; using IO.Swagger.Helpers; @@ -49,14 +50,21 @@ public AssetAdministrationShellRepositoryApiController() [SwaggerOperation("DeleteAssetAdministrationShellById")] public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { - var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); - if (deleted) + try { - AasxServer.Program.signalNewData(2); - return NoContent(); - } + var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - return NotFound($"Could not delete the AAS"); + return NotFound($"AAS not "); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -70,14 +78,21 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ [SwaggerOperation("DeleteConceptDescriptionById")] public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] string cdIdentifier) { - bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); - if (deleted) + try { - AasxServer.Program.signalNewData(2); - return NoContent(); - } + bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - return NotFound($"Could not delete the concept description {cdIdentifier}"); + return NotFound($"Could not delete the concept description. Please check the identifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -93,34 +108,41 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] [SwaggerOperation("DeleteSubmodelElementByPath")] public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out AdminShellV20.SubmodelElement parent); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if (deleted) + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); } /// @@ -135,28 +157,34 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s [SwaggerOperation("DeleteSubmodelElementByPathSubmodelRepo")] public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath) { - submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, Base64UrlEncoder.Decode(idShortPath), out AdminShellV20.SubmodelElement parent); - if (submodelElement != null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } + + var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } - var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); - if (deleted) + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); } /// @@ -171,17 +199,21 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] [SwaggerOperation("DeleteSubmodelReferenceById")] public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier) { - aasIdentifier = Base64UrlEncoder.Decode(aasIdentifier); - submodelIdentifier = Base64UrlEncoder.Decode(submodelIdentifier); + try + { + bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (deleted) + { - bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (deleted) + return NoContent(); + } + + return NotFound($"Could not delete the submodel reference from AAS"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return NotFound($"Could not delete the submodel reference {submodelIdentifier} from AAS {aasIdentifier}"); } /// @@ -198,27 +230,34 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(byte[]), description: "Requested serialization based on SerializationFormat")] public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] List aasIds, [FromQuery][Required()] List submodelIds, [FromQuery][Required()] bool? includeConceptDescriptions) { - List payload = new List(); - foreach (string aasId in aasIds) + try { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); - if (aasReturn != null) + //TODO: One of the open questions + List payload = new List(); + foreach (string aasId in aasIds) { - payload.Add(aasReturn.AAS); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); + if (aasReturn != null) + { + payload.Add(aasReturn.AAS); + } } - } - //TODO: NotSure - foreach (string submodelId in submodelIds) - { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); - if (submodel != null) + foreach (string submodelId in submodelIds) { - payload.Add(submodel); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + if (submodel != null) + { + payload.Add(submodel); + } } - } - return new ObjectResult(payload); + return new ObjectResult(payload); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -235,10 +274,10 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] //public virtual IActionResult GetAllAssetAdministrationShells([FromQuery]List assetIds, [FromQuery]string idShort) public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string assetIds, [FromQuery] string idShort) { - //TODO: Consider a case where both assetIds and idShort are present. - var aasList = new List(); - if (string.IsNullOrEmpty(assetIds) && string.IsNullOrEmpty(idShort)) + try { + var aasList = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) @@ -247,23 +286,26 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string } } - return new ObjectResult(aasList); - } + //Filter w.r.t assetIds + if (!string.IsNullOrEmpty(assetIds)) + { + assetIds = Base64UrlEncoder.Decode(assetIds); + var assetIdList = JsonConvert.DeserializeObject>(assetIds); + aasList = aasHelper.FindAllAasByAssetIds(assetIdList); + } - if (!string.IsNullOrEmpty(assetIds)) - { - assetIds = Base64UrlEncoder.Decode(assetIds); - var assetIdList = JsonConvert.DeserializeObject>(assetIds); - return new ObjectResult(aasHelper.FindAllAasByAssetIds(assetIdList)); - } + //Filter w.r.t idShort + if (!string.IsNullOrEmpty(idShort)) + { + aasList = aasList.Where(x => (x.idShort != null) && x.idShort.Equals(idShort)).ToList(); + } - if (!string.IsNullOrEmpty(idShort)) + return new ObjectResult(aasList); + } + catch (Exception ex) { - return new ObjectResult(aasHelper.FindAllAasByIdShort(idShort)); + return BadRequest(ex.Message); } - - - return new ObjectResult(aasList); } /// @@ -280,45 +322,45 @@ public virtual IActionResult GetAllAssetAdministrationShells([FromQuery] string [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Concept Descriptions")] public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShort, [FromQuery] string isCaseOf, [FromQuery] string dataSpecificationRef) { - //Return all the concept-descriptions from the server, NO Filter - if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(isCaseOf) && string.IsNullOrEmpty(dataSpecificationRef)) + try { - var cdList = new List(); + var output = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) { - cdList.AddRange(env.AasEnv.ConceptDescriptions); + output.AddRange(env.AasEnv.ConceptDescriptions); } } - return new ObjectResult(cdList); - } + //Filter a list w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } - //CDs filtered with idShort - if (!string.IsNullOrEmpty(idShort)) - { - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIdShort(idShort)); - } + //Filter the list w.r.t. IsCaseOf + if (!string.IsNullOrEmpty(isCaseOf)) + { + var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); + output = output.Where(x => (x.IsCaseOf != null) && aasHelper.CompareIsCaseOf(x.IsCaseOf, isCaseOfObj)).ToList(); + } - //CDs filtered with isCaseOfReference - if (!string.IsNullOrEmpty(isCaseOf)) - { - var isCaseOfObj = JsonConvert.DeserializeObject>(Base64UrlEncoder.Decode(isCaseOf)); - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByIsCaseOf(isCaseOfObj)); - } + //Filter the list w.r.t. dataSpecificationRef + if (!string.IsNullOrEmpty(dataSpecificationRef)) + { + var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); + output = output.Where(x => (x.embeddedDataSpecification != null) && aasHelper.CompareDataSpecification(x.embeddedDataSpecification, dataSpecRefReq)).ToList(); + } + + return new ObjectResult(output); - //CDs filtered with isCaseOfReference - if (!string.IsNullOrEmpty(dataSpecificationRef)) + } + catch (Exception ex) { - var dataSpecRefReq = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(dataSpecificationRef)); - return new ObjectResult(aasHelper.FindAllConceptDescriptionsByDataSpecRef(dataSpecRefReq)); + return BadRequest(ex.Message); } - - //TODO:Re-do - return NoContent(); - } /// @@ -338,23 +380,30 @@ public virtual IActionResult GetAllConceptDescriptions([FromQuery] string idShor public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - // access AAS and Submodel - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - - if (submodel == null) + try { - return NotFound($"Submodel not found."); - } + // access AAS and Submodel + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - List submodelElements = new List(); - foreach (var smeWrapper in submodel.submodelElements) - { - submodelElements.Add(smeWrapper.submodelElement); - } + if (submodel == null) + { + return NotFound($"Submodel not found."); + } + + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } - var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); - return new ObjectResult(json); + return new ObjectResult(json); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -372,19 +421,25 @@ public virtual IActionResult GetAllSubmodelElements([FromRoute][Required] string [SwaggerResponse(statusCode: 200, type: typeof(List), description: "List of found submodel elements")] public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel != null) + try { - List submodelElements = new List(); - foreach (var smeWrapper in submodel.submodelElements) + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel != null) { - submodelElements.Add(smeWrapper.submodelElement); + List submodelElements = new List(); + foreach (var smeWrapper in submodel.submodelElements) + { + submodelElements.Add(smeWrapper.submodelElement); + } + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + + return new ObjectResult(json); } - return new ObjectResult(submodelElements); + return NotFound($"Submodel not found."); } - else + catch (Exception ex) { - return NotFound($"Submodel not found."); + return BadRequest(ex.Message); } } @@ -400,14 +455,18 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested submodel references")] public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] string aasIdentifier) { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - return new ObjectResult(aasReturn.AAS.submodelRefs); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS.submodelRefs); + } + return NotFound($"AAS not found."); } - else + catch (Exception ex) { - return NotFound($"AAS not found."); + return BadRequest(ex.Message); } } @@ -425,34 +484,36 @@ public virtual IActionResult GetAllSubmodelReferences([FromRoute][Required] stri [SwaggerResponse(statusCode: 200, type: typeof(List), description: "Requested Submodels")] public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [FromQuery] string idShort) { - //Fetch all the submodels from the server - if (string.IsNullOrEmpty(idShort) && string.IsNullOrEmpty(semanticId)) + try { - var submodelList = new List(); + var output = new List(); foreach (AdminShellPackageEnv env in AasxServer.Program.env) { if (env != null) { - submodelList.AddRange(env.AasEnv.Submodels); + output.AddRange(env.AasEnv.Submodels); } } - return new ObjectResult(submodelList); - } + //Filter w.r.t. semanticId + if (!string.IsNullOrEmpty(semanticId)) + { + var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); + output = output.Where(x => (x.semanticId != null) && x.semanticId.Matches(reqSemaniticId)).ToList(); + } - if (!string.IsNullOrEmpty(idShort)) - { - return new ObjectResult(aasHelper.FindAllSubmodelsByIdShort(idShort)); - } + //Filter w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } - if (!string.IsNullOrEmpty(semanticId)) + return new ObjectResult(output); + } + catch (Exception ex) { - var reqSemaniticId = JsonConvert.DeserializeObject(Base64UrlEncoder.Decode(semanticId)); - return new ObjectResult(aasHelper.FindAllSubmodelsBySemanticId(reqSemaniticId)); + return BadRequest(ex.Message); } - - //TODO: Re-Do - return NoContent(); } /// @@ -468,20 +529,26 @@ public virtual IActionResult GetAllSubmodels([FromQuery] string semanticId, [Fro [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] string aasIdentifier, [FromQuery] string content) { - //TODO: Content ?? - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - //If content is empty or Normal, return the object as it is - if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) { - return new ObjectResult(aasReturn.AAS); + //If content is empty or Normal, return the object as it is + if (string.IsNullOrEmpty(content) || content.Equals("normal", StringComparison.OrdinalIgnoreCase)) + { + return new ObjectResult(aasReturn.AAS); + } + + return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); } - return new ObjectResult(aasHelper.HandleOutputModifiers(aasReturn.AAS, content: content)); + return NotFound(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); } - - return NotFound(); } /// @@ -496,13 +563,21 @@ public virtual IActionResult GetAssetAdministrationShell([FromRoute][Required] s [SwaggerResponse(statusCode: 200, type: typeof(AssetAdministrationShell), description: "Requested Asset Administration Shell")] public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Required] string aasIdentifier) { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - return new ObjectResult(aasReturn.AAS); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } - return NotFound(); + return NotFound($"Please check aasIdentifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } } /// @@ -519,17 +594,24 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required] string aa { //TODO:Change to AssetInformation in V3 //No AssetInformation in AAS_V2, hence returning Asset referenced by AAS - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS != null) + try { - var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); - if (asset != null) + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) { - return new ObjectResult(asset); + var asset = aasHelper.FindAssetwithReference(aasReturn.AAS.assetRef); + if (asset != null) + { + return new ObjectResult(asset); + } } - } - return NotFound(); + return NotFound(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } @@ -545,13 +627,21 @@ public virtual IActionResult GetAssetInformation([FromRoute][Required] string aa [SwaggerResponse(statusCode: 200, type: typeof(ConceptDescription), description: "Requested Concept Description")] public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] string cdIdentifier) { - var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); - if (conceptDescription != null) + try { - return new ObjectResult(conceptDescription); - } + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); + if (conceptDescription != null) + { + return new ObjectResult(conceptDescription); + } - return NotFound($"Concept Description {cdIdentifier} not found"); + return NotFound($"Could not delete the concept description. Please check the identifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } } /// @@ -570,38 +660,45 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - if (string.IsNullOrEmpty(handleId)) + try { - return BadRequest($"Invalid HandleId."); - } - //Check if aas exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found"); - } + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } - var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); - if (opResult != null) + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } + + return NotFound($"Operation with the handle id not found"); + } + catch (Exception ex) { - return new ObjectResult(opResult); + return BadRequest(ex.Message); } - - return NotFound($"Operation with the handle id not found"); } /// @@ -619,32 +716,39 @@ public virtual IActionResult GetOperationAsyncResult([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromRoute][Required] string handleId, [FromQuery] string content) { - if (string.IsNullOrEmpty(handleId)) + try { - return BadRequest($"Invalid HandleId."); - } + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found."); + } - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Operation {idShortPath} not found."); + } + + var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); + if (opResult != null) + { + return new ObjectResult(opResult); + } - var opResult = aasHelper.GetOperationAsyncResult(Base64UrlEncoder.Decode(handleId)); - if (opResult != null) + return NotFound($"Operation with the handle id not found"); + } + catch (Exception ex) { - return new ObjectResult(opResult); + return BadRequest(ex.Message); } - - return NotFound($"Operation with the handle id not found"); } /// @@ -663,21 +767,26 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider other parameters súch as level, content, & extent - - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); - } + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } - var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); - if (json != null) + return NotFound($"Either AAS or Submodel not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Either AAS or Submodel not found"); } /// @@ -697,33 +806,40 @@ public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentif [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found. Please check the identifier."); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found. Please check the identifier."); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); - if (json != null) + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel Element not found"); } /// @@ -742,28 +858,33 @@ public virtual IActionResult GetSubmodelElementByPath([FromRoute][Required] stri [SwaggerResponse(statusCode: 200, type: typeof(SubmodelElement), description: "Requested submodel element")] public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: support for Content, extent and level - - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Requested submodel element not found."); - } + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) + { + return NotFound($"Requested submodel element not found."); + } - var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); - if (json != null) + var json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel Element not found"); } /// @@ -781,20 +902,26 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re [SwaggerResponse(statusCode: 200, type: typeof(Submodel), description: "Requested Submodel")] public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider rest of the parameters i.e., level, content & extent - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"The Submodel {submodelIdentifier} not found"); - } + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"The Submodel {submodelIdentifier} not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } - var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); - if (json != null) + return NotFound($"Submodel not found"); + } + catch (Exception ex) { - return new ObjectResult(json); + return BadRequest(ex.Message); } - - return NotFound($"Submodel not found"); } /// @@ -814,52 +941,59 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] strin [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { - //Check if aas exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found"); - } - - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } - - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) - { - return NotFound($"Operation {idShortPath} not found."); - } - - if (submodelElement is AdminShellV20.Operation operation) + try { - //Primary checks for inout and input variables - if (operation.inputVariable.Count != body.InputArguments.Count) + //Check if aas exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) { - return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + return NotFound($"AAS not found"); } - if (operation.inoutputVariable.Count != body.InputArguments.Count) + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) { - return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + return NotFound($"Submodel not found."); } - if ((_async != null) && (!(bool)_async)) + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) { - return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + return NotFound($"Operation {idShortPath} not found."); } - var opHandle = aasHelper.InvokeOperationAsync(operation, body); - var json = JsonConvert.SerializeObject(opHandle); - return new ObjectResult(json); - } - else + if (submodelElement is AdminShellV20.Operation operation) + { + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } + + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } + } + catch (Exception ex) { - return NotFound($"Element in the IdShortPath is not an Operation."); + return BadRequest(ex.Message); } } @@ -879,45 +1013,52 @@ public virtual IActionResult InvokeOperation([FromBody] OperationRequest body, [ [SwaggerResponse(statusCode: 200, type: typeof(OperationResult), description: "Operation result object")] public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationRequest body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] bool? _async, [FromQuery] string content) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found."); - } - - //Find the operation from the idShortpath - var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (submodelElement == null) + try { - return NotFound($"Operation {idShortPath} not found."); - } - - if (submodelElement is AdminShellV20.Operation operation) - { - //Primary checks for inout and input variables - if (operation.inputVariable.Count != body.InputArguments.Count) + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) { - return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + return NotFound($"Submodel not found."); } - if (operation.inoutputVariable.Count != body.InputArguments.Count) + //Find the operation from the idShortpath + var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (submodelElement == null) { - return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + return NotFound($"Operation {idShortPath} not found."); } - if ((_async != null) && (!(bool)_async)) + if (submodelElement is AdminShellV20.Operation operation) { - return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); - } + //Primary checks for inout and input variables + if (operation.inputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of input arguments in payload does not fit expected input arguments of Operation."); + } - var opHandle = aasHelper.InvokeOperationAsync(operation, body); - var json = JsonConvert.SerializeObject(opHandle); - return new ObjectResult(json); + if (operation.inoutputVariable.Count != body.InputArguments.Count) + { + return BadRequest($"Number of InOut arguments in payload does not fit expected InOut arguments of Operation."); + } + + if ((_async != null) && (!(bool)_async)) + { + return new ObjectResult(aasHelper.InvokeOperationSync(operation, body)); + } + + var opHandle = aasHelper.InvokeOperationAsync(operation, body); + var json = JsonConvert.SerializeObject(opHandle); + return new ObjectResult(json); + } + else + { + return NotFound($"Element in the IdShortPath is not an Operation."); + } } - else + catch (Exception ex) { - return NotFound($"Element in the IdShortPath is not an Operation."); + return BadRequest(ex.Message); } } @@ -931,29 +1072,37 @@ public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationReq [ValidateModelState] [SwaggerOperation("PostAssetAdministrationShell")] [SwaggerResponse(statusCode: 201, type: typeof(AssetAdministrationShell), description: "Asset Administration Shell created successfully")] - //public virtual IActionResult PostAssetAdministrationShell([FromBody]AssetAdministrationShell body) + //public virtual IActionResult PostAssetAdministrationShell([FromBody] AssetAdministrationShell body) public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - //Check if already exists - var aasReturn = aasHelper.FindAas(body.idShort); - if (aasReturn.AAS != null) - { - return Conflict($"Asset Administration Shell {body.idShort} already exists."); - } + //Check if already exists + var aasReturn = aasHelper.FindAas(body.identification.id); + if (aasReturn.AAS != null) + { + return Conflict($"Asset Administration Shell already exists."); + } - bool added = aasHelper.AddAas(body); - if (added) + bool added = aasHelper.AddAas(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + return BadRequest(ex.Message); + throw; } - - return Ok($"Error: not added since datastructure completely filled already"); } @@ -970,26 +1119,34 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV //public virtual IActionResult PostConceptDescription([FromBody]ConceptDescription body) public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.ConceptDescription body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Concept Description."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } - //Check if already exists - var conceptDescription = aasHelper.FindConceptDescription(body.idShort, out _); - if (conceptDescription != null) - { - return Conflict($"Concept Description {body.idShort} already exists."); - } + //Check if already exists + var conceptDescription = aasHelper.FindConceptDescription(body.identification.id, out _); + if (conceptDescription != null) + { + return Conflict($"Concept Description {body.idShort} already exists."); + } - bool added = aasHelper.AddConceptDescription(body); - if (added) + bool added = aasHelper.AddConceptDescription(body); + if (added) + { + AasxServer.Program.signalNewData(1); + return Created($"Concept Description {body.idShort} created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Concept Description {body.idShort} created successfully.", body); + return BadRequest(ex.Message); + throw; } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1005,26 +1162,33 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con //public virtual IActionResult PostSubmodel([FromBody]Submodel body) public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - //Check if already exists - var submodel = aasHelper.FindSubmodel(body.idShort); - if (submodel != null) - { - return Conflict($"Submodel {body.idShort} already exists."); - } + //Check if already exists + var submodel = aasHelper.FindSubmodel(body.identification.id); + if (submodel != null) + { + return Conflict($"Submodel {body.idShort} already exists."); + } + + bool added = aasHelper.AddSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Submodel created successfully.", body); + } - bool added = aasHelper.AddSubmodel(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return Created($"Submodel {body.idShort} created successfully.", body); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1045,44 +1209,48 @@ public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body //public virtual IActionResult PostSubmodelElement([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider rest of the parameters, i.e., level, content & extent - - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - //Check for idShort in SubmodelElement - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"No IdShort found in the submodel element"); - } + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } - //Check if submodel element already exists in the submodel - var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if (submodelElement != null) - { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); - } + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(submodel, body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1104,52 +1272,60 @@ public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.Submod //public virtual IActionResult PostSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - //IdShortPath is a path to the parent element - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (parentSME == null) - { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); - } + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } - //Check if requested submodel element already exists in the parent SME - if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) - { - var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if (existingSME != null) + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } } - } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element created successfully", output); + return BadRequest(ex.Message); + throw; } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1170,45 +1346,52 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. //public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel not found"); + } - //IdShortPath is a path to the parent element - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); - if (parentSME == null) - { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); - } + //IdShortPath is a path to the parent element + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); + if (parentSME == null) + { + return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } - //Check if requested submodel element already exists in the parent SME - if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) - { - var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); - if (existingSME != null) + //Check if requested submodel element already exists in the parent SME + if (parentSME is AdminShellV20.SubmodelElementCollection parentSMEColl) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); + if (existingSME != null) + { + return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + } } - } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element created successfully", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element created successfully", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1228,35 +1411,42 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad //public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - //Check for idShort in SubmodelElement - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"No IdShort found in the submodel element"); - } + //Check for idShort in SubmodelElement + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"No IdShort found in the submodel element"); + } - //Check if submodel element already exists in the submodel - var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); - if (submodelElement != null) - { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); - } + //Check if submodel element already exists in the submodel + var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); + if (submodelElement != null) + { + return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + } + + bool added = aasHelper.AddSubmodelElement(submodel, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel Element {body.idShort} created successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(submodel, body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1273,39 +1463,46 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe //public virtual IActionResult PostSubmodelReference([FromBody]Reference body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Reference body, [FromRoute][Required] string aasIdentifier) { - if (body.Count == 0) + try { - return BadRequest($"No references present in the request payload."); - } - else if (body.Count != 1) - { - return BadRequest($"More than one references present in the request payload."); - } + if (body.Count == 0) + { + return BadRequest($"No references present in the request payload."); + } + else if (body.Count != 1) + { + return BadRequest($"More than one references present in the request payload."); + } - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS {aasIdentifier} not found."); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - //Check if Submodel with this reference exists - var submodel = aasHelper.FindSubmodelWithReference(body); - if (submodel == null) - { - return BadRequest($"No Submodel with this reference present in the server"); - } + //Check if Submodel with this reference exists + var submodel = aasHelper.FindSubmodelWithReference(body); + if (submodel == null) + { + return BadRequest($"No Submodel with this reference present in the server"); + } - //Check if reference already exists with the AAS - if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + //Check if reference already exists with the AAS + if (aasReturn.AAS.HasSubmodelRef(new AdminShellV20.SubmodelRef(body))) + { + return Conflict($"The Submodel Reference already exists in AAS"); + } + + aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); + AasxServer.Program.signalNewData(1); + return Created($"Submodel reference created successfully.", body); + } + catch (Exception ex) { - return Conflict($"The Submodel Reference already exists in AAS {aasIdentifier}"); + return BadRequest(ex.Message); } - aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); - AasxServer.Program.signalNewData(1); - return Created($"Submodel reference created successfully.", body); - } /// @@ -1322,26 +1519,27 @@ public virtual IActionResult PostSubmodelReference([FromBody] AdminShellV20.Refe //public virtual IActionResult PutAssetAdministrationShell([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier, [FromQuery]string content) public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier, [FromQuery] string content) { - //TODO: content?? - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - if (!aasIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {aasIdentifier} and payload do not match"); - } + bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, content: content); + return Created($"AAS updated successfully.", output); + } - bool added = aasHelper.AddAas(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, content: content); - return Created($"AAS {body.idShort} created successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1357,25 +1555,26 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV2 //public virtual IActionResult PutAssetAdministrationShellById([FromBody]AssetAdministrationShell body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShellV20.AdministrationShell body, [FromRoute][Required] string aasIdentifier) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in AAS."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } - //TODO: What if iDShort needs to be updated - if (!aasIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {aasIdentifier} and payload do not match"); - } + bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(1); + return NoContent(); + } - bool added = aasHelper.AddAas(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1391,26 +1590,33 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShe //public virtual IActionResult PutAssetInformation([FromBody]AssetInformation body, [FromRoute][Required]string aasIdentifier) public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset body, [FromRoute][Required] string aasIdentifier) { - //Check if identification exists - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Asset."); - } + //Check if identification exists + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Asset."); + } - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS not found."); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - bool added = aasHelper.AddAsset(body, aasReturn); - if (added) + bool added = aasHelper.AddAsset(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1426,24 +1632,26 @@ public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset //public virtual IActionResult PutConceptDescriptionById([FromBody]ConceptDescription body, [FromRoute][Required]string cdIdentifier) public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20.ConceptDescription body, [FromRoute][Required] string cdIdentifier) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Concept Description."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Concept Description."); + } - if (!cdIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {cdIdentifier} and payload do not match"); - } + bool added = aasHelper.AddConceptDescription(body, Base64UrlEncoder.Decode(cdIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(1); + return NoContent(); + } - bool added = aasHelper.AddConceptDescription(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - return NoContent(); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } /// @@ -1463,39 +1671,39 @@ public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20. //public virtual IActionResult PutSubmodel([FromBody]Submodel body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //TODO: Consider other parameters i.e., level, content, extent - - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } - - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) - { - return NotFound($"AAS {aasIdentifier} not found."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - if (!submodelIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {submodelIdentifier} and payload do not match"); - } + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } - bool added = aasHelper.AddSubmodel(body); - if (added) - { - //Check if AAS has the submodelRef, if not create one. - var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); - if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + if (added) { - aasReturn.AAS.submodelRefs.Add(newsmRef); + //Check if AAS has the submodelRef, if not create one. + var newsmRef = AdminShellV20.SubmodelRef.CreateNew("Submodel", true, body.identification.idType, body.identification.id); + if (!aasReturn.AAS.HasSubmodelRef(newsmRef)) + { + aasReturn.AAS.submodelRefs.Add(newsmRef); + } + AasxServer.Program.signalNewData(1); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); } - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); - } - return Ok($"Error: not added since datastructure completely filled already"); + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } } /// @@ -1516,42 +1724,54 @@ public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, //public virtual IActionResult PutSubmodelElementByPath([FromBody]SubmodelElement body, [FromRoute][Required]string aasIdentifier, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string aasIdentifier, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if AAS exists - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); - if (aasReturn.AAS == null) + try { - return NotFound($"AAS {aasIdentifier} not found"); - } + //Check if AAS exists + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS {aasIdentifier} not found"); + } - //Check if submodel exists - var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) - { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } - //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) - { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + + if (!idShortPath.Contains('.')) + { + return BadRequest($"Please check the idShortPath again."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1571,35 +1791,42 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S //public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody]SubmodelElement body, [FromRoute][Required]string submodelIdentifier, [FromRoute][Required]string idShortPath, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] AdminShellV20.SubmodelElement body, [FromRoute][Required] string submodelIdentifier, [FromRoute][Required] string idShortPath, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); - if (submodel == null) + try { - return NotFound($"Submodel {submodelIdentifier} not found"); - } + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Submodel {submodelIdentifier} not found"); + } - if (string.IsNullOrEmpty(body.idShort)) - { - return BadRequest($"IdShort is not set in the submodel element."); - } - //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) - { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); - } + if (string.IsNullOrEmpty(body.idShort)) + { + return BadRequest($"IdShort is not set in the submodel element."); + } + //IdShortPath is a path to this requested submodel element + string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + if (parentSME == null) + { + return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + } + + bool added = aasHelper.AddSubmodelElement(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel element updated successfully.", output); + } - bool added = aasHelper.AddSubmodelElement(parentSME, body); - if (added) + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel element updated successfully.", output); + return BadRequest(ex.Message); } - - //Re-do - return NotFound($"Requested submodel element not found."); } /// @@ -1618,25 +1845,27 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] Adm //public virtual IActionResult PutSubmodelSubmodelRepo([FromBody]Submodel body, [FromRoute][Required]string submodelIdentifier, [FromQuery]string level, [FromQuery]string content, [FromQuery]string extent) public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Submodel body, [FromRoute][Required] string submodelIdentifier, [FromQuery] string level, [FromQuery] string content, [FromQuery] string extent) { - if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + try { - return BadRequest($"No Identification found in Submodel."); - } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } - if (!submodelIdentifier.Equals(body.idShort)) - { - return BadRequest($"idShort {submodelIdentifier} and payload do not match"); - } + bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + if (added) + { + AasxServer.Program.signalNewData(2); + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + return Created($"Submodel updated successfully.", output); + } - bool added = aasHelper.AddSubmodel(body); - if (added) + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) { - AasxServer.Program.signalNewData(2); - object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel updated successfully.", output); + return BadRequest(ex.Message); } - - return Ok($"Error: not added since datastructure completely filled already"); } } } diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index df78178ba..271a92d7f 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -141,6 +141,7 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int return null; } + //One of the open Questions //TODO: Check if asset needs to be deleted? an asset can be referenced in many shells. internal bool DeleteAASAndAsset(string aasIdentifier) { @@ -171,13 +172,18 @@ internal bool DeleteAASAndAsset(string aasIdentifier) return success; } - internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, SubmodelElement parent) + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, object parent) { if (parent is SubmodelElementCollection parentColl) { parentColl.value.Remove(submodelElement); return true; } + else if (parent is Submodel parentSm) + { + parentSm.Remove(submodelElement); + return true; + } return false; } @@ -212,6 +218,7 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); + AasxServer.Program.signalNewData(1); return true; } } @@ -239,14 +246,6 @@ internal Submodel FindSubmodel(string submodelIdentifier) if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) return null; - //TODO: Check again - // via handle - //var specialHandles = CreateHandlesFromRawUrl(rawUrl); - //var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); - //if (handleId != null && handleId.identification != null) - // return Packages[0].AasEnv.FindSubmodel(handleId.identification); - - // no, iterate & find foreach (var submodel in Packages[0].AasEnv.Submodels) { if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) @@ -263,7 +262,7 @@ internal Submodel FindSubmodel(string submodelIdentifier) /// /// /// - internal bool AddAas(AdministrationShell aas) + internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; @@ -271,11 +270,13 @@ internal bool AddAas(AdministrationShell aas) { if (Packages[envi] != null) { - var existingAas = Packages[envi].AasEnv.FindAAS(aas.identification); - if (existingAas != null) + aasIdentifier ??= aas.identification.id; + var existingAas = FindAas(aasIdentifier); + if (existingAas.AAS != null) { - Packages[envi].AasEnv.AdministrationShells.Remove(existingAas); + Packages[envi].AasEnv.AdministrationShells.Remove(existingAas.AAS); Packages[envi].AasEnv.AdministrationShells.Add(aas); + AasxServer.Program.signalNewData(1); return true; } } @@ -295,25 +296,27 @@ internal bool AddAas(AdministrationShell aas) { Packages[emptyPackageIndex] = new AdminShellPackageEnv(); Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); + AasxServer.Program.signalNewData(1); return true; } return false; } - internal bool AddConceptDescription(ConceptDescription conceptDescription) + internal bool AddConceptDescription(ConceptDescription conceptDescription, string cdIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + cdIdentifier ??= conceptDescription.identification.id; for (int envi = 0; envi < Packages.Length; envi++) { if (Packages[envi] != null) { - var existingCD = Packages[envi].AasEnv.FindConceptDescription(conceptDescription.identification); + var existingCD = FindConceptDescription(cdIdentifier, out int packageIndex); if (existingCD != null) { - Packages[envi].AasEnv.ConceptDescriptions.Remove(existingCD); - Packages[envi].AasEnv.ConceptDescriptions.Add(conceptDescription); + Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(existingCD); + Packages[packageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); return true; } } @@ -459,7 +462,23 @@ internal List FindAllConceptDescriptionsByIsCaseOf(List isCaseOf1, List isCaseOf2) + internal bool CompareDataSpecification(HasDataSpecification embeddedDataSpecification, DataSpecificationRef dataSpecRefReq) + { + if (embeddedDataSpecification != null) + { + foreach (EmbeddedDataSpecification embDataSpec in embeddedDataSpecification) + { + if (embDataSpec.dataSpecification.Matches(dataSpecRefReq)) + { + return true; + } + } + } + + return false; + } + + internal bool CompareIsCaseOf(List isCaseOf1, List isCaseOf2) { foreach (Reference isCaseOf1_Ref in isCaseOf1) { @@ -570,6 +589,16 @@ private object GetValueOnly(object obj, string level) { return submodelElement.ToValueOnlySerialization(); } + else if (obj is List smEleList) + { + List values = new List(); + foreach (var smElement in smEleList) + { + object value = GetValueOnly(smElement, level); + values.Add(value); + } + return values; + } else { Console.WriteLine("Not supported"); @@ -627,6 +656,16 @@ private object GetObjectReference(object obj) return submodel.GetReference(); else if (obj is SubmodelElement submodelElement) return submodelElement.GetReference(); + else if (obj is List smEleList) + { + List values = new List(); + foreach (var smElement in smEleList) + { + object value = GetObjectReference(smElement); + values.Add(value); + } + return values; + } else { Console.WriteLine("Error: Object not handled for the Reference type modifier."); @@ -634,15 +673,16 @@ private object GetObjectReference(object obj) } } - internal bool AddSubmodel(Submodel submodel) + internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + submodelIdentifier ??= submodel.identification.id; for (int envi = 0; envi < Packages.Length; envi++) { if (Packages[envi] != null) { - var existingSubmodel = Packages[envi].AasEnv.FindSubmodel(submodel.identification); + var existingSubmodel = FindSubmodel(submodelIdentifier); if (existingSubmodel != null) { Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); @@ -722,7 +762,7 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// e.g. SMEColl_idShort.SME_idShort /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out SubmodelElement parent) + internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out object parent) { parent = null; if (idShortPath.Contains('.')) @@ -735,7 +775,7 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS { if (submodelElement is SubmodelElementCollection collection) { - return FindSubmodelElementByPath(collection, idShorts[1], out parent); + return FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); } } } @@ -744,7 +784,11 @@ internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idS { var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); if (smeWrapper != null) + { + parent = submodel; return smeWrapper.submodelElement; + } + } return null; @@ -796,7 +840,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) return outputSubmodels; } - internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection smeColl, string idShortPath, out SubmodelElement parent) + internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) { parent = null; string[] idShorts = idShortPath.Split('.', 2); @@ -808,7 +852,7 @@ internal SubmodelElement FindSubmodelElementByPath(SubmodelElementCollection sme if (submodelElement is SubmodelElementCollection collection) { parent = collection; - FindSubmodelElementByPath(collection, idShorts[1], out parent); + FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); } else if (submodelElement is SubmodelElement) { From 22468560dc5cc96ce07945df34a6ef3725eb72a4 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed, 9 Feb 2022 08:51:12 +0100 Subject: [PATCH 25/53] Swagger Project path fixed, Swagger Test Project added (#93) Swagger Project path fixed, Swagger Test Project added (#93) --- src/IO.Swagger/IO.Swagger.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj index 4aa64e512..0f5fb677b 100644 --- a/src/IO.Swagger/IO.Swagger.csproj +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -19,6 +19,6 @@ - + From def7c550f31c5f7842ce157022fe97b4a38e0b85 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Wed, 9 Feb 2022 09:58:55 +0100 Subject: [PATCH 26/53] added test project (#94) added test project (#94) --- src/AasxServer.sln | 18 +++++++- src/IO.Swagger.Test/AASHelperTest.cs | 36 ++++++++++++++++ src/IO.Swagger.Test/IO.Swagger.Test.csproj | 21 ++++++++++ src/IO.Swagger/Helpers/AASHelper.cs | 2 +- src/IO.Swagger/IO.Swagger.csproj | 49 ++++++++++++---------- 5 files changed, 101 insertions(+), 25 deletions(-) create mode 100644 src/IO.Swagger.Test/AASHelperTest.cs create mode 100644 src/IO.Swagger.Test/IO.Swagger.Test.csproj diff --git a/src/AasxServer.sln b/src/AasxServer.sln index ec3f4c8a7..2020ab76a 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29306.81 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerCore", "AasxServerCore\AasxServerCore.csproj", "{7C0704A8-85C7-4FC9-B12D-C7B9E63EF7B6}" EndProject @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxServerBlazor", "AasxSer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "IO.Swagger\IO.Swagger.csproj", "{478697A0-89E4-4039-902E-0F13EA4EAD72}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "IO.Swagger.Test\IO.Swagger.Test.csproj", "{1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -89,6 +91,18 @@ Global {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x64.Build.0 = Release|Any CPU {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.ActiveCfg = Release|Any CPU {478697A0-89E4-4039-902E-0F13EA4EAD72}.Release|x86.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x64.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Debug|x86.Build.0 = Debug|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|Any CPU.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x64.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x64.Build.0 = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x86.ActiveCfg = Release|Any CPU + {1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/IO.Swagger.Test/AASHelperTest.cs b/src/IO.Swagger.Test/AASHelperTest.cs new file mode 100644 index 000000000..5ba34ed4b --- /dev/null +++ b/src/IO.Swagger.Test/AASHelperTest.cs @@ -0,0 +1,36 @@ +using IO.Swagger.Helpers; +using NUnit.Framework; +using static AdminShellNS.AdminShellV20; + +namespace IO.Swagger.Test +{ + public class AASHelperTest + { + + + + private AASHelper? _helper; + + [SetUp] + public void Setup() + { + _helper = new AASHelper(); + } + + [Test] + public void Test1() + { + var sm = new Submodel(); + var l1 = new SubmodelElementCollection { idShort = "level1" }; + var l2 = new SubmodelElementCollection { idShort = "level2" }; + var l3 = new SubmodelElementCollection { idShort = "level3" }; + var l4 = new SubmodelElementCollection { idShort = "level4" }; + l3.Add(l4); + l2.Add(l3); + l1.Add(l2); + sm.Add(l1); + var found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); + Assert.AreEqual(found.idShort, "level2"); + } + } +} \ No newline at end of file diff --git a/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/src/IO.Swagger.Test/IO.Swagger.Test.csproj new file mode 100644 index 000000000..97c7a63d5 --- /dev/null +++ b/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 271a92d7f..13df820b6 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -843,7 +843,7 @@ internal List FindAllSubmodelsByIdShort(string idShort) internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) { parent = null; - string[] idShorts = idShortPath.Split('.', 2); + string[] idShorts = idShortPath.Split('.', 2); // idShortPath might be empty or without '.' foreach (var smeWrapper in smeColl.value) { var submodelElement = smeWrapper.submodelElement; diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj index 0f5fb677b..33b969f78 100644 --- a/src/IO.Swagger/IO.Swagger.csproj +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -1,24 +1,29 @@  - - IO.Swagger - IO.Swagger - netcoreapp3.1 - true - true - IO.Swagger - IO.Swagger - - - - - - - - - - - - - - + + IO.Swagger + IO.Swagger + netcoreapp3.1 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + + + + + + + + <_Parameter1>IO.Swagger.Test + + From 94b8afeb59dc8051d61850974d65f5748dddbe49 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Wed, 9 Feb 2022 13:58:00 +0100 Subject: [PATCH 27/53] BugFix:DotSeperated IdShortPath --- src/IO.Swagger/Helpers/AASHelper.cs | 93 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 13df820b6..257a92f1f 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -172,6 +172,7 @@ internal bool DeleteAASAndAsset(string aasIdentifier) return success; } + internal bool DeleteSubmodelElementByPath(SubmodelElement submodelElement, object parent) { if (parent is SubmodelElementCollection parentColl) @@ -261,6 +262,7 @@ internal Submodel FindSubmodel(string submodelIdentifier) /// Similar to HTTP PUT /// /// + /// /// internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { @@ -624,7 +626,14 @@ private void GetIdShortPath(object obj, string level, List idShortPath) } else if (obj is SubmodelElementCollection collection) { - idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + if (idShortPath.Count == 0) + { + idShortPath.Add(collection.idShort); + } + else + { + idShortPath.Add(idShortPath.Last() + "." + collection.idShort); + } if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) { foreach (var smEle in collection.value) @@ -635,7 +644,14 @@ private void GetIdShortPath(object obj, string level, List idShortPath) } else if (obj is Entity entity) { - idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + if (idShortPath.Count == 0) + { + idShortPath.Add(entity.idShort); + } + else + { + idShortPath.Add(idShortPath.Last() + "." + entity.idShort); + } //TODO: look for definition and children* } else if (obj is SubmodelElement smEle) @@ -758,39 +774,53 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// /// /// - /// + /// /// e.g. SMEColl_idShort.SME_idShort - /// Parent of SME, bzw. SMEColl + /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(Submodel submodel, string idShortPath, out object parent) + + internal SubmodelElement FindSubmodelElementByPath(object parent, string idShortPath, out object outParent) { - parent = null; + outParent = parent; if (idShortPath.Contains('.')) { string[] idShorts = idShortPath.Split('.', 2); - foreach (var smeWrapper in submodel.submodelElements) + if (parent is Submodel submodel) { - var submodelElement = smeWrapper.submodelElement; - if (submodelElement.idShort.Equals(idShorts[0])) + var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]).submodelElement; + if (submodelElement != null) { - if (submodelElement is SubmodelElementCollection collection) - { - return FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); - } + return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + } + } + else if (parent is SubmodelElementCollection collection) + { + var submodelElement = collection.FindFirstIdShort(idShorts[0]).submodelElement; + if (submodelElement != null) + { + return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); } } } else { - var smeWrapper = submodel.FindSubmodelElementWrapper(idShortPath); - if (smeWrapper != null) + if (parent is Submodel submodel) + { + var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath).submodelElement; + if (submodelElement != null) + { + return submodelElement; + } + } + else if (parent is SubmodelElementCollection collection) { - parent = submodel; - return smeWrapper.submodelElement; + var submodelElement = collection.FindFirstIdShort(idShortPath).submodelElement; + if (submodelElement != null) + { + return submodelElement; + } } - } - return null; } @@ -840,31 +870,6 @@ internal List FindAllSubmodelsByIdShort(string idShort) return outputSubmodels; } - internal SubmodelElement FindSubmodelElementByPathFromColl(SubmodelElementCollection smeColl, string idShortPath, out object parent) - { - parent = null; - string[] idShorts = idShortPath.Split('.', 2); // idShortPath might be empty or without '.' - foreach (var smeWrapper in smeColl.value) - { - var submodelElement = smeWrapper.submodelElement; - if (submodelElement.idShort.Equals(idShorts[0])) - { - if (submodelElement is SubmodelElementCollection collection) - { - parent = collection; - FindSubmodelElementByPathFromColl(collection, idShorts[1], out parent); - } - else if (submodelElement is SubmodelElement) - { - parent = smeColl; - return submodelElement; - } - } - } - - return null; - } - internal object InvokeOperationSync(Operation operation, Models.OperationRequest operationRequest) { Models.OperationResult opResult = new Models.OperationResult(); From 49556971c18fb9bb1e968f15cf0ba8d4b2fc5e80 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu, 10 Feb 2022 08:47:25 +0100 Subject: [PATCH 28/53] test for fixing blob modifier (#95) test for fixing blob modifier (#95) --- src/IO.Swagger.Test/AASHelperTest.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/IO.Swagger.Test/AASHelperTest.cs b/src/IO.Swagger.Test/AASHelperTest.cs index 5ba34ed4b..348c8315e 100644 --- a/src/IO.Swagger.Test/AASHelperTest.cs +++ b/src/IO.Swagger.Test/AASHelperTest.cs @@ -18,7 +18,7 @@ public void Setup() } [Test] - public void Test1() + public void TestFindByPath() { var sm = new Submodel(); var l1 = new SubmodelElementCollection { idShort = "level1" }; @@ -29,8 +29,28 @@ public void Test1() l2.Add(l3); l1.Add(l2); sm.Add(l1); - var found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); + var found = _helper!.FindSubmodelElementByPath(sm, "level1", out _); + Assert.AreEqual(found.idShort, "level1"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2", out _); Assert.AreEqual(found.idShort, "level2"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2.level3", out _); + Assert.AreEqual(found.idShort, "level3"); + found = _helper!.FindSubmodelElementByPath(sm, "level1.level2.level3.level4", out _); + Assert.AreEqual(found.idShort, "level4"); + } + + + [Test] + public void TestOutputModifier() + { + var sm = new Submodel(); + var l1 = new SubmodelElementCollection { idShort = "level1" }; + var blob = new Blob { idShort = "blob", value = "ABCD" }; + l1.Add(blob); + sm.Add(l1); + + var jsonString = _helper!.HandleOutputModifiers(blob, "deep", "normal", "withoutBlobValue"); + Assert.IsFalse(jsonString.ToString().Contains("value")); } } } \ No newline at end of file From d170f2e12c4dbf617821c2e32abfed69ca4cd7cd Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Thu, 10 Feb 2022 09:11:35 +0100 Subject: [PATCH 29/53] BugFix: Corrected "WithoutBlobValue" modifier --- src/IO.Swagger/Helpers/OutputModifierContractResolver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs index 389905057..47a59e8be 100644 --- a/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -158,10 +158,10 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ { if (property.PropertyName == propName) { + excluded = true; property.ShouldSerialize = instance => { - excluded = true; return false; }; } @@ -169,7 +169,7 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ } //Encode the value - if (!excluded && property.DeclaringType == typeof(Blob)) + if (!excluded && (property.DeclaringType == typeof(Blob)) && property.PropertyName.Equals("value")) { property.ShouldSerialize = instance => From 2594dc003a7dd3d37fd2037d95839b28939dd3ad Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 14 Feb 2022 13:54:52 +0100 Subject: [PATCH 30/53] Validation against applicable output modifiers, PUT vs POST --- src/AasxServerStandardBib/AdminShell.cs | 82 +++- .../AssetAdministrationShellRepositoryApi.cs | 193 ++++++--- .../JsonSerializerExtension.cs | 2 +- src/IO.Swagger/Extensions/StringExtension.cs | 26 ++ src/IO.Swagger/Helpers/AASHelper.cs | 397 ++++++++++++------ 5 files changed, 495 insertions(+), 205 deletions(-) rename src/IO.Swagger/{Helpers => Extensions}/JsonSerializerExtension.cs (95%) create mode 100644 src/IO.Swagger/Extensions/StringExtension.cs diff --git a/src/AasxServerStandardBib/AdminShell.cs b/src/AasxServerStandardBib/AdminShell.cs index 9cfe78390..bd70b35c0 100644 --- a/src/AasxServerStandardBib/AdminShell.cs +++ b/src/AasxServerStandardBib/AdminShell.cs @@ -18,6 +18,7 @@ This source code may use other Open Source software components (see LICENSE.txt) using System.Text; using System.Xml; using System.Xml.Serialization; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; namespace AdminShellNS @@ -6818,6 +6819,30 @@ public override AasElementSelfDescription GetSelfDescription() return new AasElementSelfDescription("Blob", "Blob"); } + public override object ToValueOnlySerialization() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + }; + + output.Add(idShort, valueDict); + return output; + } + + public object ToWithBlobOnlyValue() + { + var output = new Dictionary>(); + var valueDict = new Dictionary + { + { "mimeType", mimeType }, + { "value", Base64UrlEncoder.Encode(value) } + }; + + output.Add(idShort, valueDict); + return output; + } } public class File : DataElement @@ -7070,7 +7095,7 @@ public override AasElementSelfDescription GetSelfDescription() public override object ToValueOnlySerialization() { - var output = new Dictionary>>(); + var output = new Dictionary(); var listFirst = new List>(); foreach (var key in first.Keys) @@ -7227,7 +7252,7 @@ public override AasElementSelfDescription GetSelfDescription() public override object ToValueOnlySerialization() { - var output = new Dictionary>>(); + var output = new Dictionary(); var listFirst = new List>(); foreach (var key in first.Keys) @@ -7251,10 +7276,17 @@ public override object ToValueOnlySerialization() listSecond.Add(valueDict); } + List valueOnlyAnnotations = new List(); + + foreach (var sme in annotations) + { + valueOnlyAnnotations.Add(sme.submodelElement.ToValueOnlySerialization()); + } + dynamic relObj = new ExpandoObject(); relObj.first = listFirst; relObj.second = listSecond; - relObj.annotation = annotations; + relObj.annotation = valueOnlyAnnotations; output.Add(idShort, relObj); return output; } @@ -7815,6 +7847,27 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("Entity", "Ent"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary(); + List valueOnlyStatements = new List(); + + foreach (var sme in statements) + { + valueOnlyStatements.Add(sme.submodelElement.ToValueOnlySerialization()); + } + + var valueDict = new Dictionary + { + { "statements", valueOnlyStatements }, + { "entityType", entityType}, + { "assetId", assetRef.First.value }, + }; + + output.Add(idShort, valueDict); + return output; + } } public class BasicEvent : SubmodelElement @@ -7859,8 +7912,31 @@ public override AasElementSelfDescription GetSelfDescription() { return new AasElementSelfDescription("BasicEvent", "Evt"); } + + public override object ToValueOnlySerialization() + { + var output = new Dictionary(); + var list = new List>(); + foreach (var key in observed.Keys) + { + var valueDict = new Dictionary + { + { "type", key.type }, + { "value", key.value } + }; + list.Add(valueDict); + } + + var observedDict = new Dictionary>>(); + observedDict.Add("observed", list); + output.Add(idShort, observedDict); + + return output; + } } + + // // Handling of packages // diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index 4c0c7396d..b0609e50d 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -59,7 +59,7 @@ public virtual IActionResult DeleteAssetAdministrationShellById([FromRoute][Requ return NoContent(); } - return NotFound($"AAS not "); + return NotFound($"AAS not Found"); } catch (Exception ex) { @@ -80,10 +80,16 @@ public virtual IActionResult DeleteConceptDescriptionById([FromRoute][Required] { try { - bool deleted = aasHelper.DeleteConceptDescription(Base64UrlEncoder.Decode(cdIdentifier)); + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out int packageIndex); + if (conceptDescription == null) + { + return NotFound($"Concept Description not found."); + } + + bool deleted = aasHelper.DeleteConceptDescription(conceptDescription, packageIndex); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1);//same tree return NoContent(); } @@ -114,14 +120,14 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); @@ -133,7 +139,7 @@ public virtual IActionResult DeleteSubmodelElementByPath([FromRoute][Required] s var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //Same tree, structure changed return NoContent(); } @@ -160,10 +166,10 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } var submodelElement = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); @@ -175,7 +181,7 @@ public virtual IActionResult DeleteSubmodelElementByPathSubmodelRepo([FromRoute] var deleted = aasHelper.DeleteSubmodelElementByPath(submodelElement, parent); if (deleted) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); // Same tree, structure may change return NoContent(); } @@ -204,7 +210,7 @@ public virtual IActionResult DeleteSubmodelReferenceById([FromRoute][Required] s bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (deleted) { - + AasxServer.Program.signalNewData(1);//same tree structute may change return NoContent(); } @@ -245,7 +251,7 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] foreach (string submodelId in submodelIds) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId), out _); if (submodel != null) { payload.Add(submodel); @@ -423,7 +429,7 @@ public virtual IActionResult GetAllSubmodelElementsSubmodelRepo([FromRoute][Requ { try { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel != null) { List submodelElements = new List(); @@ -571,7 +577,7 @@ public virtual IActionResult GetAssetAdministrationShellById([FromRoute][Require return new ObjectResult(aasReturn.AAS); } - return NotFound($"Please check aasIdentifier again."); + return NotFound($"Asset Administration Shell not found."); } catch (Exception ex) { @@ -635,7 +641,7 @@ public virtual IActionResult GetConceptDescriptionById([FromRoute][Required] str return new ObjectResult(conceptDescription); } - return NotFound($"Could not delete the concept description. Please check the identifier again."); + return NotFound($"Concept Description not found."); } catch (Exception ex) { @@ -724,7 +730,7 @@ public virtual IActionResult GetOperationAsyncResultSubmodelRepo([FromRoute][Req } //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found."); @@ -772,7 +778,7 @@ public virtual IActionResult GetSubmodel([FromRoute][Required] string aasIdentif var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Either AAS {aasIdentifier} or Submodel {submodelIdentifier} not found"); + return NotFound($"Either AAS or Submodel not found"); } var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); @@ -861,7 +867,7 @@ public virtual IActionResult GetSubmodelElementByPathSubmodelRepo([FromRoute][Re try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found"); @@ -904,10 +910,10 @@ public virtual IActionResult GetSubmodelSubmodelRepo([FromRoute][Required] strin { try { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"The Submodel {submodelIdentifier} not found"); + return NotFound($"The Submodel not found"); } var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); @@ -1016,7 +1022,7 @@ public virtual IActionResult InvokeOperationSubmodelRepo([FromBody] OperationReq try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found."); @@ -1089,11 +1095,11 @@ public virtual IActionResult PostAssetAdministrationShell([FromBody] AdminShellV return Conflict($"Asset Administration Shell already exists."); } - bool added = aasHelper.AddAas(body); + bool added = aasHelper.PostAAS(body); if (added) { AasxServer.Program.signalNewData(2); - return Created($"Asset Administration Shell {body.idShort} created successfully.", body); + return Created($"Asset Administration Shell created successfully.", body); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1130,10 +1136,10 @@ public virtual IActionResult PostConceptDescription([FromBody] AdminShellV20.Con var conceptDescription = aasHelper.FindConceptDescription(body.identification.id, out _); if (conceptDescription != null) { - return Conflict($"Concept Description {body.idShort} already exists."); + return Conflict($"Concept Description already exists."); } - bool added = aasHelper.AddConceptDescription(body); + bool added = aasHelper.PostConceptDescription(body); if (added) { AasxServer.Program.signalNewData(1); @@ -1170,16 +1176,16 @@ public virtual IActionResult PostSubmodel([FromBody] AdminShellV20.Submodel body } //Check if already exists - var submodel = aasHelper.FindSubmodel(body.identification.id); + var submodel = aasHelper.FindSubmodel(body.identification.id, out _); if (submodel != null) { - return Conflict($"Submodel {body.idShort} already exists."); + return Conflict($"Submodel already exists."); } - bool added = aasHelper.AddSubmodel(body); + bool added = aasHelper.PostSubmodel(body); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, structure may change return Created($"Submodel created successfully.", body); } @@ -1238,11 +1244,12 @@ public virtual IActionResult PostSubmodelElement([FromBody] AdminShellV20.Submod return Conflict($"Submodel element {body.idShort} already exists in submodel"); } - bool added = aasHelper.AddSubmodelElement(submodel, body); + bool added = aasHelper.PostSubmodelElement(submodel, body); if (added) { object output = aasHelper.HandleOutputModifiers(body, level, content, extent); - return Created($"Submodel Element {body.idShort} created successfully.", output); + AasxServer.Program.signalNewData(1); //Same tree, structure changed + return Created($"Submodel Element created successfully.", output); } return Ok($"Error: not added since datastructure completely filled already"); @@ -1278,21 +1285,21 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } //IdShortPath is a path to the parent element var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); if (parentSME == null) { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel element {idShortPath} not found in submodel."); } if (string.IsNullOrEmpty(body.idShort)) @@ -1306,14 +1313,14 @@ public virtual IActionResult PostSubmodelElementByPath([FromBody] AdminShellV20. var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); if (existingSME != null) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + return Conflict($"SubmodelElement already exists in {idShortPath}."); } } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PostSubmodelElementByPath(parentSME, body); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, structure may change object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel element created successfully", output); } @@ -1349,7 +1356,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { return NotFound($"Submodel not found"); @@ -1359,7 +1366,7 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad var parentSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out _); if (parentSME == null) { - return NotFound($"Submodel element {idShortPath} not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel element {idShortPath} not found in submodel."); } if (string.IsNullOrEmpty(body.idShort)) @@ -1373,11 +1380,11 @@ public virtual IActionResult PostSubmodelElementByPathSubmodelRepo([FromBody] Ad var existingSME = parentSMEColl.FindFirstIdShort(body.idShort); if (existingSME != null) { - return Conflict($"SubmodelElement {body.idShort} already exists in {idShortPath}."); + return Conflict($"SubmodelElement already exists in {idShortPath}."); } } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PostSubmodelElementByPath(parentSME, body); if (added) { AasxServer.Program.signalNewData(2); @@ -1414,10 +1421,10 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } //Check for idShort in SubmodelElement @@ -1430,10 +1437,10 @@ public virtual IActionResult PostSubmodelElementSubmodelRepo([FromBody] AdminShe var submodelElement = submodel.FindSubmodelElementWrapper(body.idShort); if (submodelElement != null) { - return Conflict($"Submodel element {body.idShort} already exists in submodel {submodelIdentifier}"); + return Conflict($"Submodel element {body.idShort} already exists in submodel"); } - bool added = aasHelper.AddSubmodelElement(submodel, body); + bool added = aasHelper.PostSubmodelElement(submodel, body); if (added) { AasxServer.Program.signalNewData(2); @@ -1526,10 +1533,16 @@ public virtual IActionResult PutAssetAdministrationShell([FromBody] AdminShellV2 return BadRequest($"No Identification found in AAS."); } - bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + + bool added = aasHelper.PutAAS(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); // same tree, structure may change object output = aasHelper.HandleOutputModifiers(body, content: content); return Created($"AAS updated successfully.", output); } @@ -1557,15 +1570,21 @@ public virtual IActionResult PutAssetAdministrationShellById([FromBody] AdminShe { try { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS == null) + { + return NotFound($"AAS not found."); + } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in AAS."); } - bool added = aasHelper.AddAas(body, Base64UrlEncoder.Decode(aasIdentifier)); + bool added = aasHelper.PutAAS(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(1); + AasxServer.Program.signalNewData(1); //Same tree, structure/values may change (e.g., submodelRefs may be added or deleted, hence 1) return NoContent(); } @@ -1607,7 +1626,7 @@ public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset bool added = aasHelper.AddAsset(body, aasReturn); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //Same tree, strcture may change return NoContent(); } @@ -1634,15 +1653,21 @@ public virtual IActionResult PutConceptDescriptionById([FromBody] AdminShellV20. { try { + var existingCD = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out int packageIndex); + if (existingCD == null) + { + return NotFound($"Concept Description not found."); + } + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) { return BadRequest($"No Identification found in Concept Description."); } - bool added = aasHelper.AddConceptDescription(body, Base64UrlEncoder.Decode(cdIdentifier)); + bool added = aasHelper.PutConceptDescription(body, existingCD, packageIndex); if (added) { - AasxServer.Program.signalNewData(1); + AasxServer.Program.signalNewData(0); //Same tree, same structure, only values modified return NoContent(); } @@ -1684,7 +1709,14 @@ public virtual IActionResult PutSubmodel([FromBody] AdminShellV20.Submodel body, return NotFound($"AAS not found."); } - bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + //Check if submodel exists + var existingSubmodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out int packageIndex); + if (existingSubmodel == null) + { + return NotFound($"Submodel not found."); + } + + bool added = aasHelper.PutSubmodel(body, existingSubmodel, packageIndex); if (added) { //Check if AAS has the submodelRef, if not create one. @@ -1730,14 +1762,14 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); if (aasReturn.AAS == null) { - return NotFound($"AAS {aasIdentifier} not found"); + return NotFound($"AAS not found"); } //Check if submodel exists var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } if (string.IsNullOrEmpty(body.idShort)) @@ -1750,17 +1782,23 @@ public virtual IActionResult PutSubmodelElementByPath([FromBody] AdminShellV20.S return BadRequest($"Please check the idShortPath again."); } //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel Element not found."); } + //TODO: Remove + //string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + //var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + //if (parentSME == null) + //{ + // return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + //} - bool added = aasHelper.AddSubmodelElement(parentSME, body); + bool added = aasHelper.PutSubmodelElementByPath(parent, body, existingSME); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //TODO: change 0, however, value doesn't reflect automatically with 0. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel updated successfully.", output); } @@ -1794,28 +1832,36 @@ public virtual IActionResult PutSubmodelElementByPathSubmodelRepo([FromBody] Adm try { //Check if submodel exists - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier)); + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); if (submodel == null) { - return NotFound($"Submodel {submodelIdentifier} not found"); + return NotFound($"Submodel not found"); } if (string.IsNullOrEmpty(body.idShort)) { return BadRequest($"IdShort is not set in the submodel element."); } + //IdShortPath is a path to this requested submodel element - string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); - var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); - if (parentSME == null) + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) { - return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + return NotFound($"Submodel Element not found."); } - bool added = aasHelper.AddSubmodelElement(parentSME, body); + //TODO: Remove + //string parentIdShortPath = idShortPath.Substring(0, idShortPath.IndexOf('.')); + //var parentSME = aasHelper.FindSubmodelElementByPath(submodel, parentIdShortPath, out _); + //if (parentSME == null) + //{ + // return NotFound($"Parent Submodel element not found in submodel {submodelIdentifier}."); + //} + + bool added = aasHelper.PutSubmodelElementByPath(parent, body, existingSME); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //TODO:0, however, values change is reflected automaticcally with 0. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel element updated successfully.", output); } @@ -1852,10 +1898,17 @@ public virtual IActionResult PutSubmodelSubmodelRepo([FromBody] AdminShellV20.Su return BadRequest($"No Identification found in Submodel."); } - bool added = aasHelper.AddSubmodel(body, Base64UrlEncoder.Decode(submodelIdentifier)); + //Check if submodel exists + var existingSubmodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out int packageIndex); + if (existingSubmodel == null) + { + return NotFound($"Submodel not found."); + } + + bool added = aasHelper.PutSubmodel(body, existingSubmodel, packageIndex); if (added) { - AasxServer.Program.signalNewData(2); + AasxServer.Program.signalNewData(1); //same tree, but strcture may change, e.g. new SMEs may get added. object output = aasHelper.HandleOutputModifiers(body, level, content, extent); return Created($"Submodel updated successfully.", output); } diff --git a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs b/src/IO.Swagger/Extensions/JsonSerializerExtension.cs similarity index 95% rename from src/IO.Swagger/Helpers/JsonSerializerExtension.cs rename to src/IO.Swagger/Extensions/JsonSerializerExtension.cs index e20fd9fb7..4fe9f3897 100644 --- a/src/IO.Swagger/Helpers/JsonSerializerExtension.cs +++ b/src/IO.Swagger/Extensions/JsonSerializerExtension.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Newtonsoft.Json; -namespace IO.Swagger.Helpers +namespace IO.Swagger.Extensions { public static class JsonSerializerExtension { diff --git a/src/IO.Swagger/Extensions/StringExtension.cs b/src/IO.Swagger/Extensions/StringExtension.cs new file mode 100644 index 000000000..167360b5f --- /dev/null +++ b/src/IO.Swagger/Extensions/StringExtension.cs @@ -0,0 +1,26 @@ +namespace IO.Swagger.Extensions +{ + /// + /// Provides Extension Methods over String Class + /// + public static class StringExtension + { + /// + /// Single string value can be compared with multiple values + /// + /// + /// + /// + public static bool CompareMultiple(this string data, params string[] compareValues) + { + foreach (string s in compareValues) + { + if (data.Equals(s, System.StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + return false; + } + } +} diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 257a92f1f..3b0d074de 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -6,6 +6,7 @@ using System.Text.RegularExpressions; using System.Threading; using AdminShellNS; +using IO.Swagger.Extensions; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; @@ -101,18 +102,21 @@ public FindAasReturn FindAas(string aasIdentifier) return findAasReturn; } - //TODO: delete the cd Ref from corresponding AAS - internal bool DeleteConceptDescription(string cdIdentifier) + /// + /// Deletes a concept description + /// + /// Concept Description Object + /// Package Index of the CD from the server + /// + internal bool DeleteConceptDescription(ConceptDescription conceptDescription, int packageIndex) { - bool deleted = false; - var conceptDescription = FindConceptDescription(cdIdentifier, out int packageIndex); if (conceptDescription != null) { Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); - deleted = true; + return true; } - return deleted; + return false; } @@ -137,7 +141,7 @@ internal ConceptDescription FindConceptDescription(string cdIdentifier, out int } } - packageIndex = 0; + packageIndex = -1; return null; } @@ -219,7 +223,7 @@ internal bool DeleteSubmodelReferenceFromAAS(string aasIdentifier, string submod if (submodelRef != null) { aasReturn.AAS.submodelRefs.Remove(submodelRef); - AasxServer.Program.signalNewData(1); + return true; } } @@ -242,15 +246,32 @@ internal SubmodelRef FindSubmodelRefWithinAAS(FindAasReturn aasReturn, string su return null; } - internal Submodel FindSubmodel(string submodelIdentifier) + /// + /// Finds the submodel from the server + /// + /// submodelIdentifier + /// The Package index of the found submodel from the server + /// + internal Submodel FindSubmodel(string submodelIdentifier, out int packageIndex) { + packageIndex = -1; if (Packages[0] == null || Packages[0].AasEnv == null || string.IsNullOrEmpty(submodelIdentifier)) return null; - foreach (var submodel in Packages[0].AasEnv.Submodels) + for (int envi = 0; envi < Packages.Length; envi++) { - if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) - return submodel; + var env = Packages[envi]; + if (env != null) + { + foreach (var submodel in env.AasEnv.Submodels) + { + if (submodel != null && submodel.identification.id != null && submodel.identification.id.Trim().ToLower() == submodelIdentifier.Trim().ToLower()) + { + packageIndex = envi; + return submodel; + } + } + } } // no @@ -258,39 +279,22 @@ internal Submodel FindSubmodel(string submodelIdentifier) } /// - /// If AAS exists, it is updated. If not, added. - /// Similar to HTTP PUT + /// Creates a new Asset Administration Shell /// - /// - /// - /// - internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) + /// Requested AAS to be added in the server + /// If AAS was successfully added + internal bool PostAAS(AdministrationShell aas) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) + if (Packages[envi] == null) { - aasIdentifier ??= aas.identification.id; - var existingAas = FindAas(aasIdentifier); - if (existingAas.AAS != null) - { - Packages[envi].AasEnv.AdministrationShells.Remove(existingAas.AAS); - Packages[envi].AasEnv.AdministrationShells.Add(aas); - AasxServer.Program.signalNewData(1); - return true; - } - } - else - { - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -298,40 +302,46 @@ internal bool AddAas(AdministrationShell aas, string aasIdentifier = null) { Packages[emptyPackageIndex] = new AdminShellPackageEnv(); Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); - AasxServer.Program.signalNewData(1); return true; } return false; } - internal bool AddConceptDescription(ConceptDescription conceptDescription, string cdIdentifier = null) + /// + /// Updates the Asset Administration Shell + /// + /// Requested AAS to be updated in the server + /// Existing AAS from the server + /// If AAS was successfully modified + internal bool PutAAS(AdministrationShell aas, FindAasReturn aasReturn) + { + if (aasReturn.AAS != null) + { + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Remove(aasReturn.AAS); + Packages[aasReturn.IPackage].AasEnv.AdministrationShells.Add(aas); + return true; + } + return false; + } + + /// + /// Creates a new Concept Description + /// + /// Concept Description object + /// If the concept description was successfully added + internal bool PostConceptDescription(ConceptDescription conceptDescription) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; - cdIdentifier ??= conceptDescription.identification.id; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) - { - var existingCD = FindConceptDescription(cdIdentifier, out int packageIndex); - if (existingCD != null) - { - Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(existingCD); - Packages[packageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); - return true; - } - } - else + if (Packages[envi] == null) { - //TODO: This logic is not in the old server. - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -341,7 +351,25 @@ internal bool AddConceptDescription(ConceptDescription conceptDescription, strin Packages[emptyPackageIndex].AasEnv.ConceptDescriptions.Add(conceptDescription); return true; } + return false; + } + /// + /// Updates an existing Concept Description + /// + /// Concept Description object + /// Existing Concept Description object from the server + /// Package Index of the existingCD + /// + internal bool PutConceptDescription(ConceptDescription conceptDescription, ConceptDescription existingCD, int packageIndex) + { + if (packageIndex != -1) + { + int indexExistingCd = Packages[packageIndex].AasEnv.ConceptDescriptions.IndexOf(existingCD); + Packages[packageIndex].AasEnv.ConceptDescriptions.RemoveAt(indexExistingCd); + Packages[packageIndex].AasEnv.ConceptDescriptions.Insert(indexExistingCd, conceptDescription); + return true; + } return false; } @@ -505,6 +533,9 @@ internal bool CompareIsCaseOf(List isCaseOf1, List isCaseO internal object HandleOutputModifiers(object obj, string level = "deep", string content = "normal", string extent = "withoutBlobValue") { + //Validate requested modifiers against applicable modifiers as per specifications + ValidateOutputModifiers(obj, level, content, extent); + //TODO: Better way to use default values when null if (string.IsNullOrEmpty(level)) { @@ -548,7 +579,7 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string { //settings.Converters.Add(new ValueOnlyJsonConverter(true, obj)); //var jsonTest = JsonConvert.SerializeObject(obj, settings); - object output = GetValueOnly(obj, level); + object output = GetValueOnly(obj, level, extent); var jsonOutput = JsonConvert.SerializeObject(output, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); return jsonOutput; } @@ -560,35 +591,109 @@ internal object HandleOutputModifiers(object obj, string level = "deep", string return json; } - private object GetValueOnly(object obj, string level) + /// + /// Validates the output modifiers as per specifications, (Refer Details of Asset Administration Shell Part 2, Section 9.3) + /// + /// + /// + /// + /// + private void ValidateOutputModifiers(object obj, string level, string content, string extent) + { + if (obj is AdministrationShell) + { + //No level or extent applicable, bzw., not even in the API + if ((content != null) && !content.CompareMultiple("normal", "reference", "trimmed")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + } + else if (obj is SubmodelElementCollection) + { + //Do nothing, everything is applicable. Added the clause, as SMEColl is also an SME, hence below conditions could have been applied + } + else if (obj is SubmodelElement) + { + //Level and extent are not applicable. + if (level != null) + { + throw new Exception($"Invalid Output Modifier {level}"); + } + + //Conditions on Content + if (obj is Capability || obj is Operation) + { + if ((content != null) && !content.CompareMultiple("normal", "reference")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + } + + if ((content != null) && !content.CompareMultiple("normal", "reference", "value", "trimmed")) + { + throw new Exception($"Invalid Output Modifier {content}"); + } + + //Conditions on Extent + if (extent != null) + { + if (obj is Blob) + { + if (!extent.CompareMultiple("withoutBlobValue", "withBlobValue")) + { + throw new Exception($"Invalid Output Modifier {extent}"); + } + } + else + { + throw new Exception($"Invalid Output Modifier {extent}"); + } + } + } + } + + private object GetValueOnly(object obj, string level, string extent) { try { if (obj is Submodel submodel) { + //Submodel is serialized as an unnamed JSON object List values = new List(); foreach (var smElement in submodel.submodelElements) { - object value = GetValueOnly(smElement.submodelElement, level); + object value = GetValueOnly(smElement.submodelElement, level, extent); values.Add(value); } return values; } else if (obj is SubmodelElementCollection collection) { - if (level.Equals("deep", StringComparison.OrdinalIgnoreCase)) + //SMECollection is serialized as named JSON Object + Dictionary> output = new Dictionary>(); + List values = new List(); + foreach (var smElement in collection.value) { - List values = new List(); - foreach (var smElement in collection.value) + //When core, should only include direct child elements. SMEs of child collection cannot be considered as direct child + if ((smElement.submodelElement is SubmodelElementCollection) && level.Equals("core", StringComparison.OrdinalIgnoreCase)) { - object value = GetValueOnly(smElement.submodelElement, level); - values.Add(value); + continue; } - return values; + object value = GetValueOnly(smElement.submodelElement, level, extent); + values.Add(value); } + output.Add(collection.idShort, values); + return output; } else if (obj is SubmodelElement submodelElement) { + if (obj is Blob blob) + { + if (extent.Equals("withBlobValue", StringComparison.OrdinalIgnoreCase)) + { + return blob.ToWithBlobOnlyValue(); + } + } return submodelElement.ToValueOnlySerialization(); } else if (obj is List smEleList) @@ -596,7 +701,7 @@ private object GetValueOnly(object obj, string level) List values = new List(); foreach (var smElement in smEleList) { - object value = GetValueOnly(smElement, level); + object value = GetValueOnly(smElement, level, extent); values.Add(value); } return values; @@ -689,33 +794,23 @@ private object GetObjectReference(object obj) } } - internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) + /// + /// Creates a new Submodel + /// + /// Submodel object + /// + internal bool PostSubmodel(Submodel submodel) { bool emptyPackageAvailable = false; int emptyPackageIndex = -1; - submodelIdentifier ??= submodel.identification.id; + for (int envi = 0; envi < Packages.Length; envi++) { - if (Packages[envi] != null) - { - var existingSubmodel = FindSubmodel(submodelIdentifier); - if (existingSubmodel != null) - { - Packages[envi].AasEnv.Submodels.Remove(existingSubmodel); - Packages[envi].AasEnv.Submodels.Add(submodel); - return true; - } - } - else + if (Packages[envi] == null) { - //TODO: This logic is not in the old server. - if (!emptyPackageAvailable) - { - emptyPackageAvailable = true; - emptyPackageIndex = envi; - break; //Added to avoid unnecessary iterations - } - + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; } } @@ -729,6 +824,24 @@ internal bool AddSubmodel(Submodel submodel, string submodelIdentifier = null) return false; } + /// + /// Updates the Submodel + /// + /// Submodel object + /// Existing Submodel object from the server + /// The package index of the existing Submodel object + /// + internal bool PutSubmodel(Submodel submodel, Submodel existingSubmodel, int packageIndex) + { + if (packageIndex != -1) + { + Packages[packageIndex].AasEnv.Submodels.Remove(existingSubmodel); + Packages[packageIndex].AasEnv.Submodels.Add(submodel); + return true; + } + return false; + } + internal Submodel FindSubmodelWithReference(Reference submodelRef) { //There should be exactly one key @@ -750,25 +863,21 @@ internal Submodel FindSubmodelWithReference(Reference submodelRef) return null; } - internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElement) + /// + /// Creates a new submodel element + /// + /// Parent Submodel + /// New Submodel Element to be added + /// + internal bool PostSubmodelElement(Submodel submodel, SubmodelElement submodelElement) { - var existingSmEle = submodel.FindSubmodelElementWrapper(submodelElement.idShort); - //Check if submodel element already exists in the submodel - if (existingSmEle != null) - { - int indexOfExistingSmw = submodel.submodelElements.IndexOf(existingSmEle); - submodel.submodelElements.RemoveAt(indexOfExistingSmw); - submodel.Insert(indexOfExistingSmw, submodelElement); - submodel.SetAllParents(DateTime.UtcNow); - return true; - } - else + if (submodel != null) { submodel.Add(submodelElement); submodel.SetAllParents(DateTime.UtcNow); return true; } - + return false; } /// @@ -778,7 +887,6 @@ internal bool AddSubmodelElement(Submodel submodel, SubmodelElement submodelElem /// e.g. SMEColl_idShort.SME_idShort /// Parent of SME, bzw. SMEColl /// - internal SubmodelElement FindSubmodelElementByPath(object parent, string idShortPath, out object outParent) { outParent = parent; @@ -787,18 +895,18 @@ internal SubmodelElement FindSubmodelElementByPath(object parent, string idShort string[] idShorts = idShortPath.Split('.', 2); if (parent is Submodel submodel) { - var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]).submodelElement; + var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]); if (submodelElement != null) { - return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); } } else if (parent is SubmodelElementCollection collection) { - var submodelElement = collection.FindFirstIdShort(idShorts[0]).submodelElement; + var submodelElement = collection.FindFirstIdShort(idShorts[0]); if (submodelElement != null) { - return FindSubmodelElementByPath(submodelElement, idShorts[1], out outParent); + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); } } } @@ -806,18 +914,18 @@ internal SubmodelElement FindSubmodelElementByPath(object parent, string idShort { if (parent is Submodel submodel) { - var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath).submodelElement; + var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath); if (submodelElement != null) { - return submodelElement; + return submodelElement.submodelElement; } } else if (parent is SubmodelElementCollection collection) { - var submodelElement = collection.FindFirstIdShort(idShortPath).submodelElement; + var submodelElement = collection.FindFirstIdShort(idShortPath); if (submodelElement != null) { - return submodelElement; + return submodelElement.submodelElement; } } } @@ -944,35 +1052,62 @@ private void DoSimulation(object state) } } + /// - /// Adds the submodel element to the SMECollection + /// Creates a new submodel element at a specified path within submodel elements hierarchy /// - /// - /// - /// - internal bool AddSubmodelElement(SubmodelElement parentSME, SubmodelElement submodelElement) + /// Parent Submodel Element + /// Requested Submodel Element to be added + /// Returns true, if successfully added + internal bool PostSubmodelElementByPath(SubmodelElement parentSME, SubmodelElement submodelElement) { - if (parentSME is SubmodelElementCollection parentSMEColl) { - var existingSmEle = parentSMEColl.FindFirstIdShort(submodelElement.idShort); - //Check if submodel element already exists in the collection - if (existingSmEle != null) + parentSMEColl.Add(submodelElement); + return true; + } + return false; + } + + /// + /// Updates an existing submodel element at a specified path within submodel elements hierarchy + /// + /// Parent SME or Submodel + /// Submodel Element to be updated + /// Existing submodel element from the server, that needs to be updated + /// + internal bool PutSubmodelElementByPath(object parent, SubmodelElement submodelElement, SubmodelElement existingSME) + { + if (parent is SubmodelElementCollection parentSMEColl) + { + int indexOfExistingSME = -1; + for (int i = 0; i < parentSMEColl.value.Count; i++) { - int indexOfExistingSmw = parentSMEColl.value.IndexOf(existingSmEle); - parentSMEColl.value.RemoveAt(indexOfExistingSmw); - parentSMEColl.Insert(indexOfExistingSmw, submodelElement); + if (existingSME.Equals(parentSMEColl.value[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } } - else + parentSMEColl.value.RemoveAt(indexOfExistingSME); + parentSMEColl.Insert(indexOfExistingSME, submodelElement); + return true; + } + else if (parent is Submodel submodel) + { + int indexOfExistingSME = -1; + for (int i = 0; i < submodel.submodelElements.Count; i++) { - parentSMEColl.Add(submodelElement); - + if (existingSME.Equals(submodel.submodelElements[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } } - - submodelElement.SetAllTimeStamps(DateTime.UtcNow); + submodel.submodelElements.RemoveAt(indexOfExistingSME); + submodel.Insert(indexOfExistingSME, submodelElement); return true; } - return false; } From e089c02ca030e2da61352c0de11e3d37fd8438c2 Mon Sep 17 00:00:00 2001 From: Juilee Tikekar Date: Mon, 21 Feb 2022 13:19:31 +0100 Subject: [PATCH 31/53] Support for GetSerialization API --- .../AssetAdministrationShellRepositoryApi.cs | 33 ++- src/IO.Swagger/Helpers/AASHelper.cs | 193 ++++++++++++++++++ 2 files changed, 209 insertions(+), 17 deletions(-) diff --git a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs index b0609e50d..d1cead5d8 100644 --- a/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -238,27 +238,26 @@ public virtual IActionResult GenerateSerializationByIds([FromQuery][Required()] { try { - //TODO: One of the open questions - List payload = new List(); - foreach (string aasId in aasIds) - { - var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasId)); - if (aasReturn != null) - { - payload.Add(aasReturn.AAS); - } - } + AdminShellV20.AdministrationShellEnv outputEnv = new AdminShellV20.AdministrationShellEnv(); + + //Fetch AASs for the requested aasIds + var aaslist = aasHelper.FindAllAasByAASIds(aasIds); + outputEnv.AdministrationShells = aaslist; - foreach (string submodelId in submodelIds) + //Fetch Submodels for the requested submodelIds + var submodellist = aasHelper.FindAllSubmodelsBySubmodelIds(submodelIds); + outputEnv.Submodels = submodellist; + + //Fetch Concept Descriptions used in AAS/Submodels + if ((bool)includeConceptDescriptions) { - var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelId), out _); - if (submodel != null) - { - payload.Add(submodel); - } + var conceptDescriptionList = aasHelper.FindConceptDescriptionInAASs(aasIds); + aasHelper.FindAllConceptDescriptionsInSubmodels(submodelIds, conceptDescriptionList); + outputEnv.ConceptDescriptions.AddRange(conceptDescriptionList); } - return new ObjectResult(payload); + return new ObjectResult(outputEnv); + } catch (Exception ex) { diff --git a/src/IO.Swagger/Helpers/AASHelper.cs b/src/IO.Swagger/Helpers/AASHelper.cs index 3b0d074de..6ae26d170 100644 --- a/src/IO.Swagger/Helpers/AASHelper.cs +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -7,6 +7,7 @@ using System.Threading; using AdminShellNS; using IO.Swagger.Extensions; +using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using static AdminShellNS.AdminShellV20; @@ -308,6 +309,192 @@ internal bool PostAAS(AdministrationShell aas) return false; } + internal List FindAllAasByAASIds(List aasIds) + { + var aasList = new List(); + foreach (string aasId in aasIds) + { + string aasIdDecoded = Base64UrlEncoder.Decode(aasId); + var aasReturn = FindAas(aasIdDecoded); + if (aasReturn != null) + { + aasList.Add(aasReturn.AAS); + } + } + return aasList; + } + + internal void FindAllConceptDescriptionsInSubmodels(List submodelIds, List conceptDescriptionList) + { + foreach (string submodelId in submodelIds) + { + string submodelIdDecoded = Base64UrlEncoder.Decode(submodelId); + var submodel = FindSubmodel(submodelIdDecoded, out _); + FindAllConceptDescriptionsInSubmodel(submodel, conceptDescriptionList); + } + } + + internal List FindConceptDescriptionInAASs(List aasIds) + { + var conceptDescriptionList = new List(); + foreach (var aasId in aasIds) + { + string aasIdDecoded = Base64UrlEncoder.Decode(aasId); + var aasReturn = FindAas(aasIdDecoded); + if (aasReturn != null) + { + //Find direct concept descriptions + foreach (ConceptDictionary conceptDictionary in aasReturn.AAS.conceptDictionaries) + { + var cds = FindConceptDescriptionByReference(conceptDictionary.conceptDescriptionsRefs); + conceptDescriptionList.AddRange(cds); + } + + //Find concept descriptions from the submodels of the AAS + foreach (var submodelRef in aasReturn.AAS.submodelRefs) + { + var submodel = FindSubmodelWithReference(submodelRef); + if (submodel != null) + { + var conceptDescriptions = new List(); + FindAllConceptDescriptionsInSubmodel(submodel, conceptDescriptions); + conceptDescriptionList.AddRange(conceptDescriptions); + } + } + } + } + return conceptDescriptionList; + } + + /// + /// All the concept descriptions from the submodel, including submodel elements. The method is recursive. + /// + /// Submodel or Submodel Element + /// A list of found concept descriptions + public void FindAllConceptDescriptionsInSubmodel(object obj, List conceptDescriptions) + { + //Concept description of the submodel + if (obj is Submodel submodel) + { + if (submodel.semanticId != null) + { + var cd = FindConceptDescriptionByReference(submodel.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in submodel.submodelElements) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is SubmodelElementCollection collection) + { + if (collection.semanticId != null) + { + var cd = FindConceptDescriptionByReference(collection.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in collection.value) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is Entity entity) + { + if (entity.semanticId != null) + { + var cd = FindConceptDescriptionByReference(entity.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + + //Also search recursively for all its submodel elements + foreach (var submodelElement in entity.statements) + { + FindAllConceptDescriptionsInSubmodel(submodelElement.submodelElement, conceptDescriptions); + } + } + } + else if (obj is SubmodelElement submodelElement) + { + var cd = FindConceptDescriptionByReference(submodelElement.semanticId); + if (cd != null && !conceptDescriptions.Contains(cd)) + { + conceptDescriptions.Add(cd); + } + } + + } + + private List FindConceptDescriptionByReference(ConceptDescriptionRefs conceptDescriptionsRefs) + { + var conceptDescriptions = new List(); + if (conceptDescriptionsRefs != null && conceptDescriptionsRefs.conceptDescriptions != null) + { + foreach (var cdr in conceptDescriptionsRefs.conceptDescriptions) + { + var cd = FindConceptDescriptionByReference(cdr); + if (cd != null) + { + conceptDescriptions.Add(cd); + } + } + } + + return conceptDescriptions; + } + + private ConceptDescription FindConceptDescriptionByReference(Reference cdr) + { + if (cdr == null) + return null; + + var keys = cdr.Keys; + + if (keys == null) + return null; + + // can only refs with 1 key + if (keys.Count != 1) + return null; + + var key = keys[0]; + if (!key.local || key.type.ToLower().Trim() != "conceptdescription") + return null; + + var conceptDescription = FindConceptDescription(key.value, out _); + if (conceptDescription != null) + return conceptDescription; + + return null; + } + + internal List FindAllSubmodelsBySubmodelIds(List submodelIds) + { + var submodelList = new List(); + foreach (string submodelId in submodelIds) + { + string submodelIdDecoded = Base64UrlEncoder.Decode(submodelId); + var submodel = FindSubmodel(submodelIdDecoded, out _); + if (submodel != null) + { + submodelList.Add(submodel); + } + } + + return submodelList; + } + /// /// Updates the Asset Administration Shell /// @@ -1134,7 +1321,13 @@ internal bool AddAsset(Asset body, FindAasReturn aasReturn) /// public class FindAasReturn { + /// + /// Asset Administration Shell + /// public AdminShell.AdministrationShell AAS { get; set; } = null; + /// + /// The package index of the AAS + /// public int IPackage { get; set; } = -1; } From a8aeefa4bf895497f22a2609f58e1a93ab676a65 Mon Sep 17 00:00:00 2001 From: aorzelskiGH <48956800+aorzelskiGH@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:22:33 +0100 Subject: [PATCH 32/53] License of spec changed Platform Industrie 4.0 changed license to Creative Commons CC BY 4.0 --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 9b98c5c00..5b19e6209 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -7,7 +7,7 @@ The AASX Server is licensed under the Apache License 2.0 (Apache-2.0, see below) The AASX Server is a sample application for demonstration of the features of the Asset Administration Shell. The implementation uses the concepts of the document "Details of the Asset Administration Shell" -published on www.plattform-i40.de which is licensed under Creative Commons CC BY-ND 3.0 DE. +published on www.plattform-i40.de which is licensed under Creative Commons CC BY 4.0. -------------------------------------------------------------------------------------------------------------- From df9aa93825993743a7bfe2fddc7adc1c7f99aae4 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Tue, 22 Feb 2022 11:50:34 +0100 Subject: [PATCH 33/53] Fix failing checks (#106) Fix failing checks --- .../AasxHttpContextHelper.cs | 1 - src/AasxServerStandardBib/SecurityClient.cs | 1 - src/AasxServerStandardBib/i40Language.cs | 20 ------------------- src/CheckFormat.ps1 | 2 +- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/AasxServerStandardBib/AasxHttpContextHelper.cs b/src/AasxServerStandardBib/AasxHttpContextHelper.cs index c02654dd6..8b25d88a4 100644 --- a/src/AasxServerStandardBib/AasxHttpContextHelper.cs +++ b/src/AasxServerStandardBib/AasxHttpContextHelper.cs @@ -3486,7 +3486,6 @@ public void EvalGetListAAS(IHttpContext context) public void EvalAssetId(IHttpContext context, int assetId) { dynamic res = new ExpandoObject(); - int index = -1; Console.WriteLine("Test Asset ID"); diff --git a/src/AasxServerStandardBib/SecurityClient.cs b/src/AasxServerStandardBib/SecurityClient.cs index b2b78f609..48815e8d5 100644 --- a/src/AasxServerStandardBib/SecurityClient.cs +++ b/src/AasxServerStandardBib/SecurityClient.cs @@ -596,7 +596,6 @@ static void operation_get_put(AdminShell.Operation op, int envIndex, DateTime ti status.value = "OK"; if (opName == "get" || opName == "getdiff") { - AdminShell.SubmodelElementCollection diffCollection = null; DateTime last = new DateTime(); if (opName == "getdiff") { diff --git a/src/AasxServerStandardBib/i40Language.cs b/src/AasxServerStandardBib/i40Language.cs index 945b99bad..c38b67f42 100644 --- a/src/AasxServerStandardBib/i40Language.cs +++ b/src/AasxServerStandardBib/i40Language.cs @@ -270,7 +270,6 @@ public static void nextTick() if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } // get actual automaton data from AAS @@ -332,7 +331,6 @@ public static void nextTick() { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } auto.tick = 0; @@ -414,7 +412,6 @@ public static void nextTick() { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } var op = sme2 as AdminShell.Operation; @@ -497,7 +494,6 @@ public static void nextTick() { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } var op = sme2 as AdminShell.Operation; @@ -758,7 +754,6 @@ public static bool operation_receiveProposals(AdminShell.Operation op, i40Langua if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 3 && op.outputVariable.Count != 4) @@ -847,7 +842,6 @@ public static bool operation_receiveProposals(AdminShell.Operation op, i40Langua { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } I40Message_Interaction newBiddingMessage = Newtonsoft.Json.JsonConvert.DeserializeObject( @@ -898,7 +892,6 @@ public static bool operation_receiveI40message(AdminShell.Operation op, i40Langu if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if ((op.inputVariable.Count < 2 && op.inputVariable.Count > 3) && op.outputVariable.Count != 2) @@ -992,7 +985,6 @@ public static bool operation_receiveI40message(AdminShell.Operation op, i40Langu { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } I40Message_Interaction newBiddingMessage = Newtonsoft.Json.JsonConvert.DeserializeObject( @@ -1046,7 +1038,6 @@ public static bool operation_receiveSRAnswer(AdminShell.Operation op, i40Languag if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } Console.WriteLine("Waiting for Service Requester Answer"); @@ -1071,7 +1062,6 @@ public static bool operation_receiveSRAnswer(AdminShell.Operation op, i40Languag { if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } I40Message_Interaction newBiddingMessage = Newtonsoft.Json.JsonConvert.DeserializeObject( @@ -1124,7 +1114,6 @@ public static bool operation_sendFrame(AdminShell.Operation op, i40LanguageAutom if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 3 && op.outputVariable.Count != 1) @@ -1233,7 +1222,6 @@ public static bool operation_sendI40message(AdminShell.Operation op, i40Language if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 3 && op.outputVariable.Count != 1) @@ -1373,7 +1361,6 @@ public static bool operation_processRequesterResponse(AdminShell.Operation op, i if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (srAnswerMessageType == "acceptProposal") { @@ -1405,7 +1392,6 @@ public static bool operation_clear(AdminShell.Operation op, i40LanguageAutomaton if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.outputVariable.Count == 0) @@ -1452,7 +1438,6 @@ public static bool operation_checkCollection(AdminShell.Operation op, i40Languag if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 2 && op.outputVariable.Count != 0) @@ -1500,7 +1485,6 @@ public static bool operation_check(AdminShell.Operation op, i40LanguageAutomaton if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 3 && op.outputVariable.Count != 0) @@ -1655,7 +1639,6 @@ public static bool operation_executeLogic(AdminShell.Operation op, i40LanguageAu if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count < 4 && op.outputVariable.Count > 2) @@ -1995,7 +1978,6 @@ public static bool operation_sendI40frame(AdminShell.Operation op, i40LanguageAu if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 2) @@ -2043,7 +2025,6 @@ public static bool operation_receiveI40frame(AdminShell.Operation op, i40Languag if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 2) @@ -2106,7 +2087,6 @@ public static bool operation_calculate(AdminShell.Operation op, i40LanguageAutom if (auto.name == debugAutomaton) { - int i = 0; // set breakpoint here to debug specific automaton } if (op.inputVariable.Count != 2 && op.outputVariable.Count != 1) diff --git a/src/CheckFormat.ps1 b/src/CheckFormat.ps1 index 3c29922c6..501e4c7ff 100644 --- a/src/CheckFormat.ps1 +++ b/src/CheckFormat.ps1 @@ -21,7 +21,7 @@ function Main New-Item -ItemType Directory -Force -Path $artefactsDir|Out-Null $reportPath = Join-Path $artefactsDir "dotnet-format-report.json" - dotnet format --check --report $reportPath --exclude "**/DocTest*.cs" + dotnet format --verify-no-changes --report $reportPath --exclude "**/DocTest*.cs" $formatReport = Get-Content $reportPath |ConvertFrom-Json if ($formatReport.Count -ge 1) { From 327b5a75378a16d387f4d13acf54835b6cfcf4fa Mon Sep 17 00:00:00 2001 From: roessba Date: Tue, 22 Feb 2022 13:05:23 +0100 Subject: [PATCH 34/53] Test did not respect some requirements, also blob value is strangely modified --- src/IO.Swagger.Test/AASHelperTest.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/IO.Swagger.Test/AASHelperTest.cs b/src/IO.Swagger.Test/AASHelperTest.cs index 348c8315e..cc4560a2a 100644 --- a/src/IO.Swagger.Test/AASHelperTest.cs +++ b/src/IO.Swagger.Test/AASHelperTest.cs @@ -1,5 +1,6 @@ using IO.Swagger.Helpers; using NUnit.Framework; +using System.Text.Json; using static AdminShellNS.AdminShellV20; namespace IO.Swagger.Test @@ -44,13 +45,18 @@ public void TestFindByPath() public void TestOutputModifier() { var sm = new Submodel(); - var l1 = new SubmodelElementCollection { idShort = "level1" }; + SubmodelElementCollection l1 = new SubmodelElementCollection { idShort = "level1" }; var blob = new Blob { idShort = "blob", value = "ABCD" }; l1.Add(blob); sm.Add(l1); - var jsonString = _helper!.HandleOutputModifiers(blob, "deep", "normal", "withoutBlobValue"); - Assert.IsFalse(jsonString.ToString().Contains("value")); + var jsonStringW = _helper!.HandleOutputModifiers(l1, "deep", "normal", "withBlobValue"); + var jsonStringWO = _helper!.HandleOutputModifiers(l1, "deep", "normal", "withoutBlobValue"); + + //TODO check why input ABCD and output QUJDRA differ + StringAssert.Contains("\"value\": \"QUJDRA\"", jsonStringW.ToString()); + StringAssert.DoesNotContain("\"value\": \"QUJDRA\"", jsonStringWO.ToString()); + Assert.Fail("check why input ABCD and output QUJDRA differ"); } } } \ No newline at end of file From 0de310ccb21cd8df44e38d5d1a8d3c43f81e747d Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 08:59:26 +0100 Subject: [PATCH 35/53] fixed assembly reference for SwaggerDoc --- src/AasxServerBlazor/Startup.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AasxServerBlazor/Startup.cs b/src/AasxServerBlazor/Startup.cs index 7a19223e4..bc4899cad 100644 --- a/src/AasxServerBlazor/Startup.cs +++ b/src/AasxServerBlazor/Startup.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using AasxServerBlazor.Data; +using IO.Swagger.Controllers; using IO.Swagger.Filters; using IO.Swagger.Helpers; using IO.Swagger.Services; @@ -113,7 +114,8 @@ public void ConfigureServices(IServiceCollection services) c.EnableAnnotations(); c.CustomSchemaIds(type => type.FullName); - c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + string swaggerCommentedAssembly = typeof(AssetAdministrationShellRepositoryApiController).Assembly.GetName().Name; + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{swaggerCommentedAssembly}.xml"); // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) // Use [ValidateModelState] on Actions to actually validate it in C# as well! From 6dcacd8e15bf8dd8a1de1cc53770a318b8f6858d Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 14:34:36 +0100 Subject: [PATCH 36/53] first documented API tests --- test/rest_api/README.md | 37 ++ test/rest_api/data/test_elements.aasx | Bin 0 -> 2383 bytes test/rest_api/docker/Dockerfile | 3 + test/rest_api/postman/.gitignore | 1 + ...DockerEnvironment.json.postman_environment | 15 + ...ubmodelElementTest.json.postman_collection | 481 ++++++++++++++++++ 6 files changed, 537 insertions(+) create mode 100644 test/rest_api/README.md create mode 100644 test/rest_api/data/test_elements.aasx create mode 100644 test/rest_api/docker/Dockerfile create mode 100644 test/rest_api/postman/.gitignore create mode 100644 test/rest_api/postman/DockerEnvironment.json.postman_environment create mode 100644 test/rest_api/postman/SubmodelElementTest.json.postman_collection diff --git a/test/rest_api/README.md b/test/rest_api/README.md new file mode 100644 index 000000000..36d17998b --- /dev/null +++ b/test/rest_api/README.md @@ -0,0 +1,37 @@ +# API Tests with Postman/Newman + +Here you will find the most important resources to run extensive API tests and thus check the server-side implementation. + +[Postman](https://www.postman.com/) is a widely used tool for automated API testing. Postman allows us to run different test scenarios and validate the results via scripts, or you can just manage API requests for development and/or explorative testing. Postman has many features, please check the documentation. + +[Newman](https://github.com/postmanlabs/newman) is a CLI runner for Postman and can be executed headless in Docker containers or github actions. + +## System under Test +It should be obvious that you have to build and run the AAS API Server you want to test. Some Tests also requires predefined test data (e.g. as AASX Package). [Here](data) you find some predefined AASX's for testing. + + +## Running and Managing Tests +### Postman Collections +A Postman collection is like a folder where you can manage your API requests. But you can also define variables and reuse these within your collection + +Inside the [postman folder](postman) you find some json-files ending with `*.json.postman_collection`. You can import them in your postman application or use them with newman to run the collection. + +### Testing your API with Newman and get a Report +Newman already provides [docker images](https://hub.docker.com/r/postman/newman) which you can reuse. Important Notes: +1. Use `-v $PWD/postman:/etc/newman` to make all needed jsons available within the docker container. +2. Use `--environment="DockerEnvironment.json.postman_environment"` to set important variables like baseUrl of your system under test. +E.g. in [DockerEnvironment](postman/DockerEnvironment.json.postman_environment), the baseUrl is set to http://host.docker.internal:5001, expecting your system running on your docker host listening on port 5001. +3. Use `--reporters cli,json --reporter-json-export report.json` if you like to get a report in json format. The file gets saved in the volume you mounted to /etc/newman. + +A full example might look like: `docker run -v $PWD/postman:/etc/newman -t --rm postman/newman:5.3.1-alpine run SubmodelElementTest.json.postman_collection --environment="DockerEnvironment.json.postman_environment" --reporters cli,json --reporter-json-export report.json` + +#### Getting a HTML Report +If you like to get a nice, human-readable HTML report, consider building and using [this](docker/Dockerfile) Docker-Image. It uses the newman image as base and installs a HTML reporter to the image. + +##### Build Image +`docker build --tag postman/newman/html --file .\docker\Dockerfile .` + +##### Run Container +run the container as previously but add htmlextra as reporter +`docker run -v $PWD/postman:/etc/newman -t --rm postman/newman/html run SubmodelElementTest.json.postman_collection --environment="DockerEnvironment.json.postman_environment" --reporters cli,htmlextra --reporter-htmlextra-export report.html` +After running, you can open report.html with your browser. \ No newline at end of file diff --git a/test/rest_api/data/test_elements.aasx b/test/rest_api/data/test_elements.aasx new file mode 100644 index 0000000000000000000000000000000000000000..b4f04c635bbce6442fdc1e1f6cdc7da5f16c869d GIT binary patch literal 2383 zcmWIWW@Zs#U}E54$ny#hk@85GA;!SKAOge!3^ELfiNzKAAVN34C^J1XPhpV+gT?}o zEGGDTM%(kO_Q^Bnz0aIn8RBtPS7YTBW`+Qu`CMSdAoFXV+$`Z|WMBYcZlL+`MX5Q( z`g$M|pV9Ak@3*n9$jwnGOD!tS%+Iq`GSo9rQb^59&QHnAOSe@jElJb0P_nnP2};dL zECH%0&d4k%Rsd?rE4Ee2C@Cqh($_Ce&PdHoEY`~}NX-Mvq~#aoCYAuXMd|tliOJcC z>8big1_oyOK-VD5P(n3RA*8Y(6>egAdAVLq@Yz&@Jz8)3NkcLOEXMKHc3u3F*ZrIFi}#_x3kel@s=GZOc8N5>v&O| zDl-GaSpf!y5Llc!78j?MID(v(SzJ;C_D(R!iMqPFhNc$gX3mbT`b4PF13FL-6!3WB z{c1#P{w)KM+WA}l3p|yb<8az4BuMd^m&aPOslKt}YW@Xu+yWXCztN^a-jiOp;$HX2WFR#2V(cZ2*fX_EpO@xN77F+ZXccDV1D zFyr@x>W8A=W*eO%61*_3=~oDt5<>Holl} zGHmmfH6^p08s?~JD5b3Nj#bH6sHnSuXYxXi4L900eozJ`hf#)?9*73C>u4;ms}7QS!indqQ!@Iw0YQ?d6f4j(Lfz{7U>^~2>8 zSH>qF-+A$hd)5i zT>-yJ|F)3j2)D|KPp5{p^A| zA>Gd!7W)!*HMb=C=Q1BMUwQsy)bmGAV_*5R>K`sM=2^Gr_$uZ1$2e{WddeBzfAfKD zU+I$ei!X|17#?4;>S^n;(_Z)davp4Zm&<9xTkBNPBj6yW*f5RbY|Qq+Pj*L+Yc&SW zc3oupqG-jne(8roW&-6ETvx?+JWnxJzteGm{rp+QSG7~ud^X(2Z>cS{?$!=Z193-Q zWu2uCha4AmBpv#^aPu@?$qnp+fBqO|)+L-<_SNq^`x-?yQ&ZtXUsfFWrF0|XMrWIL z?Z-Fv@vnPNelCreZZmgp?hcn3hotK*=kUGya!sK(?X9H$X?uIG@8>tIEGYfzJk@qm zyu%N}&Pm>hT5WF@t^U9A!#{8_h{&=l{faJJ0~U$_z+zAumSrJjAySDzuvqM!;OKYQ zK)`i<(%E}uLJDgG=4d(T+?W=3plDg=)g#+%+NNyY_`oBEkzK{5Oeg)>U-h&9YyM~O zU9U`9FLAPJ`2rDEgOX$4ukmulU7Gp+;RQ4IIVGo9dd&n*3%YY1n{sIHloYo)rkwH@ zo}RvWJaW0sF-Nvsy())DQCHo^@$5Ns-+U4KaD9hP_l3VXvdaaRdq(JQUH1CghIJOK zCI|ei_-2Uw36K?Bme(8Y_0jsno-B*!Pw&=++n4nJPjs2q`GE< zfX8*cQig7hm2B6d4RaMw-YR>+$}w|W>xoGUhKF>U?Po%Cb+y3BDmdUXfYaGS+ z((nJ>EMnglG%H)J-|QJXX9jDzsP?bqgjtex()mSADb_*nXZ#RVf7meN`BzP+P0e4w z|GM~)DTR5BdDec$0B=SnU0^MZz1~Kzn?Y#`xfX)x##JjL>rMc2km_i3Yf-BnWQ|*Z z(FL}ah)RZ(iU{2Ws5uGQ1?j9%7hum<=mw#tGh~A%u`ysvbphV2KnVs0Rv>H!`gR*T Ghz9@y5`YW< literal 0 HcmV?d00001 diff --git a/test/rest_api/docker/Dockerfile b/test/rest_api/docker/Dockerfile new file mode 100644 index 000000000..18474d299 --- /dev/null +++ b/test/rest_api/docker/Dockerfile @@ -0,0 +1,3 @@ +FROM postman/newman:5.3.1-alpine +RUN npm install -g newman-reporter-htmlextra@1.22.7 +ENTRYPOINT ["newman"] \ No newline at end of file diff --git a/test/rest_api/postman/.gitignore b/test/rest_api/postman/.gitignore new file mode 100644 index 000000000..0a056f791 --- /dev/null +++ b/test/rest_api/postman/.gitignore @@ -0,0 +1 @@ +report.* \ No newline at end of file diff --git a/test/rest_api/postman/DockerEnvironment.json.postman_environment b/test/rest_api/postman/DockerEnvironment.json.postman_environment new file mode 100644 index 000000000..a5fbad718 --- /dev/null +++ b/test/rest_api/postman/DockerEnvironment.json.postman_environment @@ -0,0 +1,15 @@ +{ + "id": "1e2a31f6-5aac-449a-9626-baa8a75bbb46", + "name": "DockerEnvironment", + "values": [ + { + "key": "baseUrl", + "value": "http://host.docker.internal:5001", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2022-02-23T11:16:40.332Z", + "_postman_exported_using": "Postman/9.14.4" +} \ No newline at end of file diff --git a/test/rest_api/postman/SubmodelElementTest.json.postman_collection b/test/rest_api/postman/SubmodelElementTest.json.postman_collection new file mode 100644 index 000000000..135f200a3 --- /dev/null +++ b/test/rest_api/postman/SubmodelElementTest.json.postman_collection @@ -0,0 +1,481 @@ +{ + "info": { + "_postman_id": "5bfa8078-afbe-4a76-9e32-e00cf84ad55e", + "name": "SubmodelElementTest", + "description": "Collection dedicated for basic Operations on Submodel Elements.\n\nSome test data is predefined and is available in a special aasx demo file.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Get predefined ...", + "item": [ + { + "name": "property", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Model Type is Property\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.modelType.name).to.eql(\"Property\");\r", + " });\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "strictSSL": false + }, + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/shells/:aasIdentifier/aas/submodels/:submodelIdentifier/submodel/submodel-elements/:idShortPath?content=normal", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "shells", + ":aasIdentifier", + "aas", + "submodels", + ":submodelIdentifier", + "submodel", + "submodel-elements", + ":idShortPath" + ], + "query": [ + { + "key": "level", + "value": "", + "description": "Determines the structural depth of the respective resource content", + "disabled": true + }, + { + "key": "content", + "value": "normal", + "description": "Determines the request or response kind of the resource" + }, + { + "key": "extent", + "value": "", + "description": "Determines to which extent the resource is being serialized", + "disabled": true + } + ], + "variable": [ + { + "key": "aasIdentifier", + "value": "{{aas_id_b64}}", + "description": "(Required) The Asset Administration Shell’s unique id (BASE64-URL-encoded)" + }, + { + "key": "submodelIdentifier", + "value": "{{sm_id_b64}}", + "description": "(Required) The Submodel’s unique id (BASE64-URL-encoded)" + }, + { + "key": "idShortPath", + "value": "testproperty", + "description": "(Required) IdShort path to the submodel element (dot-separated)" + } + ] + } + }, + "response": [] + }, + { + "name": "multilanguage", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Model Type is MultiLanguageProperty\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.modelType.name).to.eql(\"MultiLanguageProperty\");\r", + " });\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "strictSSL": false + }, + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/shells/:aasIdentifier/aas/submodels/:submodelIdentifier/submodel/submodel-elements/:idShortPath?content=normal", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "shells", + ":aasIdentifier", + "aas", + "submodels", + ":submodelIdentifier", + "submodel", + "submodel-elements", + ":idShortPath" + ], + "query": [ + { + "key": "level", + "value": "", + "description": "Determines the structural depth of the respective resource content", + "disabled": true + }, + { + "key": "content", + "value": "normal", + "description": "Determines the request or response kind of the resource" + }, + { + "key": "extent", + "value": "", + "description": "Determines to which extent the resource is being serialized", + "disabled": true + } + ], + "variable": [ + { + "key": "aasIdentifier", + "value": "{{aas_id_b64}}", + "description": "(Required) The Asset Administration Shell’s unique id (BASE64-URL-encoded)" + }, + { + "key": "submodelIdentifier", + "value": "{{sm_id_b64}}", + "description": "(Required) The Submodel’s unique id (BASE64-URL-encoded)" + }, + { + "key": "idShortPath", + "value": "testmlp", + "description": "(Required) IdShort path to the submodel element (dot-separated)" + } + ] + } + }, + "response": [] + }, + { + "name": "range", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Min is defined and not null\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.min).to.be.not.undefined;\r", + " pm.expect(response.min).to.be.not.null;\r", + "});\r", + "\r", + "pm.test(\"Model Type is Range\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.modelType.name).to.eql(\"Range\");\r", + " });\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "strictSSL": false + }, + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/shells/:aasIdentifier/aas/submodels/:submodelIdentifier/submodel/submodel-elements/:idShortPath?content=normal", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "shells", + ":aasIdentifier", + "aas", + "submodels", + ":submodelIdentifier", + "submodel", + "submodel-elements", + ":idShortPath" + ], + "query": [ + { + "key": "level", + "value": "", + "description": "Determines the structural depth of the respective resource content", + "disabled": true + }, + { + "key": "content", + "value": "normal", + "description": "Determines the request or response kind of the resource" + }, + { + "key": "extent", + "value": "", + "description": "Determines to which extent the resource is being serialized", + "disabled": true + } + ], + "variable": [ + { + "key": "aasIdentifier", + "value": "{{aas_id_b64}}", + "description": "(Required) The Asset Administration Shell’s unique id (BASE64-URL-encoded)" + }, + { + "key": "submodelIdentifier", + "value": "{{sm_id_b64}}", + "description": "(Required) The Submodel’s unique id (BASE64-URL-encoded)" + }, + { + "key": "idShortPath", + "value": "testrange", + "description": "(Required) IdShort path to the submodel element (dot-separated)" + } + ] + } + }, + "response": [] + }, + { + "name": "blob", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Model Type is Blob\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.modelType.name).to.eql(\"Blob\");\r", + " });\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "strictSSL": false + }, + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/shells/:aasIdentifier/aas/submodels/:submodelIdentifier/submodel/submodel-elements/:idShortPath?content=normal", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "shells", + ":aasIdentifier", + "aas", + "submodels", + ":submodelIdentifier", + "submodel", + "submodel-elements", + ":idShortPath" + ], + "query": [ + { + "key": "level", + "value": "", + "description": "Determines the structural depth of the respective resource content", + "disabled": true + }, + { + "key": "content", + "value": "normal", + "description": "Determines the request or response kind of the resource" + }, + { + "key": "extent", + "value": "withBlob", + "description": "Determines to which extent the resource is being serialized", + "disabled": true + } + ], + "variable": [ + { + "key": "aasIdentifier", + "value": "{{aas_id_b64}}", + "description": "(Required) The Asset Administration Shell’s unique id (BASE64-URL-encoded)" + }, + { + "key": "submodelIdentifier", + "value": "{{sm_id_b64}}", + "description": "(Required) The Submodel’s unique id (BASE64-URL-encoded)" + }, + { + "key": "idShortPath", + "value": "testblob", + "description": "(Required) IdShort path to the submodel element (dot-separated)" + } + ] + } + }, + "response": [] + }, + { + "name": "ref", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Model Type is ReferenceElement\", () => {\r", + " const response = pm.response.json();\r", + " pm.expect(response.modelType.name).to.eql(\"ReferenceElement\");\r", + " });\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "strictSSL": false + }, + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/shells/:aasIdentifier/aas/submodels/:submodelIdentifier/submodel/submodel-elements/:idShortPath?content=normal", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "shells", + ":aasIdentifier", + "aas", + "submodels", + ":submodelIdentifier", + "submodel", + "submodel-elements", + ":idShortPath" + ], + "query": [ + { + "key": "level", + "value": "", + "description": "Determines the structural depth of the respective resource content", + "disabled": true + }, + { + "key": "content", + "value": "normal", + "description": "Determines the request or response kind of the resource" + }, + { + "key": "extent", + "value": "", + "description": "Determines to which extent the resource is being serialized", + "disabled": true + } + ], + "variable": [ + { + "key": "aasIdentifier", + "value": "{{aas_id_b64}}", + "description": "(Required) The Asset Administration Shell’s unique id (BASE64-URL-encoded)" + }, + { + "key": "submodelIdentifier", + "value": "{{sm_id_b64}}", + "description": "(Required) The Submodel’s unique id (BASE64-URL-encoded)" + }, + { + "key": "idShortPath", + "value": "testref", + "description": "(Required) IdShort path to the submodel element (dot-separated)" + } + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test(\"Status is 200\", () => pm.response.to.have.status(200));", + "", + "pm.test(\"IdShort exists as a string\", () => {", + " const response = pm.response.json();", + " pm.expect(response.idShort).to.be.a(\"string\");", + " });", + "", + "if (pm.response.json().modelType.name != \"Range\"){ // Range uses min/max, not value", + " pm.test(\"Value is defined and not null\", () => {", + " const response = pm.response.json();", + " pm.expect(response.value).to.be.not.undefined;", + " pm.expect(response.value).to.be.not.null;", + " });", + "}" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "aas_id_b64", + "value": "QXNzZXRBZG1pbmlzdHJhdGlvblNoZWxsLS0tMTU4NzZDQUU=", + "type": "string" + }, + { + "key": "sm_id_b64", + "value": "aHR0cHM6Ly9leGFtcGxlLmNvbS9pZHMvc20vOTA0MV84MDMyXzIwMjJfNTM3Ng==", + "type": "string" + }, + { + "key": "baseUrl", + "value": "http://localhost:5001", + "type": "string" + } + ] +} \ No newline at end of file From 799a405e0a2516cebe4e8f55a9a5222406cc7f13 Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 15:45:34 +0100 Subject: [PATCH 37/53] github action with newman --- .github/workflows/run_newman.yml | 37 +++++++++++++++++++ ...ActionEnvironment.json.postman_environment | 15 ++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/run_newman.yml create mode 100644 test/rest_api/postman/GitHubActionEnvironment.json.postman_environment diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml new file mode 100644 index 000000000..3e31a5a00 --- /dev/null +++ b/.github/workflows/run_newman.yml @@ -0,0 +1,37 @@ +name: newman_tests + +#on: +# push + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Install Newman and HTML Reporter + run: npm install -g newman + run: npm install -g newman-reporter-htmlextra@1.22.7 + - name: Restore dependencies + run: dotnet restore ./src/AasxServerBlazor/AasxServerBlazor.csproj + - name: Build + run: dotnet build ./src/AasxServerBlazor/AasxServerBlazor.csproj -c Release -o ./build + - name: RunServerAndTestScripts + run: | + dotnet ./build/AasxServerBlazor.dll --urls=https://localhost:7228/ & + sleep 5 + newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure + kill -9 `lsof -i:7228 -t` + - uses: actions/upload-artifact@v2 + with: + name: report.html + path: ./report.html \ No newline at end of file diff --git a/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment b/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment new file mode 100644 index 000000000..4fff60e8e --- /dev/null +++ b/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment @@ -0,0 +1,15 @@ +{ + "id": "4e4247e9-4f2d-445d-84ce-9f8dda21f66f", + "name": "GitHubActionEnvironment", + "values": [ + { + "key": "baseUrl", + "value": "https://localhost:7228", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2022-02-23T14:39:15.480Z", + "_postman_exported_using": "Postman/9.14.4" +} \ No newline at end of file From a3ca9fed31555b19a2c72d522cfa0fdc1fd97dc1 Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 15:49:07 +0100 Subject: [PATCH 38/53] uncomment github event --- .github/workflows/run_newman.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 3e31a5a00..7a6ce3673 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -1,7 +1,7 @@ name: newman_tests -#on: -# push +on: + push jobs: build: From 39f0f62b455cf91644177978513abd2c01e86cd9 Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 15:51:29 +0100 Subject: [PATCH 39/53] Update run_newman.yml --- .github/workflows/run_newman.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 7a6ce3673..56abbe10b 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -19,8 +19,9 @@ jobs: with: node-version: 12.x - name: Install Newman and HTML Reporter - run: npm install -g newman - run: npm install -g newman-reporter-htmlextra@1.22.7 + run: | + npm install -g newman@5.3.1 + npm install -g newman-reporter-htmlextra@1.22.7 - name: Restore dependencies run: dotnet restore ./src/AasxServerBlazor/AasxServerBlazor.csproj - name: Build From ccb7fe6e0e99f57f458cde4f26eeb3c394e7ec07 Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 16:06:07 +0100 Subject: [PATCH 40/53] Update run_newman.yml --- .github/workflows/run_newman.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 56abbe10b..303ab0d90 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -1,7 +1,7 @@ name: newman_tests on: - push + workflow_dispatch jobs: build: @@ -33,6 +33,7 @@ jobs: newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure kill -9 `lsof -i:7228 -t` - uses: actions/upload-artifact@v2 + if: always() with: name: report.html path: ./report.html \ No newline at end of file From 32ede412a73598f88db0df365e1445b50073988f Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 16:17:50 +0100 Subject: [PATCH 41/53] Update run_newman.yml --- .github/workflows/run_newman.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 303ab0d90..46975ad62 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -1,7 +1,8 @@ name: newman_tests on: - workflow_dispatch + push + #workflow_dispatch jobs: build: From b8996e202223a063a18c75709416fb390a5d9b74 Mon Sep 17 00:00:00 2001 From: roessba Date: Wed, 23 Feb 2022 16:29:32 +0100 Subject: [PATCH 42/53] Update run_newman.yml --- .github/workflows/run_newman.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 46975ad62..f3c051241 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -5,7 +5,7 @@ on: #workflow_dispatch jobs: - build: + api-test: runs-on: ubuntu-latest @@ -14,7 +14,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 3.1.x - name: Setup Node uses: actions/setup-node@v1 with: @@ -27,13 +27,14 @@ jobs: run: dotnet restore ./src/AasxServerBlazor/AasxServerBlazor.csproj - name: Build run: dotnet build ./src/AasxServerBlazor/AasxServerBlazor.csproj -c Release -o ./build - - name: RunServerAndTestScripts + - name: Start Test Server And Execute Test Scripts run: | dotnet ./build/AasxServerBlazor.dll --urls=https://localhost:7228/ & sleep 5 newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure kill -9 `lsof -i:7228 -t` - - uses: actions/upload-artifact@v2 + - name: Upload Report + uses: actions/upload-artifact@v2 if: always() with: name: report.html From 64f9247f631ab27cc0400d2029ead07602555dc9 Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 07:42:42 +0100 Subject: [PATCH 43/53] Fix wrong appsettings appsettings was not copied in build process due to an invalid json schema --- src/AasxServerBlazor/AasxServerBlazor.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/AasxServerBlazor/AasxServerBlazor.csproj b/src/AasxServerBlazor/AasxServerBlazor.csproj index 747580085..cbd763e3a 100644 --- a/src/AasxServerBlazor/AasxServerBlazor.csproj +++ b/src/AasxServerBlazor/AasxServerBlazor.csproj @@ -20,8 +20,6 @@ - - PreserveNewest From 004fa8898398ddf37a9f0faa8460d299605f10a3 Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 08:28:25 +0100 Subject: [PATCH 44/53] fix simultaneous start of aspnet and grapevine --- src/AasxServerBlazor/Program.cs | 2 ++ src/AasxServerBlazor/Properties/launchSettings.json | 2 +- src/AasxServerStandardBib/Program.cs | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/AasxServerBlazor/Program.cs b/src/AasxServerBlazor/Program.cs index 9dab05a74..2d539a4e7 100644 --- a/src/AasxServerBlazor/Program.cs +++ b/src/AasxServerBlazor/Program.cs @@ -22,6 +22,8 @@ public static void Main(string[] args) var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json").Build(); + + //TODO it is not ensured that this is the actual endpoint string[] url = config["Kestrel:Endpoints:Http:Url"].Split(':'); if (url[2] != null) AasxServer.Program.blazorHostPort = url[2]; diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index f76e1b5c1..c71b91611 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -18,7 +18,7 @@ }, "AasxServerBlazor": { "commandName": "Project", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", + "commandLineArgs": "--aspnet --no-security --data-path \"C:\\Development\\AASX\" --edit", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/src/AasxServerStandardBib/Program.cs b/src/AasxServerStandardBib/Program.cs index 9c1b076eb..1bee6d412 100644 --- a/src/AasxServerStandardBib/Program.cs +++ b/src/AasxServerStandardBib/Program.cs @@ -167,6 +167,7 @@ private class CommandLineArguments public bool Rest { get; set; } public bool Opc { get; set; } public bool Mqtt { get; set; } + public bool AspNet { get; set; }//hack solution to start without grapevine public bool DebugWait { get; set; } public int? OpcClientRate { get; set; } public string[] Connect { get; set; } @@ -683,6 +684,10 @@ public static void Main(string[] args) new[] {"--mqtt"}, "If set, starts a MQTT publisher"), + new Option( + new[] {"--aspnet"}, + "If set, app is running using aspnet framework"), + new Option( new[] {"--debug-wait"}, "If set, waits for Debugger to attach"), @@ -738,7 +743,7 @@ public static void Main(string[] args) rootCommand.Handler = System.CommandLine.Invocation.CommandHandler.Create( (CommandLineArguments a) => { - if (!(a.Rest || a.Opc || a.Mqtt)) + if (!(a.Rest || a.Opc || a.Mqtt || a.AspNet)) { Console.Error.WriteLine($"Please specify --rest and/or --opc and/or --mqtt{nl}"); new HelpBuilder(new SystemConsole()).Write(rootCommand); From b2c9a34ad89733a9707a7d32980ac16a75d351e1 Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 10:03:32 +0100 Subject: [PATCH 45/53] uncomment broken code, also needed for connect feature (?) --- src/AasxServerBlazor/Program.cs | 7 ++++++- src/AasxServerStandardBib/Program.cs | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/AasxServerBlazor/Program.cs b/src/AasxServerBlazor/Program.cs index 2d539a4e7..5745867e4 100644 --- a/src/AasxServerBlazor/Program.cs +++ b/src/AasxServerBlazor/Program.cs @@ -19,14 +19,19 @@ public static void Main(string[] args) { Console.WriteLine(Directory.GetCurrentDirectory()); + //TODO DELETE this piece of code make wrong assumptions about the current directory + /* var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json").Build(); + */ - //TODO it is not ensured that this is the actual endpoint + //TODO REFACTOR it is not ensured that this is the actual endpoint. Why is this information needed so early in the lifecycle? + /* string[] url = config["Kestrel:Endpoints:Http:Url"].Split(':'); if (url[2] != null) AasxServer.Program.blazorHostPort = url[2]; + */ CreateHostBuilder(args).Build().RunAsync(); diff --git a/src/AasxServerStandardBib/Program.cs b/src/AasxServerStandardBib/Program.cs index 1bee6d412..c54cf3964 100644 --- a/src/AasxServerStandardBib/Program.cs +++ b/src/AasxServerStandardBib/Program.cs @@ -697,6 +697,7 @@ public static void Main(string[] args) "If set, starts an OPC client and refreshes on the given period " + "(in milliseconds)"), + //TODO CHECK is the connect feature legacy code from Package Explorer? new Option( new[] {"--connect"}, "If set, connects to AAS connect server. " + @@ -967,6 +968,7 @@ public static void connectPublish(string type, string json) public static void connectThreadLoop() { + //TODO CHECK is this leagy code? bool newConnectData = false; while (connectLoop) From b0ae20d20adbbe49d41363da1b1917143fac2c9a Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 10:19:13 +0100 Subject: [PATCH 46/53] fixes standard aspnet config does not work with current use of AasxServerStandardBib Program.cs app does only run correctly within the build directory --- .github/workflows/run_newman.yml | 7 ++++--- .../GitHubActionEnvironment.json.postman_environment | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index f3c051241..9630569e1 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -29,10 +29,11 @@ jobs: run: dotnet build ./src/AasxServerBlazor/AasxServerBlazor.csproj -c Release -o ./build - name: Start Test Server And Execute Test Scripts run: | - dotnet ./build/AasxServerBlazor.dll --urls=https://localhost:7228/ & + cd build + dotnet ./AasxServerBlazor.dll --aspnet --datapath ../test/rest_api/data & sleep 5 - newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure - kill -9 `lsof -i:7228 -t` + newman run ../test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ../test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure + kill -9 `lsof -i:5001 -t` - name: Upload Report uses: actions/upload-artifact@v2 if: always() diff --git a/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment b/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment index 4fff60e8e..5356f3267 100644 --- a/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment +++ b/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment @@ -4,7 +4,7 @@ "values": [ { "key": "baseUrl", - "value": "https://localhost:7228", + "value": "http://localhost:5001", "type": "default", "enabled": true } From 02154350f5029bc7a7dfd115032b98b64e479366 Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 10:21:18 +0100 Subject: [PATCH 47/53] fix typo --- .github/workflows/run_newman.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 9630569e1..8197098ce 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -30,7 +30,7 @@ jobs: - name: Start Test Server And Execute Test Scripts run: | cd build - dotnet ./AasxServerBlazor.dll --aspnet --datapath ../test/rest_api/data & + dotnet ./AasxServerBlazor.dll --aspnet --data-path ../test/rest_api/data & sleep 5 newman run ../test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ../test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure kill -9 `lsof -i:5001 -t` From e98ddb8df1586b0ebee3ccacdcf017037d0cd4f8 Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 10:33:27 +0100 Subject: [PATCH 48/53] removed UseUrls() server does not uses same port consistently (sometimes 5000, sometimes port specified in appconfig.json) across different platforms see https://docs.microsoft.com/de-de/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-6.0 --- src/AasxServerBlazor/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AasxServerBlazor/Program.cs b/src/AasxServerBlazor/Program.cs index 5745867e4..3cb68d440 100644 --- a/src/AasxServerBlazor/Program.cs +++ b/src/AasxServerBlazor/Program.cs @@ -45,7 +45,8 @@ public static IHostBuilder CreateHostBuilder(string[] args) => { webBuilder .UseStartup() - .UseUrls("http://*:5000") + //TODO CHECK why is a manuel override used? server does not uses same port consistently (sometimes 5000, sometimes port specified in appconfig.json) across different platforms + //.UseUrls("http://*:5000") /* .UseKestrel(options => { From f315da61de50530dd55024842162a7e10bc4f78b Mon Sep 17 00:00:00 2001 From: roessba Date: Thu, 24 Feb 2022 10:51:21 +0100 Subject: [PATCH 49/53] workaround inconsistent build There are two aspnet project, where AasxServerBlazor uses IO.Swagger as library. This leads to inconsistent builds e.g. duplicated appsettings.json. --- src/IO.Swagger/IO.Swagger.csproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj index 33b969f78..5ff1c386e 100644 --- a/src/IO.Swagger/IO.Swagger.csproj +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -8,6 +8,9 @@ IO.Swagger IO.Swagger + + + @@ -26,4 +29,9 @@ <_Parameter1>IO.Swagger.Test + + + Never + + From d7a85fa0713b2f89bbf2f4a7d2b039bd05622453 Mon Sep 17 00:00:00 2001 From: br-iosb <70897399+br-iosb@users.noreply.github.com> Date: Thu, 24 Feb 2022 11:00:02 +0100 Subject: [PATCH 50/53] fixed report location after WD workaround working directory for server must be within build cd out of build folder after starting server --- .github/workflows/run_newman.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml index 8197098ce..6d70002be 100644 --- a/.github/workflows/run_newman.yml +++ b/.github/workflows/run_newman.yml @@ -31,12 +31,13 @@ jobs: run: | cd build dotnet ./AasxServerBlazor.dll --aspnet --data-path ../test/rest_api/data & - sleep 5 - newman run ../test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ../test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure + sleep 10 + cd .. + newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure kill -9 `lsof -i:5001 -t` - name: Upload Report uses: actions/upload-artifact@v2 if: always() with: name: report.html - path: ./report.html \ No newline at end of file + path: ./report.html From e51467f2bc6397d12f74903c50a9231045b1df39 Mon Sep 17 00:00:00 2001 From: roessba Date: Fri, 8 Apr 2022 12:12:57 +0200 Subject: [PATCH 51/53] launchsetting for quick dev tests --- src/AasxServerBlazor/Properties/launchSettings.json | 10 ++++++++++ src/AasxServerStandardBib/Program.cs | 4 ++++ .../SubmodelElementTest.json.postman_collection | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index fff37170c..98355ffbe 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -25,6 +25,16 @@ }, "applicationUrl": "http://localhost:5001", "jsWebView2Debugging": true + }, + "TestRestApi": { + "commandName": "Project", + "commandLineArgs": "--aspnet --no-security --data-path \"..\\..\\test\\rest_api\\data\" --edit --external-blazor http://localhost:5001", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:5001", + "jsWebView2Debugging": true } } } \ No newline at end of file diff --git a/src/AasxServerStandardBib/Program.cs b/src/AasxServerStandardBib/Program.cs index b5105bbf5..aa6a6bf76 100644 --- a/src/AasxServerStandardBib/Program.cs +++ b/src/AasxServerStandardBib/Program.cs @@ -474,6 +474,10 @@ private static int Run(CommandLineArguments a) } envi++; } + } else + { + Console.WriteLine($"AASX Data Path does not exist. \n\tCurrent Dir\t{Directory.GetCurrentDirectory()}\n\tAASX Data Path\t{AasxHttpContextHelper.DataPath}"); + throw new Exception("Invalid AASX Data Path."); } AasxHttpContextHelper.securityInit(); // read users and access rights form AASX Security diff --git a/test/rest_api/postman/SubmodelElementTest.json.postman_collection b/test/rest_api/postman/SubmodelElementTest.json.postman_collection index 135f200a3..f2942d9a1 100644 --- a/test/rest_api/postman/SubmodelElementTest.json.postman_collection +++ b/test/rest_api/postman/SubmodelElementTest.json.postman_collection @@ -301,9 +301,8 @@ }, { "key": "extent", - "value": "withBlob", - "description": "Determines to which extent the resource is being serialized", - "disabled": true + "value": "withBlobValue", + "description": "Determines to which extent the resource is being serialized" } ], "variable": [ From 9f4b777243f32a4350dfdc4ef3341bfd46bd3bb4 Mon Sep 17 00:00:00 2001 From: roessba Date: Mon, 11 Apr 2022 08:44:04 +0200 Subject: [PATCH 52/53] format code --- src/AasxServerBlazor/Program.cs | 4 ++-- src/AasxServerStandardBib/Program.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/AasxServerBlazor/Program.cs b/src/AasxServerBlazor/Program.cs index 3cb68d440..54f435792 100644 --- a/src/AasxServerBlazor/Program.cs +++ b/src/AasxServerBlazor/Program.cs @@ -45,8 +45,8 @@ public static IHostBuilder CreateHostBuilder(string[] args) => { webBuilder .UseStartup() - //TODO CHECK why is a manuel override used? server does not uses same port consistently (sometimes 5000, sometimes port specified in appconfig.json) across different platforms - //.UseUrls("http://*:5000") + //TODO CHECK why is a manuel override used? server does not uses same port consistently (sometimes 5000, sometimes port specified in appconfig.json) across different platforms + //.UseUrls("http://*:5000") /* .UseKestrel(options => { diff --git a/src/AasxServerStandardBib/Program.cs b/src/AasxServerStandardBib/Program.cs index aa6a6bf76..6adce7788 100644 --- a/src/AasxServerStandardBib/Program.cs +++ b/src/AasxServerStandardBib/Program.cs @@ -474,7 +474,8 @@ private static int Run(CommandLineArguments a) } envi++; } - } else + } + else { Console.WriteLine($"AASX Data Path does not exist. \n\tCurrent Dir\t{Directory.GetCurrentDirectory()}\n\tAASX Data Path\t{AasxHttpContextHelper.DataPath}"); throw new Exception("Invalid AASX Data Path."); From f89969eadf17b667b802aaebf46d5ae10db5ccae Mon Sep 17 00:00:00 2001 From: AlexanderWollbrink <68860592+AlexanderWollbrink@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:18:54 +0200 Subject: [PATCH 53/53] test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd0d347b6..335f9f574 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ https://github.com/admin-shell-io/aasx-server/workflows/Build-and-publish-docker ) AASX Server serves Industrie 4.0 AASX packages accessible by REST, OPC UA and -MQTT protocols. +MQTT protocols.. The AASX Server is based on code of AASX Package Explorer ( https://github.com/admin-shell-io/aasx-package-explorer