diff --git a/.github/workflows/run_newman.yml b/.github/workflows/run_newman.yml new file mode 100644 index 000000000..6d70002be --- /dev/null +++ b/.github/workflows/run_newman.yml @@ -0,0 +1,43 @@ +name: newman_tests + +on: + push + #workflow_dispatch + +jobs: + api-test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.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@5.3.1 + 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: Start Test Server And Execute Test Scripts + run: | + cd build + dotnet ./AasxServerBlazor.dll --aspnet --data-path ../test/rest_api/data & + 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 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 diff --git a/src/AasxServer.sln b/src/AasxServer.sln index e7b24bfdd..3b7aa454f 100644 --- a/src/AasxServer.sln +++ b/src/AasxServer.sln @@ -24,6 +24,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger.Lib", "IO.Swagge EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger.Registry", "IO.Swagger.Registry.Lib\IO.Swagger.Registry.csproj", "{F7B9E4DC-FDCD-4F6B-A5C5-DF416802B067}" 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 diff --git a/src/AasxServerBlazor/AasxServerBlazor.csproj b/src/AasxServerBlazor/AasxServerBlazor.csproj index 08e60198b..dd45235d3 100644 --- a/src/AasxServerBlazor/AasxServerBlazor.csproj +++ b/src/AasxServerBlazor/AasxServerBlazor.csproj @@ -24,8 +24,6 @@ - - PreserveNewest diff --git a/src/AasxServerBlazor/Program.cs b/src/AasxServerBlazor/Program.cs index 54be5cbb6..54f435792 100644 --- a/src/AasxServerBlazor/Program.cs +++ b/src/AasxServerBlazor/Program.cs @@ -19,12 +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 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.blazorPort = url[2]; + AasxServer.Program.blazorHostPort = url[2]; + */ CreateHostBuilder(args).Build().RunAsync(); @@ -38,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 => { diff --git a/src/AasxServerBlazor/Properties/launchSettings.json b/src/AasxServerBlazor/Properties/launchSettings.json index 41dd6f39a..98355ffbe 100644 --- a/src/AasxServerBlazor/Properties/launchSettings.json +++ b/src/AasxServerBlazor/Properties/launchSettings.json @@ -18,7 +18,17 @@ }, "AasxServerBlazor": { "commandName": "Project", - "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\PCF\" --edit --external-blazor http://localhost:5001", + "commandLineArgs": "--aspnet --no-security --data-path \"C:\\Development\\AASX\" --edit --external-blazor http://localhost:5001", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "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" diff --git a/src/AasxServerStandardBib/Program.cs b/src/AasxServerStandardBib/Program.cs index 57d995e4d..6adce7788 100644 --- a/src/AasxServerStandardBib/Program.cs +++ b/src/AasxServerStandardBib/Program.cs @@ -169,6 +169,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; } @@ -474,6 +475,11 @@ 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 AasxHttpContextHelper.serverCertsInit(); // load certificates of auth servers @@ -695,6 +701,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"), @@ -704,6 +714,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. " + @@ -755,7 +766,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); @@ -979,6 +990,7 @@ public static void connectPublish(string type, string json) public static void connectThreadLoop() { + //TODO CHECK is this leagy code? bool newConnectData = false; while (connectLoop) 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..97b193c67 --- /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..d1cead5d8 --- /dev/null +++ b/src/IO.Swagger/Controllers/AssetAdministrationShellRepositoryApi.cs @@ -0,0 +1,1923 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using AdminShellNS; +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; +using Swashbuckle.AspNetCore.Annotations; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + //[Authorize] + [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) + { + try + { + var deleted = aasHelper.DeleteAASAndAsset(Base64UrlEncoder.Decode(aasIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(2); + return NoContent(); + } + + return NotFound($"AAS not Found"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + 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(1);//same tree + return NoContent(); + } + + return NotFound($"Could not delete the concept description. Please check the identifier again."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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"); + } + + 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(1); //Same tree, structure changed + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + if (submodel == null) + { + return NotFound($"Submodel 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(1); // Same tree, structure may change + return NoContent(); + } + + return StatusCode(500, $"Could not delete Submodelelement. Please check the logs for more details."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + bool deleted = aasHelper.DeleteSubmodelReferenceFromAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (deleted) + { + AasxServer.Program.signalNewData(1);//same tree structute may change + return NoContent(); + } + + return NotFound($"Could not delete the submodel reference from AAS"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + AdminShellV20.AdministrationShellEnv outputEnv = new AdminShellV20.AdministrationShellEnv(); + + //Fetch AASs for the requested aasIds + var aaslist = aasHelper.FindAllAasByAASIds(aasIds); + outputEnv.AdministrationShells = aaslist; + + //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 conceptDescriptionList = aasHelper.FindConceptDescriptionInAASs(aasIds); + aasHelper.FindAllConceptDescriptionsInSubmodels(submodelIds, conceptDescriptionList); + outputEnv.ConceptDescriptions.AddRange(conceptDescriptionList); + } + + return new ObjectResult(outputEnv); + + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var aasList = new List(); + + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + aasList.Add(env.AasEnv.AdministrationShells[0]); + } + } + + //Filter w.r.t assetIds + if (!string.IsNullOrEmpty(assetIds)) + { + assetIds = Base64UrlEncoder.Decode(assetIds); + var assetIdList = JsonConvert.DeserializeObject>(assetIds); + aasList = aasHelper.FindAllAasByAssetIds(assetIdList); + } + + //Filter w.r.t idShort + if (!string.IsNullOrEmpty(idShort)) + { + aasList = aasList.Where(x => (x.idShort != null) && x.idShort.Equals(idShort)).ToList(); + } + + return new ObjectResult(aasList); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var output = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + output.AddRange(env.AasEnv.ConceptDescriptions); + } + } + + //Filter a list w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } + + //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(); + } + + //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); + + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + + } + + /// + /// 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) + { + + try + { + // 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); + } + + var json = aasHelper.HandleOutputModifiers(submodelElements, level, content, extent); + + return new ObjectResult(json); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + if (submodel != null) + { + 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 NotFound($"Submodel not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS.submodelRefs); + } + return NotFound($"AAS not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + + } + + /// + /// 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) + { + try + { + var output = new List(); + foreach (AdminShellPackageEnv env in AasxServer.Program.env) + { + if (env != null) + { + output.AddRange(env.AasEnv.Submodels); + } + } + + //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(); + } + + //Filter w.r.t. idShort + if (!string.IsNullOrEmpty(idShort)) + { + output = output.Where(x => x.idShort.Equals(idShort)).ToList(); + } + + return new ObjectResult(output); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + //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 NotFound(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var aasReturn = aasHelper.FindAas(Base64UrlEncoder.Decode(aasIdentifier)); + if (aasReturn.AAS != null) + { + return new ObjectResult(aasReturn.AAS); + } + + return NotFound($"Asset Administration Shell not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } + } + + /// + /// 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 + try + { + 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(); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + + } + + /// + /// 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) + { + try + { + var conceptDescription = aasHelper.FindConceptDescription(Base64UrlEncoder.Decode(cdIdentifier), out _); + if (conceptDescription != null) + { + return new ObjectResult(conceptDescription); + } + + return NotFound($"Concept Description not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } + } + + /// + /// 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) + { + try + { + 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"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + if (string.IsNullOrEmpty(handleId)) + { + return BadRequest($"Invalid HandleId."); + } + + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + 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"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var submodel = aasHelper.FindSubmodelWithinAAS(Base64UrlEncoder.Decode(aasIdentifier), Base64UrlEncoder.Decode(submodelIdentifier)); + if (submodel == null) + { + return NotFound($"Either AAS or Submodel 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"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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 not found. Please check the identifier."); + } + + 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) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + 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 json = aasHelper.HandleOutputModifiers(submodelElement, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel Element not found"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + if (submodel == null) + { + return NotFound($"The Submodel not found"); + } + + var json = aasHelper.HandleOutputModifiers(submodel, level, content, extent); + if (json != null) + { + return new ObjectResult(json); + } + + return NotFound($"Submodel not found"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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) + { + //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 BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + 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."); + } + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + 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.identification.id); + if (aasReturn.AAS != null) + { + return Conflict($"Asset Administration Shell already exists."); + } + + bool added = aasHelper.PostAAS(body); + if (added) + { + AasxServer.Program.signalNewData(2); + return Created($"Asset Administration Shell created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + throw; + } + } + + + /// + /// 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) + { + try + { + 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.identification.id, out _); + if (conceptDescription != null) + { + return Conflict($"Concept Description already exists."); + } + + bool added = aasHelper.PostConceptDescription(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) + { + return BadRequest(ex.Message); + throw; + } + } + + /// + /// 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) + { + try + { + 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.identification.id, out _); + if (submodel != null) + { + return Conflict($"Submodel already exists."); + } + + bool added = aasHelper.PostSubmodel(body); + if (added) + { + AasxServer.Program.signalNewData(1); //same tree, structure may change + return Created($"Submodel created successfully.", body); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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 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"); + } + + bool added = aasHelper.PostSubmodelElement(submodel, body); + if (added) + { + object output = aasHelper.HandleOutputModifiers(body, level, content, extent); + 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"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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"); + } + + //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."); + } + + 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 already exists in {idShortPath}."); + } + } + + bool added = aasHelper.PostSubmodelElementByPath(parentSME, body); + if (added) + { + AasxServer.Program.signalNewData(1); //same tree, structure may change + 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) + { + return BadRequest(ex.Message); + throw; + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + 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."); + } + + 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 already exists in {idShortPath}."); + } + } + + bool added = aasHelper.PostSubmodelElementByPath(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) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + 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"); + } + + bool added = aasHelper.PostSubmodelElement(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); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + 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 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"); + } + + aasReturn.AAS.AddSubmodelRef(new AdminShellV20.SubmodelRef(body)); + AasxServer.Program.signalNewData(1); + return Created($"Submodel reference created successfully.", body); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + + } + + /// + /// 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) + { + try + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in AAS."); + } + + 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(1); // same tree, structure may change + object output = aasHelper.HandleOutputModifiers(body, content: content); + return Created($"AAS updated successfully.", output); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + 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.PutAAS(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(1); //Same tree, structure/values may change (e.g., submodelRefs may be added or deleted, hence 1) + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + public virtual IActionResult PutAssetInformation([FromBody] AdminShellV20.Asset body, [FromRoute][Required] string aasIdentifier) + { + try + { + //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."); + } + + bool added = aasHelper.AddAsset(body, aasReturn); + if (added) + { + AasxServer.Program.signalNewData(1); //Same tree, strcture may change + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + 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.PutConceptDescription(body, existingCD, packageIndex); + if (added) + { + AasxServer.Program.signalNewData(0); //Same tree, same structure, only values modified + return NoContent(); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + 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 not found."); + } + + //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. + 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); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //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"); + } + + 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 + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) + { + 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.PutSubmodelElementByPath(parent, body, existingSME); + if (added) + { + 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); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + //Check if submodel exists + var submodel = aasHelper.FindSubmodel(Base64UrlEncoder.Decode(submodelIdentifier), out _); + if (submodel == null) + { + 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 + var existingSME = aasHelper.FindSubmodelElementByPath(submodel, idShortPath, out object parent); + if (existingSME == null) + { + 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.PutSubmodelElementByPath(parent, body, existingSME); + if (added) + { + 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); + } + + //Re-do + return NotFound($"Requested submodel element not found."); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + /// + /// 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) + { + try + { + if (body.identification == null || string.IsNullOrEmpty(body.identification.id)) + { + return BadRequest($"No Identification found in Submodel."); + } + + //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(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); + } + + return Ok($"Error: not added since datastructure completely filled already"); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + } +} 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/Extensions/JsonSerializerExtension.cs b/src/IO.Swagger/Extensions/JsonSerializerExtension.cs new file mode 100644 index 000000000..4fe9f3897 --- /dev/null +++ b/src/IO.Swagger/Extensions/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.Extensions +{ + 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/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/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 000000000..eef6989b3 --- /dev/null +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +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..6ae26d170 --- /dev/null +++ b/src/IO.Swagger/Helpers/AASHelper.cs @@ -0,0 +1,1344 @@ +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 IO.Swagger.Extensions; +using Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +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; + private Timer m_simulationTimer; + + /// + /// 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; + } + + /// + /// Deletes a concept description + /// + /// Concept Description Object + /// Package Index of the CD from the server + /// + internal bool DeleteConceptDescription(ConceptDescription conceptDescription, int packageIndex) + { + if (conceptDescription != null) + { + Packages[packageIndex].AasEnv.ConceptDescriptions.Remove(conceptDescription); + return true; + } + + return false; + } + + + 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 = -1; + 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) + { + 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, 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; + } + + 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; + } + + /// + /// 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; + + for (int envi = 0; envi < Packages.Length; envi++) + { + 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 + return null; + } + + /// + /// Creates a new Asset Administration Shell + /// + /// 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) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.AdministrationShells.Add(aas); + return true; + } + + 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 + /// + /// 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; + + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] == null) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + 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; + } + + 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; + } + + 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) + { + 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") + { + //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)) + { + level = "deep"; + } + + if (string.IsNullOrEmpty(content)) + { + content = "normal"; + } + + if (string.IsNullOrEmpty(extent)) + { + 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); + } + + 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, extent); + 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; + } + + /// + /// 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, extent); + values.Add(value); + } + return values; + } + else if (obj is SubmodelElementCollection collection) + { + //SMECollection is serialized as named JSON Object + Dictionary> output = new Dictionary>(); + 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)) + { + continue; + } + 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) + { + List values = new List(); + foreach (var smElement in smEleList) + { + object value = GetValueOnly(smElement, level, extent); + values.Add(value); + } + return values; + } + 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) + { + 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) + { + GetIdShortPath(smEle.submodelElement, level, idShortPath); + } + } + } + else if (obj is Entity entity) + { + 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) + { + 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) + return aas.GetReference(); + else if (obj is Submodel submodel) + 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."); + return obj; + } + } + + /// + /// Creates a new Submodel + /// + /// Submodel object + /// + internal bool PostSubmodel(Submodel submodel) + { + bool emptyPackageAvailable = false; + int emptyPackageIndex = -1; + + for (int envi = 0; envi < Packages.Length; envi++) + { + if (Packages[envi] == null) + { + emptyPackageAvailable = true; + emptyPackageIndex = envi; + break; + } + } + + if (emptyPackageAvailable) + { + Packages[emptyPackageIndex] = new AdminShellPackageEnv(); + Packages[emptyPackageIndex].AasEnv.Submodels.Add(submodel); + return true; + } + + 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 + 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; + } + + /// + /// Creates a new submodel element + /// + /// Parent Submodel + /// New Submodel Element to be added + /// + internal bool PostSubmodelElement(Submodel submodel, SubmodelElement submodelElement) + { + if (submodel != null) + { + submodel.Add(submodelElement); + submodel.SetAllParents(DateTime.UtcNow); + return true; + } + return false; + } + + /// + /// + /// + /// + /// e.g. SMEColl_idShort.SME_idShort + /// Parent of SME, bzw. SMEColl + /// + internal SubmodelElement FindSubmodelElementByPath(object parent, string idShortPath, out object outParent) + { + outParent = parent; + if (idShortPath.Contains('.')) + { + string[] idShorts = idShortPath.Split('.', 2); + if (parent is Submodel submodel) + { + var submodelElement = submodel.FindSubmodelElementWrapper(idShorts[0]); + if (submodelElement != null) + { + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); + } + } + else if (parent is SubmodelElementCollection collection) + { + var submodelElement = collection.FindFirstIdShort(idShorts[0]); + if (submodelElement != null) + { + return FindSubmodelElementByPath(submodelElement.submodelElement, idShorts[1], out outParent); + } + } + } + else + { + if (parent is Submodel submodel) + { + var submodelElement = submodel.FindSubmodelElementWrapper(idShortPath); + if (submodelElement != null) + { + return submodelElement.submodelElement; + } + } + else if (parent is SubmodelElementCollection collection) + { + var submodelElement = collection.FindFirstIdShort(idShortPath); + if (submodelElement != null) + { + return submodelElement.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 object GetOperationAsyncResult(string handleId) + { + AsyncOperationResultStorage.opResultAsyncDict.TryGetValue(handleId, out Models.OperationResult opResult); + return opResult; + } + + 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 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(); + InvokeTestOperation(opHandle); + } + + return opHandle; + } + + + //TestOperation invokation for demo + private void InvokeTestOperation(Models.OperationHandle opHandle) + { + //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; + + AsyncOperationResultStorage.opResultAsyncDict.Add(opHandle.HandleId, opResult); + + 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)); + + foreach (var handleId in AsyncOperationResultStorage.opResultAsyncDict.Keys) + { + var value = (Models.OperationResult.ExecutionStateEnum)values.GetValue(random.Next(values.Length)); + AsyncOperationResultStorage.opResultAsyncDict[handleId].ExecutionState = value; + } + } + + + /// + /// Creates a new submodel element at a specified path within submodel elements hierarchy + /// + /// 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) + { + 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++) + { + if (existingSME.Equals(parentSMEColl.value[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } + } + 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++) + { + if (existingSME.Equals(submodel.submodelElements[i].submodelElement)) + { + indexOfExistingSME = i; + break; + } + } + submodel.submodelElements.RemoveAt(indexOfExistingSME); + submodel.Insert(indexOfExistingSME, submodelElement); + return true; + } + 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; + } + + + } + + /// + /// The class consists of an AAS and a ENV package which it belongs to. + /// + 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; + } + + /// + /// 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/IdentifierKeyValuePair_V2.cs b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs new file mode 100644 index 000000000..75f3f3e6f --- /dev/null +++ b/src/IO.Swagger/Helpers/IdentifierKeyValuePair_V2.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +using IO.Swagger.Models; +using Newtonsoft.Json; + +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..47a59e8be --- /dev/null +++ b/src/IO.Swagger/Helpers/OutputModifierContractResolver.cs @@ -0,0 +1,188 @@ +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 +{ + /// + /// This converter / contract resolver for Json.NET adaptively filters different levels of depth + /// of nested AASX structures. + /// + public class OutputModifierContractResolver : DefaultContractResolver + { + 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 + } + + + + + + /// + /// Default level of the json response. + /// + public bool Deep + { + get => deep; + set + { + //Core + if (value == 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. + /// + public string Content + { + get => 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; } + + /// + /// + /// + /// + /// + /// + 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) + { + excluded = true; + property.ShouldSerialize = + instance => + { + return false; + }; + } + } + } + + //Encode the value + if (!excluded && (property.DeclaringType == typeof(Blob)) && property.PropertyName.Equals("value")) + { + property.ShouldSerialize = + instance => + { + var value = Base64UrlEncoder.Encode(((Blob)instance).value); + ((Blob)instance).value = value; + return true; + }; + } + + return property; + } + + } + +} diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 000000000..5ff1c386e --- /dev/null +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,37 @@ + + + IO.Swagger + IO.Swagger + netcoreapp3.1 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + + + + + + + + + + + <_Parameter1>IO.Swagger.Test + + + + + Never + + + diff --git a/src/IO.Swagger/Models/AccessControl.cs b/src/IO.Swagger/Models/AccessControl.cs new file mode 100644 index 000000000..10907a021 --- /dev/null +++ b/src/IO.Swagger/Models/AccessControl.cs @@ -0,0 +1,218 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..c2460d28d --- /dev/null +++ b/src/IO.Swagger/Models/AccessControlPolicyPoints.cs @@ -0,0 +1,173 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..dd94cafa3 --- /dev/null +++ b/src/IO.Swagger/Models/AccessPermissionRule.cs @@ -0,0 +1,148 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..7d4b2c292 --- /dev/null +++ b/src/IO.Swagger/Models/AdministrativeInformation.cs @@ -0,0 +1,129 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..112315725 --- /dev/null +++ b/src/IO.Swagger/Models/AnnotatedRelationshipElement.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..458e1f6f6 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShell.cs @@ -0,0 +1,193 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..88f67df84 --- /dev/null +++ b/src/IO.Swagger/Models/AssetAdministrationShellEnvironment.cs @@ -0,0 +1,146 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..46de259e0 --- /dev/null +++ b/src/IO.Swagger/Models/AssetInformation.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..71b390e66 --- /dev/null +++ b/src/IO.Swagger/Models/AssetKind.cs @@ -0,0 +1,32 @@ +/* + * 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.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..bcb4dea85 --- /dev/null +++ b/src/IO.Swagger/Models/BasicEvent.cs @@ -0,0 +1,116 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..b5d431a4b --- /dev/null +++ b/src/IO.Swagger/Models/Blob.cs @@ -0,0 +1,131 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..b984cfdbb --- /dev/null +++ b/src/IO.Swagger/Models/BlobCertificate.cs @@ -0,0 +1,147 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..5291e1137 --- /dev/null +++ b/src/IO.Swagger/Models/Capability.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..8b2a9e043 --- /dev/null +++ b/src/IO.Swagger/Models/Certificate.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..e56650cf8 --- /dev/null +++ b/src/IO.Swagger/Models/ConceptDescription.cs @@ -0,0 +1,131 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..fd02efdd4 --- /dev/null +++ b/src/IO.Swagger/Models/Constraint.cs @@ -0,0 +1,118 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..fa40c49a6 --- /dev/null +++ b/src/IO.Swagger/Models/DataElement.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..a2fd64638 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationContent.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..89c150803 --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationIEC61360Content.cs @@ -0,0 +1,268 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..e6cce21df --- /dev/null +++ b/src/IO.Swagger/Models/DataSpecificationPhysicalUnitContent.cs @@ -0,0 +1,300 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..1ec412c74 --- /dev/null +++ b/src/IO.Swagger/Models/EmbeddedDataSpecification.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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..060f340c1 --- /dev/null +++ b/src/IO.Swagger/Models/Entity.cs @@ -0,0 +1,163 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..1d4873919 --- /dev/null +++ b/src/IO.Swagger/Models/EntityType.cs @@ -0,0 +1,32 @@ +/* + * 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.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..7f30262af --- /dev/null +++ b/src/IO.Swagger/Models/Extension.cs @@ -0,0 +1,161 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..d0e782f38 --- /dev/null +++ b/src/IO.Swagger/Models/File.cs @@ -0,0 +1,131 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..a9f019c1d --- /dev/null +++ b/src/IO.Swagger/Models/Formula.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..6bbaf6048 --- /dev/null +++ b/src/IO.Swagger/Models/GlobalReference.cs @@ -0,0 +1,118 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..620fbe985 --- /dev/null +++ b/src/IO.Swagger/Models/HasDataSpecification.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..d91f3043d --- /dev/null +++ b/src/IO.Swagger/Models/HasExtensions.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..a5b4bee0c --- /dev/null +++ b/src/IO.Swagger/Models/HasSemantics.cs @@ -0,0 +1,116 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..b275ca9c1 --- /dev/null +++ b/src/IO.Swagger/Models/Identifiable.cs @@ -0,0 +1,131 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..a6fe72e20 --- /dev/null +++ b/src/IO.Swagger/Models/IdentifierKeyValuePair.cs @@ -0,0 +1,148 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..ebf984a98 --- /dev/null +++ b/src/IO.Swagger/Models/Key.cs @@ -0,0 +1,134 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..ca9e15f15 --- /dev/null +++ b/src/IO.Swagger/Models/KeyElements.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.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..c2c7de816 --- /dev/null +++ b/src/IO.Swagger/Models/LangString.cs @@ -0,0 +1,132 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..f57e17244 --- /dev/null +++ b/src/IO.Swagger/Models/LevelType.cs @@ -0,0 +1,42 @@ +/* + * 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.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..958130530 --- /dev/null +++ b/src/IO.Swagger/Models/Message.cs @@ -0,0 +1,192 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..ce0ac1cd1 --- /dev/null +++ b/src/IO.Swagger/Models/ModelEvent.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..c48969a34 --- /dev/null +++ b/src/IO.Swagger/Models/ModelReference.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.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..d76707295 --- /dev/null +++ b/src/IO.Swagger/Models/ModelType.cs @@ -0,0 +1,118 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..74241bc09 --- /dev/null +++ b/src/IO.Swagger/Models/ModelTypes.cs @@ -0,0 +1,157 @@ +/* + * 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.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..5748c03df --- /dev/null +++ b/src/IO.Swagger/Models/ModelingKind.cs @@ -0,0 +1,32 @@ +/* + * 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.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..10a361a2a --- /dev/null +++ b/src/IO.Swagger/Models/MultiLanguageProperty.cs @@ -0,0 +1,131 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..f6a602e2e --- /dev/null +++ b/src/IO.Swagger/Models/ObjectAttributes.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..16ebeaa44 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfCertificate.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..72936972a --- /dev/null +++ b/src/IO.Swagger/Models/OneOfConstraint.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..4e5a895dd --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataElement.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..f0c77bc45 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfDataSpecificationContent.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..22e9c606e --- /dev/null +++ b/src/IO.Swagger/Models/OneOfOperationVariableValue.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..b53ec7af5 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfReference.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..c82dd42d8 --- /dev/null +++ b/src/IO.Swagger/Models/OneOfSubmodelElement.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..4f821d2bb --- /dev/null +++ b/src/IO.Swagger/Models/Operation.cs @@ -0,0 +1,146 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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/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 new file mode 100644 index 000000000..6fe68f239 --- /dev/null +++ b/src/IO.Swagger/Models/OperationRequest.cs @@ -0,0 +1,161 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..48103ebf4 --- /dev/null +++ b/src/IO.Swagger/Models/OperationResult.cs @@ -0,0 +1,216 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..cd09578d4 --- /dev/null +++ b/src/IO.Swagger/Models/OperationVariable.cs @@ -0,0 +1,116 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..0b0b86889 --- /dev/null +++ b/src/IO.Swagger/Models/Permission.cs @@ -0,0 +1,162 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..14f5c6d6c --- /dev/null +++ b/src/IO.Swagger/Models/PermissionsPerObject.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.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..e8d85d230 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyAdministrationPoint.cs @@ -0,0 +1,133 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..94e63c455 --- /dev/null +++ b/src/IO.Swagger/Models/PolicyDecisionPoint.cs @@ -0,0 +1,116 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..cadf0746e --- /dev/null +++ b/src/IO.Swagger/Models/PolicyEnforcementPoint.cs @@ -0,0 +1,116 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..4cabb3dee --- /dev/null +++ b/src/IO.Swagger/Models/PolicyInformationPoints.cs @@ -0,0 +1,133 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..59745986f --- /dev/null +++ b/src/IO.Swagger/Models/Property.cs @@ -0,0 +1,148 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..192da91e6 --- /dev/null +++ b/src/IO.Swagger/Models/Qualifiable.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..339c7bdf9 --- /dev/null +++ b/src/IO.Swagger/Models/Qualifier.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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..027cb9a2b --- /dev/null +++ b/src/IO.Swagger/Models/Range.cs @@ -0,0 +1,146 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..d5d689834 --- /dev/null +++ b/src/IO.Swagger/Models/Referable.cs @@ -0,0 +1,179 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..919adbc73 --- /dev/null +++ b/src/IO.Swagger/Models/Reference.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..de80c2cf7 --- /dev/null +++ b/src/IO.Swagger/Models/ReferenceElement.cs @@ -0,0 +1,114 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..3d10e6079 --- /dev/null +++ b/src/IO.Swagger/Models/RelationshipElement.cs @@ -0,0 +1,132 @@ +/* + * 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.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +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..342f27a50 --- /dev/null +++ b/src/IO.Swagger/Models/Result.cs @@ -0,0 +1,131 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..c578671fb --- /dev/null +++ b/src/IO.Swagger/Models/Security.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.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..10a305f80 --- /dev/null +++ b/src/IO.Swagger/Models/SubjectAttributes.cs @@ -0,0 +1,116 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..f2bbcaddf --- /dev/null +++ b/src/IO.Swagger/Models/Submodel.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.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..0bcebfe49 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElement.cs @@ -0,0 +1,163 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..bb33d2f35 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementList.cs @@ -0,0 +1,161 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..c1bc9f033 --- /dev/null +++ b/src/IO.Swagger/Models/SubmodelElementStruct.cs @@ -0,0 +1,116 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..87e8bdcef --- /dev/null +++ b/src/IO.Swagger/Models/ValueList.cs @@ -0,0 +1,118 @@ +/* + * 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 System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..c83fda12e --- /dev/null +++ b/src/IO.Swagger/Models/ValueObject.cs @@ -0,0 +1,148 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..f21741a11 --- /dev/null +++ b/src/IO.Swagger/Models/ValueReferencePairType.cs @@ -0,0 +1,99 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +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..70bf2d1e1 --- /dev/null +++ b/src/IO.Swagger/Models/ValueTypeEnum.cs @@ -0,0 +1,242 @@ +/* + * 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.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..a4c83b19d --- /dev/null +++ b/src/IO.Swagger/Models/View.cs @@ -0,0 +1,148 @@ +/* + * 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 System.Linq; +using System.Runtime.Serialization; +using System.Text; +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..6d6775779 --- /dev/null +++ b/src/IO.Swagger/Program.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; + +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..3bc67e449 --- /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", + "commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\AASX\" --edit", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + }, + "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/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")); + } + } +} diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs new file mode 100644 index 000000000..9d5e2d370 --- /dev/null +++ b/src/IO.Swagger/Startup.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.IO; +using IO.Swagger.Filters; +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; + + +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 @@ + + + + + + + + + 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 000000000..b4f04c635 Binary files /dev/null and b/test/rest_api/data/test_elements.aasx differ 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/GitHubActionEnvironment.json.postman_environment b/test/rest_api/postman/GitHubActionEnvironment.json.postman_environment new file mode 100644 index 000000000..5356f3267 --- /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": "http://localhost:5001", + "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 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..f2942d9a1 --- /dev/null +++ b/test/rest_api/postman/SubmodelElementTest.json.postman_collection @@ -0,0 +1,480 @@ +{ + "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": "withBlobValue", + "description": "Determines to which extent the resource is being serialized" + } + ], + "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