Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Samples update #9

Merged
merged 5 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ dotnet_diagnostic.CA5382.severity = none
dotnet_diagnostic.CA5383.severity = none
# CA5384: Do Not Use Digital Signature Algorithm (DSA)
dotnet_diagnostic.CA5384.severity = error
# CA5385: Use RivestShamirAdleman (RSA) Algorithm With Sufficient Key Size
# CA5385: Use RivestShamirAdleman (RSA) Algorithm With Sufficient Key Size
dotnet_diagnostic.CA5385.severity = error
# CA5386: Avoid hardcoding SecurityProtocolType value
dotnet_diagnostic.CA5386.severity = none
Expand Down Expand Up @@ -1087,13 +1087,16 @@ quote_type = single
# demonstration code should use explicit types for improved readability
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:suggestion
csharp_style_var_elsewhere = false:silent
csharp_style_var_elsewhere = false:silent

# CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
dotnet_diagnostic.CS8618.severity = none

# VSSpell001: Spell Check
dotnet_diagnostic.VSSpell001.severity = none

# CS8602: Dereference of a possibly null reference.
dotnet_diagnostic.CS8602.severity = none
# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = none

# CS8604: Possible null reference argument.
dotnet_diagnostic.CS8604.severity = none
12 changes: 12 additions & 0 deletions StreamingUpdatesRestApi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreamingUpdatesRestApi", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreamingUpdatesRestApiTest", "StreamingUpdatesRestApiTest\StreamingUpdatesRestApiTest.csproj", "{AD658F0D-233B-4256-AB78-5F1D902F70CC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8157E0FE-12B6-4A91-BF89-EA7084C10572}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
azure-pipelines.yml = azure-pipelines.yml
CODEOWNERS = CODEOWNERS
Directory.Build.props = Directory.Build.props
HISTORY.md = HISTORY.md
polaris.yml = polaris.yml
README.md = README.md
stylecop.json = stylecop.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
7 changes: 0 additions & 7 deletions StreamingUpdatesRestApi/DataUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@ public class DataUpdate
{
public IEnumerable<Update> Data { get; set; }
}

public class Update
{
public string ResourceId { get; set; }
public string Operation { get; set; }
public IEnumerable<SdsSimpleType> Events { get; set; }
}
}
13 changes: 13 additions & 0 deletions StreamingUpdatesRestApi/PressureTemperatureData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using OSIsoft.Data;

namespace StreamingUpdatesRestApi
{
public class PressureTemperatureData
{
[SdsMember(IsKey = true)]
public DateTime Timestamp { get; set; }

public double Pressure { get; set; }
public double Temperature { get; set; }
}
}
130 changes: 84 additions & 46 deletions StreamingUpdatesRestApi/Program.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion StreamingUpdatesRestApi/SdsSimpleType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace StreamingUpdatesRestApi
public class SdsSimpleType
{
[SdsMember(IsKey = true)]
public DateTimeOffset Time { get; set; }
public DateTime Timestamp { get; set; }

public double Value { get; set; }
}
Expand Down
6 changes: 3 additions & 3 deletions StreamingUpdatesRestApi/Signup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class Signup

public ResourceType Type { get; set; }

public DateTimeOffset CreatedDate { get; set; }
public DateTimeOffset CreatedDate { get; set; }

public DateTimeOffset ModifiedDate { get; set; }

avv-nkrisa marked this conversation as resolved.
Show resolved Hide resolved
public string SignupState { get; set; }
public SignupState SignupState { get; set; }
}
}
}
14 changes: 14 additions & 0 deletions StreamingUpdatesRestApi/SignupState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Text.Json.Serialization;

namespace StreamingUpdatesRestApi
{
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum SignupState
{
Activating = 0,

Active = 1,

Expired = 2,
}
}
16 changes: 8 additions & 8 deletions StreamingUpdatesRestApi/StreamingUpdatesRestApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
</PropertyGroup>

<ItemGroup>
<Compile Remove="SignupInput.cs" />
</ItemGroup>

<ItemGroup>
<None Remove="NewFile1.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="OSIsoft.OCSClients" Version="6.2.0-prerelease-20230530.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions StreamingUpdatesRestApi/Update.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace StreamingUpdatesRestApi
{
public class Update
{
public string ResourceId { get; set; }
public string Operation { get; set; }
public IEnumerable<SdsSimpleType> Events { get; set; }
}
}
3 changes: 2 additions & 1 deletion StreamingUpdatesRestApi/appsettings.placeholder.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"TenantId": "PLACEHOLDER_REPLACE_WITH_TENANT_ID",
"Resource": "https://uswe.datahub.connect.aveva.com",
"ClientId": "PLACEHOLDER_REPLACE_WITH_CLIENT_ID",
"ClientSecret": "PLACEHOLDER_REPLACE_WITH_CLIENT_SECRET"
"ClientSecret": "PLACEHOLDER_REPLACE_WITH_CLIENT_SECRET",
"ApiVersion": "v1-preview"
}