Skip to content

Commit

Permalink
Made changes in preparation of Release v6.0.5
Browse files Browse the repository at this point in the history
Updated a few nuget packages.
Removed unnecessary code.
  • Loading branch information
Federico Artioli committed Oct 11, 2024
1 parent b970dcf commit 9085094
Show file tree
Hide file tree
Showing 108 changed files with 1,391 additions and 1,540 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.5] - 2024-10-11
### Changed
- Fixed the issue of trend samples (property names has been changed in the sample object).
- Fixed issue in the method 'GetObjects()' when it used depths > 1.
- Made changes to use ActivityId for activities, audits, and alarms.
- Made changes to use ObjectId for object Ids instead of Guid in ServiceClient.
- Enabled the use of docfx to generate a static site for the documentation.

## [6.0.4] - 2024-07-25
### Changed
- Fixed issue related to the method 'GetObjects()' (specifically related to the attribute 'Classification')
Expand Down
2 changes: 1 addition & 1 deletion MetasysServices.Tests/ActivityIdTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using NUnit.Framework;
using System;

namespace JohnsonControls.Metasys.BasicServices;

Expand Down
2 changes: 1 addition & 1 deletion MetasysServices.Tests/MetasysObjectTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using System.Linq;

namespace JohnsonControls.Metasys.BasicServices;

Expand Down
8 changes: 4 additions & 4 deletions MetasysServices.Tests/MetasysServices.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<IsPackable>false</IsPackable>

<Version>6.0.4</Version>
<Version>6.0.5</Version>

<Copyright>© 2020-2024 Johnson Controls</Copyright>

Expand All @@ -15,12 +15,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion MetasysServices.Tests/ObjectIdTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using NUnit.Framework;
using System;

namespace JohnsonControls.Metasys.BasicServices;

Expand Down
3 changes: 0 additions & 3 deletions MetasysServices/Activities/Activity.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
3 changes: 0 additions & 3 deletions MetasysServices/Activities/ActivityAlarm.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
3 changes: 0 additions & 3 deletions MetasysServices/Activities/ActivityAudit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
7 changes: 1 addition & 6 deletions MetasysServices/Activities/ActivityServiceProvider.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using Flurl;
using Flurl.Http;
using JohnsonControls.Metasys.BasicServices.Utils;
using log4net.Config;
using Newtonsoft.Json;
using Flurl.Http;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Activities/IActivityService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Flurl.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
4 changes: 0 additions & 4 deletions MetasysServices/Alarms/Alarm.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
1 change: 0 additions & 1 deletion MetasysServices/Alarms/AlarmAnnotation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json;
using System;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Alarms/AlarmFilter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Filters to get alarms when using API v2 or v3.
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Alarms/AlarmFilterV4Plus.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Filters to get activity items from API v4 on.
Expand Down
1 change: 0 additions & 1 deletion MetasysServices/Alarms/AlarmServiceProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Flurl;
using Flurl.Http;
using JohnsonControls.Metasys.BasicServices.Utils;
using log4net.Config;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
Expand Down
4 changes: 1 addition & 3 deletions MetasysServices/Alarms/IAlarmService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Flurl.Http;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
4 changes: 0 additions & 4 deletions MetasysServices/Audits/Audit.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
3 changes: 0 additions & 3 deletions MetasysServices/Audits/AuditAnnotation.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;


