Skip to content

Commit

Permalink
Updated dependencies and also moved new changes in regards to OpenAPI…
Browse files Browse the repository at this point in the history
… evolution.
  • Loading branch information
joerghartmann authored Oct 29, 2024
1 parent 3f0fea5 commit 60f52ff
Show file tree
Hide file tree
Showing 96 changed files with 1,983 additions and 444 deletions.
4 changes: 2 additions & 2 deletions Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions Client/Com/Cumulocity/Client/Api/AlarmsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public AlarmsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<AlarmCollection<TAlarm>?> GetAlarms<TAlarm>(System.DateTime? createdFrom = null, System.DateTime? createdTo = null, int? currentPage = null, System.DateTime? dateFrom = null, System.DateTime? dateTo = null, System.DateTime? lastUpdatedFrom = null, System.DateTime? lastUpdatedTo = null, int? pageSize = null, bool? resolved = null, List<string>? severity = null, string? source = null, List<string>? status = null, List<string>? type = null, bool? withSourceAssets = null, bool? withSourceDevices = null, bool? withTotalElements = null, bool? withTotalPages = null, CancellationToken cToken = default) where TAlarm : Alarm
{
const string resourcePath = "/alarm/alarms";
const string resourcePath = $"alarm/alarms";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("createdFrom", createdFrom);
Expand Down Expand Up @@ -86,7 +86,7 @@ public AlarmsApi(HttpClient httpClient)
jsonNode?.RemoveFromNode("text");
jsonNode?.RemoveFromNode("time");
jsonNode?.RemoveFromNode("type");
const string resourcePath = "/alarm/alarms";
const string resourcePath = $"alarm/alarms";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("createdFrom", createdFrom);
Expand Down Expand Up @@ -125,7 +125,7 @@ public AlarmsApi(HttpClient httpClient)
jsonNode?.RemoveFromNode("self");
jsonNode?.RemoveFromNode("id");
jsonNode?.RemoveFromNode("source", "self");
const string resourcePath = "/alarm/alarms";
const string resourcePath = $"alarm/alarms";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -145,7 +145,7 @@ public AlarmsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<string?> DeleteAlarms(string? xCumulocityProcessingMode = null, System.DateTime? createdFrom = null, System.DateTime? createdTo = null, System.DateTime? dateFrom = null, System.DateTime? dateTo = null, bool? resolved = null, List<string>? severity = null, string? source = null, List<string>? status = null, List<string>? type = null, bool? withSourceAssets = null, bool? withSourceDevices = null, CancellationToken cToken = default)
{
const string resourcePath = "/alarm/alarms";
const string resourcePath = $"alarm/alarms";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("createdFrom", createdFrom);
Expand Down Expand Up @@ -175,7 +175,7 @@ public AlarmsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<TAlarm?> GetAlarm<TAlarm>(string id, CancellationToken cToken = default) where TAlarm : Alarm
{
string resourcePath = $"/alarm/alarms/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
string resourcePath = $"alarm/alarms/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -202,7 +202,7 @@ public AlarmsApi(HttpClient httpClient)
jsonNode?.RemoveFromNode("source");
jsonNode?.RemoveFromNode("time");
jsonNode?.RemoveFromNode("type");
string resourcePath = $"/alarm/alarms/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
string resourcePath = $"alarm/alarms/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -222,7 +222,7 @@ public AlarmsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<int> GetNumberOfAlarms(System.DateTime? dateFrom = null, System.DateTime? dateTo = null, bool? resolved = null, List<string>? severity = null, string? source = null, List<string>? status = null, List<string>? type = null, bool? withSourceAssets = null, bool? withSourceDevices = null, CancellationToken cToken = default)
{
const string resourcePath = "/alarm/alarms/count";
const string resourcePath = $"alarm/alarms/count";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("dateFrom", dateFrom);
Expand Down
8 changes: 4 additions & 4 deletions Client/Com/Cumulocity/Client/Api/ApplicationBinariesApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ApplicationBinariesApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationBinaries?> GetApplicationAttachments(string id, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -54,7 +54,7 @@ public ApplicationBinariesApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<Application?> UploadApplicationAttachment(byte[] file, string id, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var requestContent = new MultipartFormDataContent();
var fileContentFile = new ByteArrayContent(file);
Expand All @@ -77,7 +77,7 @@ public ApplicationBinariesApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<string?> GetApplicationAttachment(string id, string binaryId, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries/{HttpUtility.UrlPathEncode(binaryId.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries/{HttpUtility.UrlPathEncode(binaryId.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -93,7 +93,7 @@ public ApplicationBinariesApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<string?> DeleteApplicationAttachment(string id, string binaryId, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries/{HttpUtility.UrlPathEncode(binaryId.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/binaries/{HttpUtility.UrlPathEncode(binaryId.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand Down
10 changes: 5 additions & 5 deletions Client/Com/Cumulocity/Client/Api/ApplicationVersionsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ApplicationVersionsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationVersion?> GetApplicationVersion(string id, string? version = null, string? tag = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions?version=1.0";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions?version=1.0";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("version", version);
Expand All @@ -58,7 +58,7 @@ public ApplicationVersionsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationVersionCollection?> GetApplicationVersions(string id, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -75,7 +75,7 @@ public ApplicationVersionsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationVersion?> CreateApplicationVersion(byte[] applicationBinary, string applicationVersion, string id, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var requestContent = new MultipartFormDataContent();
var fileContentApplicationBinary = new ByteArrayContent(applicationBinary);
Expand All @@ -101,7 +101,7 @@ public ApplicationVersionsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<string?> DeleteApplicationVersion(string id, string? version = null, string? tag = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("version", version);
Expand All @@ -122,7 +122,7 @@ public ApplicationVersionsApi(HttpClient httpClient)
public async Task<ApplicationVersion?> UpdateApplicationVersion(ApplicationVersionTag body, string id, string version, CancellationToken cToken = default)
{
var jsonNode = body.ToJsonNode<ApplicationVersionTag>();
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions/{HttpUtility.UrlPathEncode(version.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/versions/{HttpUtility.UrlPathEncode(version.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand Down
22 changes: 11 additions & 11 deletions Client/Com/Cumulocity/Client/Api/ApplicationsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Client.Com.Cumulocity.Client.Api;
/// API methods to retrieve, create, update and delete applications. <br />
/// ### Application names <br />
/// For each tenant, Cumulocity IoT manages the subscribed applications and provides a number of applications of various types.In case you want to subscribe a tenant to an application using an API, you must use the application name in the argument (as name). <br />
/// Refer to the tables in <see href="https://cumulocity.com/guides/users-guide/administration#managing-applications" langword="Administration > Managing applications" /> in the User guide for the respective application name to be used. <br />
/// Refer to the tables in <see href="https://cumulocity.com/docs/standard-tenant/ecosystem/#managing-applications" langword="Platform administration > Standard tenant administration > Managing the ecosystem > Managing applications" /> in the Cumulocity IoT user documentation for the respective application name to be used. <br />
/// ⓘ Info: The Accept header should be provided in all POST/PUT requests, otherwise an empty response body will be returned. <br />
/// </summary>
///
Expand All @@ -41,7 +41,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationCollection?> GetApplications(int? currentPage = null, string? name = null, string? owner = null, int? pageSize = null, string? providedFor = null, string? subscriber = null, string? tenant = null, string? type = null, string? user = null, bool? withTotalElements = null, bool? withTotalPages = null, bool? hasVersions = null, CancellationToken cToken = default)
{
const string resourcePath = "/application/applications";
const string resourcePath = $"application/applications";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("currentPage", currentPage);
Expand Down Expand Up @@ -78,7 +78,7 @@ public ApplicationsApi(HttpClient httpClient)
jsonNode?.RemoveFromNode("self");
jsonNode?.RemoveFromNode("id");
jsonNode?.RemoveFromNode("resourcesUrl");
const string resourcePath = "/application/applications";
const string resourcePath = $"application/applications";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -98,7 +98,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<Application?> GetApplication(string id, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -122,7 +122,7 @@ public ApplicationsApi(HttpClient httpClient)
jsonNode?.RemoveFromNode("id");
jsonNode?.RemoveFromNode("type");
jsonNode?.RemoveFromNode("resourcesUrl");
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -142,7 +142,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<string?> DeleteApplication(string id, bool? force = null, string? xCumulocityProcessingMode = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("force", force);
Expand All @@ -162,7 +162,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<Application?> CopyApplication(string id, string? version = null, string? tag = null, string? xCumulocityProcessingMode = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/clone";
string resourcePath = $"application/applications/{HttpUtility.UrlPathEncode(id.GetStringValue())}/clone";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("version", version);
Expand All @@ -184,7 +184,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationCollection?> GetApplicationsByName(string name, CancellationToken cToken = default)
{
string resourcePath = $"/application/applicationsByName/{HttpUtility.UrlPathEncode(name.GetStringValue())}";
string resourcePath = $"application/applicationsByName/{HttpUtility.UrlPathEncode(name.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -201,7 +201,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationCollection?> GetApplicationsByTenant(string tenantId, CancellationToken cToken = default)
{
string resourcePath = $"/application/applicationsByTenant/{HttpUtility.UrlPathEncode(tenantId.GetStringValue())}";
string resourcePath = $"application/applicationsByTenant/{HttpUtility.UrlPathEncode(tenantId.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
using var request = new HttpRequestMessage
{
Expand All @@ -218,7 +218,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationCollection?> GetApplicationsByOwner(string tenantId, int? currentPage = null, int? pageSize = null, bool? withTotalElements = null, bool? withTotalPages = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applicationsByOwner/{HttpUtility.UrlPathEncode(tenantId.GetStringValue())}";
string resourcePath = $"application/applicationsByOwner/{HttpUtility.UrlPathEncode(tenantId.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("currentPage", currentPage);
Expand All @@ -241,7 +241,7 @@ public ApplicationsApi(HttpClient httpClient)
/// <inheritdoc />
public async Task<ApplicationCollection?> GetApplicationsByUser(string username, int? currentPage = null, int? pageSize = null, bool? withTotalElements = null, bool? withTotalPages = null, CancellationToken cToken = default)
{
string resourcePath = $"/application/applicationsByUser/{HttpUtility.UrlPathEncode(username.GetStringValue())}";
string resourcePath = $"application/applicationsByUser/{HttpUtility.UrlPathEncode(username.GetStringValue())}";
var uriBuilder = new UriBuilder(new Uri(_httpClient.BaseAddress ?? new Uri(resourcePath), resourcePath));
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
queryString.TryAdd("currentPage", currentPage);
Expand Down
Loading

0 comments on commit 60f52ff

Please sign in to comment.