-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from indice-co/master
Merge Changes
- Loading branch information
Showing
20 changed files
with
277 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Incontrl.Sdk/Abstractions/ISubscriptionPlanServicesApi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Incontrl.Sdk.Models; | ||
|
||
namespace Incontrl.Sdk.Abstractions | ||
{ | ||
/// <summary> | ||
/// Contains operations to modify the properties of a specified service. | ||
/// </summary> | ||
public interface ISubscriptionPlanServicesApi | ||
{ | ||
/// <summary> | ||
/// The id of the subscription. | ||
/// </summary> | ||
string SubscriptionId { get; set; } | ||
/// <summary> | ||
/// The id of the service. | ||
/// </summary> | ||
string ServiceId { get; set; } | ||
/// <summary> | ||
/// Updates the properties of a specified service based on the <see cref="UpdateServiceRequest"/> model. | ||
/// </summary> | ||
/// <param name="request">Models a request to update a service.</param> | ||
/// <param name="cancellationToken">Returns the task object representing the asynchronous operation.</param> | ||
Task<Service> UpdateAsync(UpdateServiceRequest request, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
using System.Net.Http; | ||
using System.Globalization; | ||
using System.Net.Http; | ||
using System.Text; | ||
using Incontrl.Sdk.Json; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Incontrl.Sdk.Http | ||
{ | ||
internal class JsonRequest : StringContent | ||
{ | ||
private JsonRequest(string content) : base(content, Encoding.UTF8, "application/json") { } | ||
private static readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { | ||
Culture = CultureInfo.CurrentCulture, | ||
ContractResolver = new CamelCaseExceptDictionaryKeysResolver(), | ||
DateTimeZoneHandling = DateTimeZoneHandling.Utc | ||
}; | ||
|
||
public static JsonRequest For<T>(T payload) => new JsonRequest(JsonConvert.SerializeObject(payload)); | ||
private JsonRequest(string content) : base(content, Encoding.UTF8, "application/json") { | ||
_serializerSettings.Converters.Add(new StringEnumConverter { | ||
CamelCaseText = false | ||
}); | ||
} | ||
|
||
public static JsonRequest For<T>(T payload) => new JsonRequest(JsonConvert.SerializeObject(payload, _serializerSettings)); | ||
} | ||
} |
Oops, something went wrong.