namespace JohnsonControls.Metasys.BasicServices
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Audits/AuditFilter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Filters to get audits
Expand Down
5 changes: 0 additions & 5 deletions MetasysServices/Audits/AuditServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Resources;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Audits/AuditSignature.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// DTO for the AuditSignature model.
Expand Down
5 changes: 1 addition & 4 deletions MetasysServices/Audits/IAuditService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Flurl.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Audits/LegacyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{

/// <summary>
Expand Down
16 changes: 5 additions & 11 deletions MetasysServices/BasicServiceProvider.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
using Flurl;
using Flurl.Http;
using JohnsonControls.Metasys.BasicServices;
using JohnsonControls.Metasys.BasicServices.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Resources;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down Expand Up @@ -174,12 +169,12 @@ protected List<NetworkDevice> ToNetworkDevice(List<JToken> items, ApiVersion ver
/// <param name="id"></param>
/// <param name="parameters"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException">If <see cref="Vers"/> is less than <see cref="ApiVersion.v4"/></exception>
/// <exception cref="InvalidOperationException">If <see cref="Version"/> is less than <see cref="ApiVersion.v4"/></exception>
/// <returns>
/// If <paramref name="id"/> is specified then this method returns the children of the specified object (and any of their children if level > 1).
/// If <c>id</c> is <c>null</c> then this method returns the root object (and it's children; unless level is 0).
/// </returns>
protected async Task<List<MetasysObject>> GetObjectsAsync(Guid? id, Dictionary<string, string> parameters = null)
protected async Task<List<MetasysObject>> GetObjectsAsync(ObjectId? id, Dictionary<string, string> parameters = null)
{
if (Version <= ApiVersion.v3)
{
Expand Down Expand Up @@ -215,7 +210,7 @@ protected async Task<List<MetasysObject>> GetObjectsAsync(Guid? id, Dictionary<s
/// <param name="levels">The number of levels to retrieve children.</param>
/// <exception cref="MetasysHttpException"></exception>
/// <exception cref="MetasysHttpParsingException"></exception>
protected async Task<List<TreeObject>> GetObjectChildrenAsync(Object id, Dictionary<string, string> parameters = null, int levels = 1)
protected async Task<List<TreeObject>> GetObjectChildrenAsync(ObjectId id, Dictionary<string, string> parameters = null, int levels = 1)
{
if (Version > ApiVersion.v3)
{
Expand Down Expand Up @@ -698,8 +693,7 @@ public static Dictionary<string, string> ToDictionary(object obj)
var json = JsonConvert.SerializeObject(obj);
var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
// Check and in case removes some items not allowed for a specific request
String activityType;
if (dictionary.TryGetValue("ActivityType", out activityType))
if (dictionary.TryGetValue("ActivityType", out string activityType))
{
if (activityType == "audit")
{
Expand Down Expand Up @@ -771,7 +765,7 @@ protected async Task<JToken> PostBatchRequestAsync(string endpoint, IEnumerable<
// Concatenate batch segment to use batch request and prepare the list of requests
foreach (var r in requests)
{
Url relativeUrl = new Url(r.ObjectId.ToString());
Url relativeUrl = new(r.ObjectId.ToString());
relativeUrl.AppendPathSegments(paths); // e.g. "00000000-0000-0000-0000-000000000001/annotations"

object body;
Expand Down
6 changes: 0 additions & 6 deletions MetasysServices/Enumerations/EnumerationServiceProvider.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using Flurl;
using Flurl.Http;
using JohnsonControls.Metasys.BasicServices.Utils;
using log4net.Config;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;


Expand Down
4 changes: 1 addition & 3 deletions MetasysServices/Enumerations/IEnumerationService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using JohnsonControls.Metasys.BasicServices;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;

namespace JohnsonControls.Metasys.BasicServices
Expand Down
2 changes: 0 additions & 2 deletions MetasysServices/Enums/ActionTypeEnum .cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
5 changes: 1 addition & 4 deletions MetasysServices/Enums/ActivityManagementStatusEnum.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.ComponentModel;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
7 changes: 1 addition & 6 deletions MetasysServices/Enums/AttributeEnumSet.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Enumeration of possible Attributes (typically for Trended Samples).
Expand Down
2 changes: 0 additions & 2 deletions MetasysServices/Enums/ClassLevelsEnum.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Enums/MetasysObjectTypeEnum.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Collection of Metasys Object Types.
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Enums/NetworkDeviceClassificationEnum.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices.Enums
namespace JohnsonControls.Metasys.BasicServices.Enums
{
/// <summary>
/// Network Devices Classification Enumeration.
Expand Down
6 changes: 1 addition & 5 deletions MetasysServices/Enums/NetworkDeviceTypeEnum.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
namespace JohnsonControls.Metasys.BasicServices
{
/// <summary>
/// Enumeration of possible Network Device Type.
Expand Down
2 changes: 0 additions & 2 deletions MetasysServices/Enums/OriginApplicationsEnum.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace JohnsonControls.Metasys.BasicServices
{
Expand Down
Loading

0 comments on commit 9085094

Please sign in to comment.