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

Querying reverses with gitauto model #198

Closed
14 changes: 14 additions & 0 deletions Src/GuiStracini.Mandae/IMandaeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ CancellationToken token
/// Gets the tracking asynchronous.
/// </summary>
/// <param name="trackingCode">The tracking code.</param>
SearchReverseResponse SearchReverse(
ReverseSearchMethod method,
string value,
int limit,
int offset
);

Task<SearchReverseResponse> SearchReverseAsync(
ReverseSearchMethod method,
string value,
CancellationToken token,
int limit,
int offset
);
/// <param name="token">The token.</param>
/// <returns>Task&lt;TrackingResponse&gt;.</returns>
Task<TrackingResponse> GetTrackingAsync(string trackingCode, CancellationToken token);
Expand Down
34 changes: 34 additions & 0 deletions Src/GuiStracini.Mandae/MandaeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,41 @@

/// <summary>
/// Configures the v1 authentication.
#region Reverses (V1)

Check warning on line 191 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 191 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 191 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 191 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

public SearchReverseResponse SearchReverse(
ReverseSearchMethod method,
string value,
int limit = 10,
int offset = 0
)
{
return SearchReverseAsync(method, value, CancellationToken.None, limit, offset).Result;
}

public async Task<SearchReverseResponse> SearchReverseAsync(
ReverseSearchMethod method,
string value,
CancellationToken token,
int limit = 10,
int offset = 0
)
{
var data = new SearchReverseRequest
{
Method = method,
Value = value,
Limit = limit,
Offset = offset
};

return await _serviceV1
.Get<SearchReverseResponse, SearchReverseRequest>(data, token)
.ConfigureAwait(_configureAwait);
}

#endregion Reverses (V1)
/// </summary>

Check warning on line 225 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 225 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 225 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 225 in Src/GuiStracini.Mandae/MandaeClient.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

XML comment has badly formed XML -- 'End tag was not expected at this location.'
/// <param name="email">The email.</param>
/// <param name="password">The password.</param>
/// <returns>System.String.</returns>
Expand Down
12 changes: 12 additions & 0 deletions Src/GuiStracini.Mandae/Utils/ServiceFactoryV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

public async Task<TResponse> Get<TResponse, TRequest>(TRequest data, CancellationToken token)

Check failure on line 20 in Src/GuiStracini.Mandae/Utils/ServiceFactoryV1.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

The modifier 'public' is not valid for this item

Check failure on line 20 in Src/GuiStracini.Mandae/Utils/ServiceFactoryV1.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

The modifier 'public' is not valid for this item

Check failure on line 20 in Src/GuiStracini.Mandae/Utils/ServiceFactoryV1.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

The modifier 'public' is not valid for this item

Check failure on line 20 in Src/GuiStracini.Mandae/Utils/ServiceFactoryV1.cs

View workflow job for this annotation

GitHub Actions / Deep Source Coverage report

The modifier 'public' is not valid for this item
where TResponse : BaseResponse
{
// Implement actual HTTP GET logic here
// Example:
// var response = await _httpClient.GetAsync(BuildUri(data), token);
// response.EnsureSuccessStatusCode();
// return await response.Content.ReadAsAsync<TResponse>();

throw new NotImplementedException();
}

namespace GuiStracini.Mandae.Utils
{
using System;
Expand Down
Loading