diff --git a/IngeniBridge.Programs/.vs/IngeniBridge.Programs/DesignTimeBuild/.dtbcache b/IngeniBridge.Programs/.vs/IngeniBridge.Programs/DesignTimeBuild/.dtbcache index d770253..b75b33c 100644 Binary files a/IngeniBridge.Programs/.vs/IngeniBridge.Programs/DesignTimeBuild/.dtbcache and b/IngeniBridge.Programs/.vs/IngeniBridge.Programs/DesignTimeBuild/.dtbcache differ diff --git a/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/IngeniBridge.GenerateFullInventory.csproj b/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/IngeniBridge.GenerateFullInventory.csproj index 5c7c787..55fd6ab 100644 --- a/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/IngeniBridge.GenerateFullInventory.csproj +++ b/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/IngeniBridge.GenerateFullInventory.csproj @@ -13,11 +13,11 @@ - + - - + + @@ -28,8 +28,8 @@ - - + + \ No newline at end of file diff --git a/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/Properties/launchSettings.json b/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/Properties/launchSettings.json index 9a83094..bbd6ff2 100644 --- a/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/Properties/launchSettings.json +++ b/IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "IngeniBridge.GenerateFullInventory": { "commandName": "Project", - "commandLineArgs": "--StorageAccessorAssembly=\"IngeniBridge.StorageAccessor.InMemory.dll\" --IBDatabase=..\\..\\IngeniBridge.Sample.MyCompany\\IngeniBridge.Samples.MyCompany\\MasterAssetMyCompany_2018_09_13.ibdb --InventoryFile=InventoryFileIB.xlsx" + "commandLineArgs": "--StorageAccessorAssembly=\"IngeniBridge.StorageAccessor.InMemory.dll\" --IBDatabase=..\\..\\..\\..\\..\\IngeniBridge.Sample.MyCompany\\MasterAssetMyCompany_2020_01_03.ibdb --InventoryFile=InventoryFileIB.xlsx" } } } \ No newline at end of file diff --git a/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/IngeniBridge.IBDatabaseParser.csproj b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/IngeniBridge.IBDatabaseParser.csproj index 9681c8e..15e48e6 100644 --- a/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/IngeniBridge.IBDatabaseParser.csproj +++ b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/IngeniBridge.IBDatabaseParser.csproj @@ -13,10 +13,10 @@ - + - - + + @@ -33,8 +33,8 @@ - - + + \ No newline at end of file diff --git a/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/LaunchOnMyCompanyDb.cmd b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/LaunchOnMyCompanyDb.cmd index 066bb46..1d0cd5b 100644 --- a/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/LaunchOnMyCompanyDb.cmd +++ b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/LaunchOnMyCompanyDb.cmd @@ -1,4 +1,4 @@ rem dont forget to rename ibdb file in the command line cd bin\Release\netcoreapp2.1 -dotnet.exe IngeniBridge.IBDatabaseParser.dll --StorageAccessorAssembly="IngeniBridge.StorageAccessor.InMemory.dll" --IBDatabase=..\..\..\..\..\IngeniBridge.Sample.MyCompany\MasterAssetMyCompany_2019_06_21.ibdb +dotnet.exe IngeniBridge.IBDatabaseParser.dll --StorageAccessorAssembly="IngeniBridge.StorageAccessor.InMemory.dll" --IBDatabase=..\..\..\..\..\IngeniBridge.Sample.MyCompany\MasterAssetMyCompany_2020_01_03.ibdb pause \ No newline at end of file diff --git a/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/Properties/launchSettings.json b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/Properties/launchSettings.json new file mode 100644 index 0000000..e33cf23 --- /dev/null +++ b/IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "IngeniBridge.IBDatabaseParser": { + "commandName": "Project", + "commandLineArgs": "--StorageAccessorAssembly=\"IngeniBridge.StorageAccessor.InMemory.dll\" --IBDatabase=..\\..\\..\\..\\..\\IngeniBridge.Sample.MyCompany\\MasterAssetMyCompany_2020_01_03.ibdb" + } + } +} \ No newline at end of file diff --git a/IngeniBridge.Sample.MyCompany/.vs/IngeniBridge.Samples.MyCompany/DesignTimeBuild/.dtbcache b/IngeniBridge.Sample.MyCompany/.vs/IngeniBridge.Samples.MyCompany/DesignTimeBuild/.dtbcache index 37bfe79..8472d96 100644 Binary files a/IngeniBridge.Sample.MyCompany/.vs/IngeniBridge.Samples.MyCompany/DesignTimeBuild/.dtbcache and b/IngeniBridge.Sample.MyCompany/.vs/IngeniBridge.Samples.MyCompany/DesignTimeBuild/.dtbcache differ diff --git a/IngeniBridge.Sample.MyCompany/IngeniBridge.Samples.MyCompany/IngeniBridge.Samples.MyCompany.csproj b/IngeniBridge.Sample.MyCompany/IngeniBridge.Samples.MyCompany/IngeniBridge.Samples.MyCompany.csproj index 74f7984..2d00ffd 100644 --- a/IngeniBridge.Sample.MyCompany/IngeniBridge.Samples.MyCompany/IngeniBridge.Samples.MyCompany.csproj +++ b/IngeniBridge.Sample.MyCompany/IngeniBridge.Samples.MyCompany/IngeniBridge.Samples.MyCompany.csproj @@ -17,11 +17,11 @@ - - + + - - + + @@ -41,6 +41,6 @@ - + diff --git a/IngeniBridge.Sample.MyCompany/MasterAssetMyCompany_2020_01_03.ibdb b/IngeniBridge.Sample.MyCompany/MasterAssetMyCompany_2020_01_03.ibdb new file mode 100644 index 0000000..7419b36 Binary files /dev/null and b/IngeniBridge.Sample.MyCompany/MasterAssetMyCompany_2020_01_03.ibdb differ diff --git a/IngeniBridge.Sample.MyCompany/MyCompanyDataModel/MyCompanyDataModel.csproj b/IngeniBridge.Sample.MyCompany/MyCompanyDataModel/MyCompanyDataModel.csproj index a9203c6..6c69d5c 100644 --- a/IngeniBridge.Sample.MyCompany/MyCompanyDataModel/MyCompanyDataModel.csproj +++ b/IngeniBridge.Sample.MyCompany/MyCompanyDataModel/MyCompanyDataModel.csproj @@ -12,7 +12,7 @@ - + diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/.vs/IngeniBridge.TestServer/DesignTimeBuild/.dtbcache b/IngeniBridge.TestServer/IngeniBridge.TestServer/.vs/IngeniBridge.TestServer/DesignTimeBuild/.dtbcache index 59a5eb8..9e62826 100644 Binary files a/IngeniBridge.TestServer/IngeniBridge.TestServer/.vs/IngeniBridge.TestServer/DesignTimeBuild/.dtbcache and b/IngeniBridge.TestServer/IngeniBridge.TestServer/.vs/IngeniBridge.TestServer/DesignTimeBuild/.dtbcache differ diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/ConnectedService.json b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/ConnectedService.json new file mode 100644 index 0000000..2143c20 --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/ConnectedService.json @@ -0,0 +1,7 @@ +{ + "ProviderId": "DmitryPavlov.OpenApiConnectedService", + "Version": "1.0.7082.39643", + "GettingStartedDocument": { + "Uri": "https://github.com/dmitry-pavlov/openapi-connected-service" + } +} \ No newline at end of file diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag new file mode 100644 index 0000000..0794d65 --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag @@ -0,0 +1,86 @@ +{ + "runtime": "NetCore21", + "defaultVariables": null, + "swaggerGenerator": { + "fromSwagger": { + "url": "http://demo.ingenibridge.com/swagger/docs/1.0", + "output": "IngeniBridgeProxy.nswag.json" + } + }, + "codeGenerators": { + "swaggerToCSharpClient": { + "clientBaseClass": null, + "configurationClass": null, + "generateClientClasses": true, + "generateClientInterfaces": false, + "generateDtoTypes": true, + "injectHttpClient": true, + "disposeHttpClient": true, + "protectedMethods": [], + "generateExceptionClasses": true, + "exceptionClass": "SwaggerException", + "wrapDtoExceptions": true, + "useHttpClientCreationMethod": false, + "httpClientType": "System.Net.Http.HttpClient", + "useHttpRequestMessageCreationMethod": false, + "useBaseUrl": true, + "generateBaseUrlProperty": true, + "generateSyncMethods": false, + "exposeJsonSerializerSettings": false, + "clientClassAccessModifier": "public", + "typeAccessModifier": "public", + "generateContractsOutput": false, + "contractsNamespace": null, + "contractsOutputFilePath": null, + "parameterDateTimeFormat": "s", + "generateUpdateJsonSerializerSettingsMethod": true, + "serializeTypeInformation": false, + "queryNullValue": "", + "className": "{controller}Client", + "operationGenerationMode": "MultipleClientsFromOperationId", + "additionalNamespaceUsages": [], + "additionalContractNamespaceUsages": [], + "generateOptionalParameters": false, + "generateJsonMethods": true, + "enforceFlagEnums": false, + "parameterArrayType": "System.Collections.Generic.IEnumerable", + "parameterDictionaryType": "System.Collections.Generic.IDictionary", + "responseArrayType": "System.Collections.Generic.ICollection", + "responseDictionaryType": "System.Collections.Generic.IDictionary", + "wrapResponses": false, + "wrapResponseMethods": [], + "generateResponseClasses": true, + "responseClass": "SwaggerResponse", + "namespace": "IngeniBridge.TestServer.IngeniBridgeProxy", + "requiredPropertiesMustBeDefined": true, + "dateType": "System.DateTimeOffset", + "jsonConverters": null, + "dateTimeType": "System.DateTimeOffset", + "timeType": "System.TimeSpan", + "timeSpanType": "System.TimeSpan", + "arrayType": "System.Collections.Generic.ICollection", + "arrayInstanceType": "System.Collections.ObjectModel.Collection", + "dictionaryType": "System.Collections.Generic.IDictionary", + "dictionaryInstanceType": "System.Collections.Generic.Dictionary", + "arrayBaseType": "System.Collections.ObjectModel.Collection", + "dictionaryBaseType": "System.Collections.Generic.Dictionary", + "classStyle": "Poco", + "generateDefaultValues": true, + "generateDataAnnotations": true, + "excludedTypeNames": [], + "handleReferences": false, + "generateImmutableArrayProperties": false, + "generateImmutableDictionaryProperties": false, + "jsonSerializerSettingsTransformationMethod": null, + "inlineNamedDictionaries": false, + "inlineNamedTuples": true, + "templateDirectory": null, + "typeNameGeneratorType": null, + "propertyNameGeneratorType": null, + "enumNameGeneratorType": null, + "serviceHost": null, + "serviceSchemes": null, + "output": "IngeniBridgeProxyClient.Generated.cs" + } + } +} \ No newline at end of file diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag.json b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag.json new file mode 100644 index 0000000..841d30f --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxy.nswag.json @@ -0,0 +1,921 @@ +{ + "swagger": "2.0", + "info": { + "title": "IngeniBridge REST Api", + "version": "1.0" + }, + "host": "demo.ingenibridge.com", + "schemes": [ + "http" + ], + "paths": { + "/REQUESTER/RetrieveAssets": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the assets", + "operationId": "Requester_RetrieveAssets", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "array", + "name": "CorrelationCriteria", + "in": "query", + "description": "Correlation creteria containing [axis]=[value] or use ! for [different than]", + "collectionFormat": "multi", + "items": { + "type": "string" + } + }, + { + "type": "integer", + "name": "PageNumber", + "in": "query", + "description": "Page number starting from 0", + "format": "int32" + }, + { + "type": "integer", + "name": "PageSize", + "in": "query", + "description": "Page size", + "format": "int32" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "SnapshotDate", + "in": "query", + "description": "The snapshot date used to retrive the valid elements", + "format": "date-time" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ContextedAsset" + } + } + } + } + } + }, + "/REQUESTER/RetrieveAssetTypes": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the asset types", + "operationId": "Requester_RetrieveAssetTypes", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "/REQUESTER/RetrieveTimeSeries": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the time series", + "operationId": "Requester_RetrieveTimeSeries", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "array", + "name": "CorrelationCriteria", + "in": "query", + "description": "Correlation creteria containing [axis]=[value] or use ! for [different than]", + "collectionFormat": "multi", + "items": { + "type": "string" + } + }, + { + "type": "integer", + "name": "PageNumber", + "in": "query", + "description": "Page number starting from 0", + "format": "int32" + }, + { + "type": "integer", + "name": "PageSize", + "in": "query", + "description": "Page size", + "format": "int32" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "SnapshotDate", + "in": "query", + "description": "The snapshot date used to retrive the valid elements", + "format": "date-time" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ContextedTimeSeries" + } + } + } + } + } + }, + "/REQUESTER/RetrieveDatavizTimeSeries": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the timeseries", + "operationId": "Requester_RetrieveDatavizTimeSeries", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "SearchString", + "in": "query", + "required": true, + "description": "String search" + }, + { + "type": "integer", + "name": "PageSize", + "in": "query", + "description": "Page size", + "format": "int32" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/DatavizTimeSeries" + } + } + } + } + } + }, + "/REQUESTER/RetrieveEntityFromPath": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves an entity (asset or time series) using the path in tree (concatenate parents with backslashes)", + "operationId": "Requester_RetrieveEntityFromPath", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "PathInTree", + "in": "query", + "required": true, + "description": "Path in the tree" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ContextedAsset" + } + } + } + } + }, + "/REQUESTER/RetrieveTimeSeriesTypes": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the time series types", + "operationId": "Requester_RetrieveTimeSeriesTypes", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "/REQUESTER/RetrieveEntityFunctionalAxis": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves all the functional axis available to request a type of entity", + "operationId": "Requester_RetrieveEntityFunctionalAxis", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "EntityName", + "in": "query", + "required": true, + "description": "The entity type name" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "/REQUESTER/RetrieveEntityFunctionalAxisTree": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrive the whole functional axis in an inheritance tree", + "operationId": "Requester_RetrieveEntityFunctionalAxisTree", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionalAxisNode" + } + } + } + } + } + }, + "/REQUESTER/RetrieveEnumAvailableValues": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieve all values of an Enum type", + "operationId": "Requester_RetrieveEnumAvailableValues", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "EnumName", + "in": "query", + "required": true, + "description": "The Enum type name" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "/REQUESTER/RetrieveEnumAvailableTypes": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieve all the Enum types", + "operationId": "Requester_RetrieveEnumAvailableTypes", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "/REQUESTER/RetrieveMetaInformation": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves the full meta information about the model", + "operationId": "Requester_RetrieveMetaInformation", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityMetaDescription" + } + } + } + } + } + }, + "/REQUESTER/RetrieveNomenclature": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves nomenclature values", + "operationId": "Requester_RetrieveNomenclature", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "NomenclatureName", + "in": "query", + "required": true, + "description": "The nomenclature" + }, + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Nomenclature" + } + } + } + } + } + }, + "/REQUESTER/RetrieveNomenclatureTypes": { + "get": { + "tags": [ + "Requester" + ], + "summary": "Retrieves all the nomenclature types available", + "operationId": "Requester_RetrieveNomenclatureTypes", + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "type": "string", + "name": "CallingApplication", + "in": "query", + "description": "The calling application or null (if null then par application tracking is disabled)" + }, + { + "type": "string", + "name": "DBVersion", + "in": "query", + "description": "Database online version or nul if default" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "definitions": { + "Asset": { + "type": "object", + "properties": { + "TimeSeries": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeSeries" + } + }, + "Code": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "BeginValidity": { + "type": "string", + "format": "date-time" + }, + "EndValidity": { + "type": "string", + "format": "date-time" + }, + "HistoryTrackingCode": { + "type": "string", + "readOnly": true + }, + "StorageUniqueID": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "EntityKind": { + "type": "string", + "enum": [ + "TimeSeries", + "Asset", + "Nomenclature" + ], + "readOnly": true + } + } + }, + "TimeSeries": { + "type": "object", + "properties": { + "Description": { + "type": "string" + }, + "TimeSeriesExternalReference": { + "type": "string" + }, + "Code": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "BeginValidity": { + "type": "string", + "format": "date-time" + }, + "EndValidity": { + "type": "string", + "format": "date-time" + }, + "HistoryTrackingCode": { + "type": "string", + "readOnly": true + }, + "StorageUniqueID": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "EntityKind": { + "type": "string", + "enum": [ + "TimeSeries", + "Asset", + "Nomenclature" + ], + "readOnly": true + } + } + }, + "HistorizedAsset": { + "type": "object", + "properties": { + "Assets": { + "type": "array", + "items": { + "$ref": "#/definitions/ContextedAsset" + } + } + } + }, + "ContextedAsset": { + "type": "object", + "properties": { + "Parents": { + "type": "array", + "items": { + "$ref": "#/definitions/Asset" + } + }, + "Asset": { + "$ref": "#/definitions/Asset" + } + } + }, + "HistorizedTimeSeries": { + "type": "object", + "properties": { + "Datas": { + "type": "array", + "items": { + "$ref": "#/definitions/ContextedTimeSeries" + } + } + } + }, + "ContextedTimeSeries": { + "type": "object", + "properties": { + "Parents": { + "type": "array", + "items": { + "$ref": "#/definitions/Asset" + } + }, + "TimeSeries": { + "$ref": "#/definitions/TimeSeries" + } + } + }, + "Nomenclature": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "BeginValidity": { + "type": "string", + "format": "date-time" + }, + "EndValidity": { + "type": "string", + "format": "date-time" + }, + "HistoryTrackingCode": { + "type": "string", + "readOnly": true + }, + "StorageUniqueID": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "EntityKind": { + "type": "string", + "enum": [ + "TimeSeries", + "Asset", + "Nomenclature" + ], + "readOnly": true + } + } + }, + "DatavizTimeSeries": { + "type": "object", + "properties": { + "DatavizTimeSeriesDescription": { + "type": "string" + }, + "TimeSeriesExternalReference": { + "type": "string" + } + } + }, + "FunctionalAxisNode": { + "type": "object", + "properties": { + "Nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionalAxisNode" + } + }, + "EntityName": { + "type": "string" + }, + "Axis": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "EntityMetaDescription": { + "type": "object", + "properties": { + "BaseEntityType": { + "type": "string" + }, + "IsRoot": { + "type": "boolean" + }, + "EntityKind": { + "type": "string", + "enum": [ + "TimeSeries", + "Asset", + "Nomenclature" + ] + }, + "EntityType": { + "type": "string" + }, + "IsAbstract": { + "type": "boolean" + }, + "CodeProperty": { + "$ref": "#/definitions/AttributeMetaDescription" + }, + "LabelProperty": { + "$ref": "#/definitions/AttributeMetaDescription" + }, + "AllLinks": { + "type": "array", + "items": { + "$ref": "#/definitions/AttributeMetaDescription" + }, + "readOnly": true + }, + "EntityDisplayName": { + "type": "string" + }, + "EntityName": { + "type": "string", + "readOnly": true + } + } + }, + "AttributeMetaDescription": { + "type": "object", + "properties": { + "IsArray": { + "type": "boolean" + }, + "IsEnum": { + "type": "boolean" + }, + "IsReference": { + "type": "boolean" + }, + "IsExternalReference": { + "type": "boolean" + }, + "IsTimeSeries": { + "type": "boolean", + "readOnly": true + }, + "IsNomenclature": { + "type": "boolean" + }, + "IsDescriptionField": { + "type": "boolean", + "readOnly": true + }, + "IsExternalTimeSeriesReference": { + "type": "boolean", + "readOnly": true + }, + "DeclaringEntityType": { + "type": "string" + }, + "AttributeType": { + "type": "string" + }, + "AttributeName": { + "type": "string" + }, + "NameDesc": { + "type": "string" + }, + "NotToDisplay": { + "type": "boolean" + }, + "Unit": { + "type": "string" + }, + "IndexEntityAttribute": { + "$ref": "#/definitions/IndexEntityAttributeAttribute" + } + } + }, + "IndexEntityAttributeAttribute": { + "type": "object", + "properties": { + "AttributeName": { + "type": "string" + }, + "FunctionalAxisName": { + "type": "string" + }, + "TypeId": { + "type": "object", + "readOnly": true + } + } + } + } +} \ No newline at end of file diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxyClient.Generated.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxyClient.Generated.cs new file mode 100644 index 0000000..887dc52 --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Connected Services/IngeniBridgeProxy/IngeniBridgeProxyClient.Generated.cs @@ -0,0 +1,1806 @@ +//---------------------- +// +// Generated using the NSwag toolchain v12.0.15.0 (NJsonSchema v9.13.22.0 (Newtonsoft.Json v12.0.0.2)) (http://NSwag.org) +// +//---------------------- + +namespace IngeniBridge.TestServer.IngeniBridgeProxy +{ + #pragma warning disable + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.15.0 (NJsonSchema v9.13.22.0 (Newtonsoft.Json v12.0.0.2))")] + public partial class RequesterClient + { + private string _baseUrl = "http://demo.ingenibridge.com"; + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public RequesterClient(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(() => + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + }); + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// Retrieves the assets + /// Correlation creteria containing [axis]=[value] or use ! for [different than] + /// Page number starting from 0 + /// Page size + /// The calling application or null (if null then par application tracking is disabled) + /// The snapshot date used to retrive the valid elements + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveAssetsAsync(System.Collections.Generic.IEnumerable correlationCriteria, int? pageNumber, int? pageSize, string callingApplication, System.DateTimeOffset? snapshotDate, string dBVersion) + { + return RetrieveAssetsAsync(correlationCriteria, pageNumber, pageSize, callingApplication, snapshotDate, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the assets + /// Correlation creteria containing [axis]=[value] or use ! for [different than] + /// Page number starting from 0 + /// Page size + /// The calling application or null (if null then par application tracking is disabled) + /// The snapshot date used to retrive the valid elements + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveAssetsAsync(System.Collections.Generic.IEnumerable correlationCriteria, int? pageNumber, int? pageSize, string callingApplication, System.DateTimeOffset? snapshotDate, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveAssets?"); + if (correlationCriteria != null) + { + foreach (var item_ in correlationCriteria) { urlBuilder_.Append("CorrelationCriteria=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + } + if (pageNumber != null) + { + urlBuilder_.Append("PageNumber=").Append(System.Uri.EscapeDataString(ConvertToString(pageNumber, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (pageSize != null) + { + urlBuilder_.Append("PageSize=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (snapshotDate != null) + { + urlBuilder_.Append("SnapshotDate=").Append(System.Uri.EscapeDataString(snapshotDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves the asset types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveAssetTypesAsync(string callingApplication, string dBVersion) + { + return RetrieveAssetTypesAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the asset types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveAssetTypesAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveAssetTypes?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves the time series + /// Correlation creteria containing [axis]=[value] or use ! for [different than] + /// Page number starting from 0 + /// Page size + /// The calling application or null (if null then par application tracking is disabled) + /// The snapshot date used to retrive the valid elements + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveTimeSeriesAsync(System.Collections.Generic.IEnumerable correlationCriteria, int? pageNumber, int? pageSize, string callingApplication, System.DateTimeOffset? snapshotDate, string dBVersion) + { + return RetrieveTimeSeriesAsync(correlationCriteria, pageNumber, pageSize, callingApplication, snapshotDate, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the time series + /// Correlation creteria containing [axis]=[value] or use ! for [different than] + /// Page number starting from 0 + /// Page size + /// The calling application or null (if null then par application tracking is disabled) + /// The snapshot date used to retrive the valid elements + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveTimeSeriesAsync(System.Collections.Generic.IEnumerable correlationCriteria, int? pageNumber, int? pageSize, string callingApplication, System.DateTimeOffset? snapshotDate, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveTimeSeries?"); + if (correlationCriteria != null) + { + foreach (var item_ in correlationCriteria) { urlBuilder_.Append("CorrelationCriteria=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + } + if (pageNumber != null) + { + urlBuilder_.Append("PageNumber=").Append(System.Uri.EscapeDataString(ConvertToString(pageNumber, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (pageSize != null) + { + urlBuilder_.Append("PageSize=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (snapshotDate != null) + { + urlBuilder_.Append("SnapshotDate=").Append(System.Uri.EscapeDataString(snapshotDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves the timeseries + /// String search + /// Page size + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveDatavizTimeSeriesAsync(string searchString, int? pageSize, string dBVersion) + { + return RetrieveDatavizTimeSeriesAsync(searchString, pageSize, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the timeseries + /// String search + /// Page size + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveDatavizTimeSeriesAsync(string searchString, int? pageSize, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + if (searchString == null) + throw new System.ArgumentNullException("searchString"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveDatavizTimeSeries?"); + urlBuilder_.Append("SearchString=").Append(System.Uri.EscapeDataString(ConvertToString(searchString, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (pageSize != null) + { + urlBuilder_.Append("PageSize=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves an entity (asset or time series) using the path in tree (concatenate parents with backslashes) + /// Path in the tree + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task RetrieveEntityFromPathAsync(string pathInTree, string callingApplication, string dBVersion) + { + return RetrieveEntityFromPathAsync(pathInTree, callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves an entity (asset or time series) using the path in tree (concatenate parents with backslashes) + /// Path in the tree + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task RetrieveEntityFromPathAsync(string pathInTree, string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + if (pathInTree == null) + throw new System.ArgumentNullException("pathInTree"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveEntityFromPath?"); + urlBuilder_.Append("PathInTree=").Append(System.Uri.EscapeDataString(ConvertToString(pathInTree, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(ContextedAsset); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(ContextedAsset); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves the time series types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveTimeSeriesTypesAsync(string callingApplication, string dBVersion) + { + return RetrieveTimeSeriesTypesAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the time series types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveTimeSeriesTypesAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveTimeSeriesTypes?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves all the functional axis available to request a type of entity + /// The entity type name + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveEntityFunctionalAxisAsync(string entityName, string callingApplication, string dBVersion) + { + return RetrieveEntityFunctionalAxisAsync(entityName, callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves all the functional axis available to request a type of entity + /// The entity type name + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveEntityFunctionalAxisAsync(string entityName, string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + if (entityName == null) + throw new System.ArgumentNullException("entityName"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveEntityFunctionalAxis?"); + urlBuilder_.Append("EntityName=").Append(System.Uri.EscapeDataString(ConvertToString(entityName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrive the whole functional axis in an inheritance tree + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveEntityFunctionalAxisTreeAsync(string callingApplication, string dBVersion) + { + return RetrieveEntityFunctionalAxisTreeAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrive the whole functional axis in an inheritance tree + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveEntityFunctionalAxisTreeAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveEntityFunctionalAxisTree?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieve all values of an Enum type + /// The Enum type name + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveEnumAvailableValuesAsync(string enumName, string callingApplication, string dBVersion) + { + return RetrieveEnumAvailableValuesAsync(enumName, callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieve all values of an Enum type + /// The Enum type name + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveEnumAvailableValuesAsync(string enumName, string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + if (enumName == null) + throw new System.ArgumentNullException("enumName"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveEnumAvailableValues?"); + urlBuilder_.Append("EnumName=").Append(System.Uri.EscapeDataString(ConvertToString(enumName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieve all the Enum types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveEnumAvailableTypesAsync(string callingApplication, string dBVersion) + { + return RetrieveEnumAvailableTypesAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieve all the Enum types + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveEnumAvailableTypesAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveEnumAvailableTypes?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves the full meta information about the model + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveMetaInformationAsync(string callingApplication, string dBVersion) + { + return RetrieveMetaInformationAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves the full meta information about the model + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveMetaInformationAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveMetaInformation?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves nomenclature values + /// The nomenclature + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveNomenclatureAsync(string nomenclatureName, string callingApplication, string dBVersion) + { + return RetrieveNomenclatureAsync(nomenclatureName, callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves nomenclature values + /// The nomenclature + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveNomenclatureAsync(string nomenclatureName, string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + if (nomenclatureName == null) + throw new System.ArgumentNullException("nomenclatureName"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveNomenclature?"); + urlBuilder_.Append("NomenclatureName=").Append(System.Uri.EscapeDataString(ConvertToString(nomenclatureName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// Retrieves all the nomenclature types available + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + public System.Threading.Tasks.Task> RetrieveNomenclatureTypesAsync(string callingApplication, string dBVersion) + { + return RetrieveNomenclatureTypesAsync(callingApplication, dBVersion, System.Threading.CancellationToken.None); + } + + /// Retrieves all the nomenclature types available + /// The calling application or null (if null then par application tracking is disabled) + /// Database online version or nul if default + /// OK + /// A server side error occurred. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + public async System.Threading.Tasks.Task> RetrieveNomenclatureTypesAsync(string callingApplication, string dBVersion, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/REQUESTER/RetrieveNomenclatureTypes?"); + if (callingApplication != null) + { + urlBuilder_.Append("CallingApplication=").Append(System.Uri.EscapeDataString(ConvertToString(callingApplication, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dBVersion != null) + { + urlBuilder_.Append("DBVersion=").Append(System.Uri.EscapeDataString(ConvertToString(dBVersion, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(System.Collections.Generic.ICollection); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception_) + { + throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); + } + + return default(System.Collections.Generic.ICollection); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) + { + if (value is System.Enum) + { + string name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value; + } + } + } + } + else if (value is bool) { + return System.Convert.ToString(value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[]) value); + } + else if (value != null && value.GetType().IsArray) + { + var array = System.Linq.Enumerable.OfType((System.Array) value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + return System.Convert.ToString(value, cultureInfo); + } + } + + + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class Asset + { + [Newtonsoft.Json.JsonProperty("TimeSeries", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection TimeSeries { get; set; } + + [Newtonsoft.Json.JsonProperty("Code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Code { get; set; } + + [Newtonsoft.Json.JsonProperty("Label", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Label { get; set; } + + [Newtonsoft.Json.JsonProperty("BeginValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? BeginValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("EndValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? EndValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("HistoryTrackingCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string HistoryTrackingCode { get; set; } + + [Newtonsoft.Json.JsonProperty("StorageUniqueID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? StorageUniqueID { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityKind", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public AssetEntityKind? EntityKind { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static Asset FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class TimeSeries + { + [Newtonsoft.Json.JsonProperty("Description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Description { get; set; } + + [Newtonsoft.Json.JsonProperty("TimeSeriesExternalReference", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string TimeSeriesExternalReference { get; set; } + + [Newtonsoft.Json.JsonProperty("Code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Code { get; set; } + + [Newtonsoft.Json.JsonProperty("Label", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Label { get; set; } + + [Newtonsoft.Json.JsonProperty("BeginValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? BeginValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("EndValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? EndValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("HistoryTrackingCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string HistoryTrackingCode { get; set; } + + [Newtonsoft.Json.JsonProperty("StorageUniqueID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? StorageUniqueID { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityKind", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public TimeSeriesEntityKind? EntityKind { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static TimeSeries FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class HistorizedAsset + { + [Newtonsoft.Json.JsonProperty("Assets", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Assets { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static HistorizedAsset FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class ContextedAsset + { + [Newtonsoft.Json.JsonProperty("Parents", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Parents { get; set; } + + [Newtonsoft.Json.JsonProperty("Asset", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Asset Asset { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static ContextedAsset FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class HistorizedTimeSeries + { + [Newtonsoft.Json.JsonProperty("Datas", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Datas { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static HistorizedTimeSeries FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class ContextedTimeSeries + { + [Newtonsoft.Json.JsonProperty("Parents", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Parents { get; set; } + + [Newtonsoft.Json.JsonProperty("TimeSeries", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TimeSeries TimeSeries { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static ContextedTimeSeries FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class Nomenclature + { + [Newtonsoft.Json.JsonProperty("Code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Code { get; set; } + + [Newtonsoft.Json.JsonProperty("Label", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Label { get; set; } + + [Newtonsoft.Json.JsonProperty("BeginValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? BeginValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("EndValidity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset? EndValidity { get; set; } + + [Newtonsoft.Json.JsonProperty("HistoryTrackingCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string HistoryTrackingCode { get; set; } + + [Newtonsoft.Json.JsonProperty("StorageUniqueID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? StorageUniqueID { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityKind", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public NomenclatureEntityKind? EntityKind { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static Nomenclature FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class DatavizTimeSeries + { + [Newtonsoft.Json.JsonProperty("DatavizTimeSeriesDescription", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string DatavizTimeSeriesDescription { get; set; } + + [Newtonsoft.Json.JsonProperty("TimeSeriesExternalReference", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string TimeSeriesExternalReference { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static DatavizTimeSeries FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class FunctionalAxisNode + { + [Newtonsoft.Json.JsonProperty("Nodes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Nodes { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string EntityName { get; set; } + + [Newtonsoft.Json.JsonProperty("Axis", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Axis { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static FunctionalAxisNode FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class EntityMetaDescription + { + [Newtonsoft.Json.JsonProperty("BaseEntityType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string BaseEntityType { get; set; } + + [Newtonsoft.Json.JsonProperty("IsRoot", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsRoot { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityKind", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public EntityMetaDescriptionEntityKind? EntityKind { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string EntityType { get; set; } + + [Newtonsoft.Json.JsonProperty("IsAbstract", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsAbstract { get; set; } + + [Newtonsoft.Json.JsonProperty("CodeProperty", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AttributeMetaDescription CodeProperty { get; set; } + + [Newtonsoft.Json.JsonProperty("LabelProperty", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AttributeMetaDescription LabelProperty { get; set; } + + [Newtonsoft.Json.JsonProperty("AllLinks", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection AllLinks { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityDisplayName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string EntityDisplayName { get; set; } + + [Newtonsoft.Json.JsonProperty("EntityName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string EntityName { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static EntityMetaDescription FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class AttributeMetaDescription + { + [Newtonsoft.Json.JsonProperty("IsArray", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsArray { get; set; } + + [Newtonsoft.Json.JsonProperty("IsEnum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsEnum { get; set; } + + [Newtonsoft.Json.JsonProperty("IsReference", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsReference { get; set; } + + [Newtonsoft.Json.JsonProperty("IsExternalReference", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsExternalReference { get; set; } + + [Newtonsoft.Json.JsonProperty("IsTimeSeries", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsTimeSeries { get; set; } + + [Newtonsoft.Json.JsonProperty("IsNomenclature", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsNomenclature { get; set; } + + [Newtonsoft.Json.JsonProperty("IsDescriptionField", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsDescriptionField { get; set; } + + [Newtonsoft.Json.JsonProperty("IsExternalTimeSeriesReference", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? IsExternalTimeSeriesReference { get; set; } + + [Newtonsoft.Json.JsonProperty("DeclaringEntityType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string DeclaringEntityType { get; set; } + + [Newtonsoft.Json.JsonProperty("AttributeType", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string AttributeType { get; set; } + + [Newtonsoft.Json.JsonProperty("AttributeName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string AttributeName { get; set; } + + [Newtonsoft.Json.JsonProperty("NameDesc", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string NameDesc { get; set; } + + [Newtonsoft.Json.JsonProperty("NotToDisplay", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? NotToDisplay { get; set; } + + [Newtonsoft.Json.JsonProperty("Unit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Unit { get; set; } + + [Newtonsoft.Json.JsonProperty("IndexEntityAttribute", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public IndexEntityAttributeAttribute IndexEntityAttribute { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static AttributeMetaDescription FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public partial class IndexEntityAttributeAttribute + { + [Newtonsoft.Json.JsonProperty("AttributeName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string AttributeName { get; set; } + + [Newtonsoft.Json.JsonProperty("FunctionalAxisName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string FunctionalAxisName { get; set; } + + [Newtonsoft.Json.JsonProperty("TypeId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public object TypeId { get; set; } + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static IndexEntityAttributeAttribute FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public enum AssetEntityKind + { + [System.Runtime.Serialization.EnumMember(Value = @"TimeSeries")] + TimeSeries = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Asset")] + Asset = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Nomenclature")] + Nomenclature = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public enum TimeSeriesEntityKind + { + [System.Runtime.Serialization.EnumMember(Value = @"TimeSeries")] + TimeSeries = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Asset")] + Asset = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Nomenclature")] + Nomenclature = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public enum NomenclatureEntityKind + { + [System.Runtime.Serialization.EnumMember(Value = @"TimeSeries")] + TimeSeries = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Asset")] + Asset = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Nomenclature")] + Nomenclature = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.22.0 (Newtonsoft.Json v12.0.0.2)")] + public enum EntityMetaDescriptionEntityKind + { + [System.Runtime.Serialization.EnumMember(Value = @"TimeSeries")] + TimeSeries = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Asset")] + Asset = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Nomenclature")] + Nomenclature = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.15.0 (NJsonSchema v9.13.22.0 (Newtonsoft.Json v12.0.0.2))")] + public partial class SwaggerException : System.Exception + { + public int StatusCode { get; private set; } + + public string Response { get; private set; } + + public System.Collections.Generic.Dictionary> Headers { get; private set; } + + public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary> headers, System.Exception innerException) + : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException) + { + StatusCode = statusCode; + Response = response; + Headers = headers; + } + + public override string ToString() + { + return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.15.0 (NJsonSchema v9.13.22.0 (Newtonsoft.Json v12.0.0.2))")] + public partial class SwaggerException : SwaggerException + { + public TResult Result { get; private set; } + + public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary> headers, TResult result, System.Exception innerException) + : base(message, statusCode, response, headers, innerException) + { + Result = result; + } + } + + #pragma warning restore +} \ No newline at end of file diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/CorrelationInfluenceZone.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/CorrelationInfluenceZone.cs index 9a4743d..fc32921 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/CorrelationInfluenceZone.cs +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/CorrelationInfluenceZone.cs @@ -18,15 +18,18 @@ using System.Text; using System.Threading.Tasks; -namespace IngeniBridge.Server.TestServer +namespace IngeniBridge.TestServer { public class CorrelationInfluenceZone { - public static void Launch ( HttpClient client, string buf ) + public static void Launch ( HttpClient client ) { Program.log.Info ( "CorrelationInfluenceZoneBusinessUseCase ==============================" ); - Task response = client.GetAsync ( Program.url + "/DataModel" ); - byte [ ] buffer = response.Result.Content.ReadAsByteArrayAsync ().Result; + // here find data from Historian reference EXTREF 004, the acquisistion platform detected an exceeding threshold, now we must correlate this alarm with an existing alarm + Task response = client.GetAsync ( Program.url + "/REQUESTER/RetrieveTimeSeries?CorrelationCriteria=TimeSeries.TimeSeriesExternalReference=EXTREF 004&PageNumber=0&PageSize=10&CallingApplication=IngeniBridge.TestServer" ); + string buf = response.Result.Content.ReadAsStringAsync ().Result; + response = client.GetAsync ( Program.url + "/DataModel" ); + byte [] buffer = response.Result.Content.ReadAsByteArrayAsync ().Result; Assembly DataModelAssembly = IngeniBridge.Core.Storage.StorageAccessor.RebuildDataModel ( buffer ); MetaHelper helper = new MetaHelper ( DataModelAssembly ); EntityContentHelper contenthelper = new EntityContentHelper ( helper ); diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer.csproj b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer.csproj index 8b89e7a..8c57198 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer.csproj +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer.csproj @@ -12,10 +12,10 @@ - + - - + + @@ -27,13 +27,17 @@ + + + + NETCORE;NETSTANDARD;NETSTANDARD2_0 - - + + diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodMapping.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodMapping.cs index fc37c69..99c9699 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodMapping.cs +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodMapping.cs @@ -18,15 +18,17 @@ using System.Text; using System.Threading.Tasks; -namespace IngeniBridge.Server.TestServer +namespace IngeniBridge.TestServer { public class MethodMapping { - public static void Launch ( HttpClient client, string buf ) + public static void Launch ( HttpClient client ) { Program.log.Info ( "MethodMapping ==============================" ); - Task response = client.GetAsync ( Program.url + "/DataModel" ); - byte [ ] buffer = response.Result.Content.ReadAsByteArrayAsync ().Result; + Task response = client.GetAsync ( Program.url + "/REQUESTER/RetrieveTimeSeries?PageNumber=0&PageSize=2&CallingApplication=IngeniBridge.TestServer" ); // here find all datas + string buf = response.Result.Content.ReadAsStringAsync ().Result; + response = client.GetAsync ( Program.url + "/DataModel" ); + byte [] buffer = response.Result.Content.ReadAsByteArrayAsync ().Result; Assembly DataModelAssembly = Core.Storage.StorageAccessor.RebuildDataModel ( buffer ); MetaHelper helper = new MetaHelper ( DataModelAssembly ); EntityContentHelper contenthelper = new EntityContentHelper ( helper ); diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRest.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRest.cs index 79a2a6e..e789073 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRest.cs +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRest.cs @@ -18,13 +18,15 @@ using System.Text; using System.Threading.Tasks; -namespace IngeniBridge.Server.TestServer +namespace IngeniBridge.TestServer { public class MethodRest { - public static void Launch ( HttpClient client, string buf ) + public static void Launch ( HttpClient client ) { Program.log.Info ( "MethodREST ==============================" ); + Task response = client.GetAsync ( Program.url + "/REQUESTER/RetrieveTimeSeries?PageNumber=0&PageSize=2&CallingApplication=IngeniBridge.TestServer" ); // here find all datas + string buf = response.Result.Content.ReadAsStringAsync ().Result; JArray jsonRoot = ( JArray ) JsonConvert.DeserializeObject ( buf ); if ( jsonRoot.Children ().Count () == 0 ) Console.WriteLine ( "last page reached" ); jsonRoot.Children ().All ( contexteddata => diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRestProxy.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRestProxy.cs new file mode 100644 index 0000000..b25ac26 --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/MethodRestProxy.cs @@ -0,0 +1,51 @@ +using IngeniBridge.Core; +using IngeniBridge.Core.MetaHelper; +using IngeniBridge.Core.Mining; +using IngeniBridge.Core.Serialization; +using IngeniBridge.Core.Service; +using IngeniBridge.Core.StagingData; +using IngeniBridge.Core.Storage; +using log4net; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace IngeniBridge.TestServer +{ + public class MethodRestProxy + { + public static void Launch ( HttpClient client ) + { + Program.log.Info ( "MethodRESTProxy ==============================" ); + IngeniBridgeProxy.RequesterClient proxy = new IngeniBridgeProxy.RequesterClient ( client ); + Task< ICollection > response = proxy.RetrieveTimeSeriesAsync ( null, 0, 10, "IngeniBridge.TestServer", null, null ); + ICollection ctss = response.Result; + foreach (IngeniBridgeProxy.ContextedTimeSeries cts in ctss ) + { + StringBuilder path = new StringBuilder(); + foreach ( IngeniBridgeProxy.Asset a in cts.Parents ) + { + path.Append( a.Code + "\\"); + } + Console.Write("Path => " + path + "\n"); + Console.Write("Type => " + cts.TimeSeries.GetType () .Name + "\n"); + Console.Write("Code => " + cts.TimeSeries.Code + "\n"); + PropertyInfo[] pis = cts.TimeSeries.GetType().GetProperties(); + pis.All( pi => + { + Console.WriteLine( "\t" + pi.Name + " => " + pi.GetValue ( cts.TimeSeries, null ) + "\n" ); + return ( true ); + }); + + } + } + } +} diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/NodeInfo.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/NodeInfo.cs index 7ff8bd0..c4fc195 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/NodeInfo.cs +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/NodeInfo.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace IngeniBridge.Server.TestServer +namespace IngeniBridge.TestServer { public class NodeInfo { diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Program.cs b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Program.cs index c5e491c..7aeff8c 100644 --- a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Program.cs +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/Program.cs @@ -20,7 +20,7 @@ using System.Text; using System.Threading.Tasks; -namespace IngeniBridge.Server.TestServer +namespace IngeniBridge.TestServer { class Program { @@ -52,14 +52,10 @@ static int Main ( string [] args ) //var byteArray = Encoding.ASCII.GetBytes ( login + ":" + password ); //client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue ( "Basic", Convert.ToBase64String ( byteArray ) ); Program.log.Info ( "Connecting => " + Program.url ); - Task response = client.GetAsync ( Program.url + "/REQUESTER/RetrieveTimeSeries?PageNumber=0&PageSize=2&CallingApplication=IngeniBridge.TestServer" ); // here find all datas - string buf = response.Result.Content.ReadAsStringAsync ().Result; - MethodRest.Launch ( client, buf ); - MethodMapping.Launch ( client, buf ); - // here find data from Historian reference EXTREF 004, the acquisistion platform detected an exceeding threshold, now we must correlate this alarm with an existing alarm - response = client.GetAsync ( Program.url + "/REQUESTER/RetrieveTimeSeries?CorrelationCriteria=TimeSeries.TimeSeriesExternalReference=EXTREF 004&PageNumber=0&PageSize=10&CallingApplication=IngeniBridge.TestServer" ); - buf = response.Result.Content.ReadAsStringAsync ().Result; - CorrelationInfluenceZone.Launch ( client, buf ); + MethodRest.Launch ( client ); + MethodRestProxy.Launch ( client ); + MethodMapping.Launch ( client ); + CorrelationInfluenceZone.Launch ( client ); } catch ( Exception e ) { diff --git a/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/restapiproxy.txt b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/restapiproxy.txt new file mode 100644 index 0000000..a01fd68 --- /dev/null +++ b/IngeniBridge.TestServer/IngeniBridge.TestServer/IngeniBridge.TestServer/restapiproxy.txt @@ -0,0 +1,5 @@ +To generate the REST API: + +use vs 2019 extension => https://marketplace.visualstudio.com/items?itemName=dmitry-pavlov.OpenAPIConnectedService + +generate from IngeniBridge openapi endpoint => http://demo.ingenibridge.com/swagger/docs/1.0 \ No newline at end of file