Remove obsolete sync API methods from ReCClient
All synchronous (blocking) HTTP API methods have been removed from the ReCClient class, leaving only their asynchronous counterparts. These sync methods were previously marked as [Obsolete] and simply wrapped the async methods with .GetAwaiter().GetResult(). Additionally, the ToJsonContent method's return type was updated from HttpContent to JsonContent for improved type specificity.
This commit is contained in:
@@ -47,7 +47,7 @@ namespace ReC.Client
|
|||||||
return string.IsNullOrWhiteSpace(query) ? string.Empty : $"?{query}";
|
return string.IsNullOrWhiteSpace(query) ? string.Empty : $"?{query}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HttpContent ToJsonContent<T>(T payload) => JsonContent.Create(payload);
|
private static JsonContent ToJsonContent<T>(T payload) => JsonContent.Create(payload);
|
||||||
|
|
||||||
#region RecActionController
|
#region RecActionController
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -65,22 +65,6 @@ namespace ReC.Client
|
|||||||
return resp.IsSuccessStatusCode;
|
return resp.IsSuccessStatusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously invokes a ReC action for a specific profile.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/RecAction/invoke/{profileId}</c> endpoint.
|
|
||||||
/// This is the synchronous version of <see cref="InvokeRecActionAsync(int, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="profileId">The ID of the profile to invoke the action for.</param>
|
|
||||||
/// <returns><see langword="true"/> if the request was successful; otherwise, <see langword="false"/>.</returns>
|
|
||||||
[Obsolete("Use InvokeRecActionAsync instead to avoid potential deadlocks and improve performance.")]
|
|
||||||
public bool InvokeRecAction(int profileId)
|
|
||||||
{
|
|
||||||
var resp = _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null).GetAwaiter().GetResult();
|
|
||||||
return resp.IsSuccessStatusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously retrieves a list of ReC actions for the configured profile.
|
/// Asynchronously retrieves a list of ReC actions for the configured profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -97,20 +81,6 @@ namespace ReC.Client
|
|||||||
return _http.GetAsync($"api/RecAction{query}", cancel);
|
return _http.GetAsync($"api/RecAction{query}", cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously retrieves a list of ReC actions for the configured profile.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a GET request to the <c>api/RecAction</c> endpoint with optional query parameters.
|
|
||||||
/// This is the synchronous version of <see cref="GetRecActionsAsync(long?, bool?, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="profileId">The ID of the profile to retrieve actions for. If <c>null</c>, actions for all profiles are retrieved.</param>
|
|
||||||
/// <param name="invoked">Filter for invoked actions. If <c>null</c>, both invoked and not invoked actions are retrieved.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use GetRecActionsAsync instead.")]
|
|
||||||
public HttpResponseMessage GetRecActions(long? profileId = null, bool? invoked = null)
|
|
||||||
=> GetRecActionsAsync(profileId, invoked).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously creates a new ReC action.
|
/// Asynchronously creates a new ReC action.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -123,19 +93,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateRecActionAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateRecActionAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/RecAction", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/RecAction", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new ReC action.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/RecAction</c> endpoint with the action data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateRecActionAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The action data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateRecActionAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateRecAction<T>(T procedure)
|
|
||||||
=> CreateRecActionAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing ReC action.
|
/// Asynchronously updates an existing ReC action.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -149,20 +106,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateRecActionAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateRecActionAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/RecAction/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/RecAction/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing ReC action.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/RecAction/{id}</c> endpoint with the updated action data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateRecActionAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the action to update.</param>
|
|
||||||
/// <param name="procedure">The updated action data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateRecActionAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateRecAction<T>(long id, T procedure)
|
|
||||||
=> UpdateRecActionAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more ReC actions.
|
/// Asynchronously deletes one or more ReC actions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -180,19 +123,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more ReC actions.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/RecAction</c> endpoint with the IDs of the actions to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteRecActionsAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the actions to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteRecActionsAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteRecActions<T>(T procedure)
|
|
||||||
=> DeleteRecActionsAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OutResController
|
#region OutResController
|
||||||
@@ -213,21 +143,6 @@ namespace ReC.Client
|
|||||||
return _http.GetAsync($"api/OutRes{query}", cancel);
|
return _http.GetAsync($"api/OutRes{query}", cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously retrieves results for the configured profile.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a GET request to the <c>api/OutRes</c> endpoint with optional query parameters.
|
|
||||||
/// This is the synchronous version of <see cref="GetResultsAsync(long?, long?, long?, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">Filter by result ID.</param>
|
|
||||||
/// <param name="actionId">Filter by action ID.</param>
|
|
||||||
/// <param name="profileId">Filter by profile ID.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use GetResultsAsync instead.")]
|
|
||||||
public HttpResponseMessage GetResults(long? id = null, long? actionId = null, long? profileId = null)
|
|
||||||
=> GetResultsAsync(id, actionId, profileId).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously creates a new result.
|
/// Asynchronously creates a new result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -240,19 +155,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateResultAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateResultAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/OutRes", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/OutRes", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new result.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/OutRes</c> endpoint with the result data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateResultAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The result data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateResultAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateResult<T>(T procedure)
|
|
||||||
=> CreateResultAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing result.
|
/// Asynchronously updates an existing result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -266,20 +168,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateResultAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateResultAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/OutRes/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/OutRes/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing result.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/OutRes/{id}</c> endpoint with the updated result data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateResultAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the result to update.</param>
|
|
||||||
/// <param name="procedure">The updated result data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateResultAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateResult<T>(long id, T procedure)
|
|
||||||
=> UpdateResultAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more results.
|
/// Asynchronously deletes one or more results.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -297,19 +185,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more results.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/OutRes</c> endpoint with the IDs of the results to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteResultsAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the results to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteResultsAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteResults<T>(T procedure)
|
|
||||||
=> DeleteResultsAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ProfileController
|
#region ProfileController
|
||||||
@@ -329,20 +204,6 @@ namespace ReC.Client
|
|||||||
return _http.GetAsync($"api/Profile{query}", cancel);
|
return _http.GetAsync($"api/Profile{query}", cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously retrieves a profile by ID.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a GET request to the <c>api/Profile</c> endpoint with the profile ID as a query parameter.
|
|
||||||
/// This is the synchronous version of <see cref="GetProfileAsync(long, bool, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the profile to retrieve.</param>
|
|
||||||
/// <param name="includeActions">Whether to include associated actions in the response.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use GetProfileAsync instead.")]
|
|
||||||
public HttpResponseMessage GetProfile(long id, bool includeActions = false)
|
|
||||||
=> GetProfileAsync(id, includeActions).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously creates a new profile.
|
/// Asynchronously creates a new profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -355,19 +216,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateProfileAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateProfileAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/Profile", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/Profile", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new profile.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/Profile</c> endpoint with the profile data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateProfileAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The profile data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateProfileAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateProfile<T>(T procedure)
|
|
||||||
=> CreateProfileAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing profile.
|
/// Asynchronously updates an existing profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -381,20 +229,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateProfileAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateProfileAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/Profile/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/Profile/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing profile.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/Profile/{id}</c> endpoint with the updated profile data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateProfileAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the profile to update.</param>
|
|
||||||
/// <param name="procedure">The updated profile data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateProfileAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateProfile<T>(long id, T procedure)
|
|
||||||
=> UpdateProfileAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more profiles.
|
/// Asynchronously deletes one or more profiles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -412,19 +246,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more profiles.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/Profile</c> endpoint with the IDs of the profiles to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteProfilesAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the profiles to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteProfilesAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteProfiles<T>(T procedure)
|
|
||||||
=> DeleteProfilesAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region EndpointAuthController
|
#region EndpointAuthController
|
||||||
@@ -440,19 +261,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateEndpointAuthAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateEndpointAuthAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/EndpointAuth", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/EndpointAuth", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new endpoint authentication.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/EndpointAuth</c> endpoint with the authentication data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateEndpointAuthAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The authentication data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateEndpointAuthAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateEndpointAuth<T>(T procedure)
|
|
||||||
=> CreateEndpointAuthAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing endpoint authentication.
|
/// Asynchronously updates an existing endpoint authentication.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -466,20 +274,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateEndpointAuthAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateEndpointAuthAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/EndpointAuth/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/EndpointAuth/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing endpoint authentication.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/EndpointAuth/{id}</c> endpoint with the updated authentication data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateEndpointAuthAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the authentication to update.</param>
|
|
||||||
/// <param name="procedure">The updated authentication data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateEndpointAuthAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateEndpointAuth<T>(long id, T procedure)
|
|
||||||
=> UpdateEndpointAuthAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more endpoint authentications.
|
/// Asynchronously deletes one or more endpoint authentications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -497,19 +291,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more endpoint authentications.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/EndpointAuth</c> endpoint with the IDs of the authentications to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteEndpointAuthAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the authentications to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteEndpointAuthAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteEndpointAuth<T>(T procedure)
|
|
||||||
=> DeleteEndpointAuthAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region EndpointParamsController
|
#region EndpointParamsController
|
||||||
@@ -525,19 +306,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateEndpointParamsAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateEndpointParamsAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/EndpointParams", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/EndpointParams", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates new endpoint parameters.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/EndpointParams</c> endpoint with the parameters data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateEndpointParamsAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The parameters data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateEndpointParamsAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateEndpointParams<T>(T procedure)
|
|
||||||
=> CreateEndpointParamsAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates existing endpoint parameters.
|
/// Asynchronously updates existing endpoint parameters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -551,20 +319,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateEndpointParamsAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateEndpointParamsAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/EndpointParams/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/EndpointParams/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates existing endpoint parameters.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/EndpointParams/{id}</c> endpoint with the updated parameters data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateEndpointParamsAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the parameters to update.</param>
|
|
||||||
/// <param name="procedure">The updated parameters data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateEndpointParamsAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateEndpointParams<T>(long id, T procedure)
|
|
||||||
=> UpdateEndpointParamsAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more endpoint parameters.
|
/// Asynchronously deletes one or more endpoint parameters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -582,19 +336,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more endpoint parameters.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/EndpointParams</c> endpoint with the IDs of the parameters to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteEndpointParamsAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the parameters to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteEndpointParamsAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteEndpointParams<T>(T procedure)
|
|
||||||
=> DeleteEndpointParamsAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region EndpointsController
|
#region EndpointsController
|
||||||
@@ -610,19 +351,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateEndpointAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateEndpointAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/Endpoints", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/Endpoints", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new endpoint.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/Endpoints</c> endpoint with the endpoint data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateEndpointAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The endpoint data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateEndpointAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateEndpoint<T>(T procedure)
|
|
||||||
=> CreateEndpointAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing endpoint.
|
/// Asynchronously updates an existing endpoint.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -636,20 +364,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateEndpointAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateEndpointAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync($"api/Endpoints/{id}", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync($"api/Endpoints/{id}", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing endpoint.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/Endpoints/{id}</c> endpoint with the updated endpoint data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateEndpointAsync{T}(long, T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="id">The ID of the endpoint to update.</param>
|
|
||||||
/// <param name="procedure">The updated endpoint data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateEndpointAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateEndpoint<T>(long id, T procedure)
|
|
||||||
=> UpdateEndpointAsync(id, procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more endpoints.
|
/// Asynchronously deletes one or more endpoints.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -667,19 +381,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more endpoints.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/Endpoints</c> endpoint with the IDs of the endpoints to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteEndpointAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the endpoints to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteEndpointAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteEndpoint<T>(T procedure)
|
|
||||||
=> DeleteEndpointAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region CommonController
|
#region CommonController
|
||||||
@@ -695,19 +396,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> CreateObjectAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> CreateObjectAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PostAsync("api/Common", ToJsonContent(procedure), cancel);
|
=> _http.PostAsync("api/Common", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously creates a new object.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a POST request to the <c>api/Common</c> endpoint with the object data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="CreateObjectAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The object data to create.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use CreateObjectAsync instead.")]
|
|
||||||
public HttpResponseMessage CreateObject<T>(T procedure)
|
|
||||||
=> CreateObjectAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously updates an existing object.
|
/// Asynchronously updates an existing object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -720,19 +408,6 @@ namespace ReC.Client
|
|||||||
public Task<HttpResponseMessage> UpdateObjectAsync<T>(T procedure, CancellationToken cancel = default)
|
public Task<HttpResponseMessage> UpdateObjectAsync<T>(T procedure, CancellationToken cancel = default)
|
||||||
=> _http.PutAsync("api/Common", ToJsonContent(procedure), cancel);
|
=> _http.PutAsync("api/Common", ToJsonContent(procedure), cancel);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously updates an existing object.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a PUT request to the <c>api/Common</c> endpoint with the updated object data as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="UpdateObjectAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">The updated object data.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use UpdateObjectAsync instead.")]
|
|
||||||
public HttpResponseMessage UpdateObject<T>(T procedure)
|
|
||||||
=> UpdateObjectAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously deletes one or more objects.
|
/// Asynchronously deletes one or more objects.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -750,19 +425,6 @@ namespace ReC.Client
|
|||||||
};
|
};
|
||||||
return _http.SendAsync(request, cancel);
|
return _http.SendAsync(request, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronously deletes one or more objects.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method sends a DELETE request to the <c>api/Common</c> endpoint with the IDs of the objects to delete as JSON.
|
|
||||||
/// This is the synchronous version of <see cref="DeleteObjectAsync{T}(T, CancellationToken)"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="procedure">An object containing the IDs of the objects to delete.</param>
|
|
||||||
/// <returns>A <see cref="HttpResponseMessage"/> containing the response data.</returns>
|
|
||||||
[Obsolete("Use DeleteObjectAsync instead.")]
|
|
||||||
public HttpResponseMessage DeleteObject<T>(T procedure)
|
|
||||||
=> DeleteObjectAsync(procedure).GetAwaiter().GetResult();
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Static
|
#region Static
|
||||||
|
|||||||
Reference in New Issue
Block a user