Skip to content

Commit

Permalink
v6.3.0: Reorganized Delete methods with force option for: Voucher, Ca…
Browse files Browse the repository at this point in the history
…mpaign, Product and Sku (#33)

Added nuget icons

Fixed icons

Center links

Center links

Center links
  • Loading branch information
bandraszyk authored Jan 29, 2019
1 parent d8f5071 commit 05a5a1f
Show file tree
Hide file tree
Showing 23 changed files with 98 additions and 39 deletions.
Binary file modified lib/net2.0/Voucherify.Client.dll
Binary file not shown.
Binary file modified lib/net2.0/Voucherify.dll
Binary file not shown.
Binary file modified lib/net3.5/Voucherify.Client.dll
Binary file not shown.
Binary file modified lib/net3.5/Voucherify.dll
Binary file not shown.
Binary file modified lib/net4.0/Voucherify.Client.dll
Binary file not shown.
Binary file modified lib/net4.0/Voucherify.dll
Binary file not shown.
Binary file modified lib/net4.5/Voucherify.Client.dll
Binary file not shown.
Binary file modified lib/net4.5/Voucherify.dll
Binary file not shown.
Binary file modified lib/netstandard2.0/Voucherify.Client.dll
Binary file not shown.
Binary file modified lib/netstandard2.0/Voucherify.dll
Binary file not shown.
30 changes: 25 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
<h3 align="center">Official <a href="http://voucherify.io?utm_source=github&utm_medium=sdk&utm_campaign=acq">Voucherify</a> SDK for .NET Framework</h3>

<p align="center">
<a href="https://travis-ci.org/voucherifyio/voucherify-dotNET-sdk"><img src="https://travis-ci.org/voucherifyio/voucherify-dotNET-sdk.svg?branch=master" alt="Build Status"/></a>
<a href="https://travis-ci.org/voucherifyio/voucherify-dotNET-sdk" rel="nofollow">
<img src="https://travis-ci.org/voucherifyio/voucherify-dotNET-sdk.svg" alt="Build Status">
</a>
<a href="https://www.nuget.org/packages/Voucherify" rel="nofollow">
<img src="http://img.shields.io/nuget/v/Voucherify.svg" alt="Build Status">
</a>
<a href="https://www.nuget.org/packages/Voucherify.Client" rel="nofollow">
<img src="http://img.shields.io/nuget/v/Voucherify.Client.svg" alt="Build Status">
</a>
</p>



<hr />

<p align="center">
Expand Down Expand Up @@ -208,9 +219,11 @@ public void Update(string code, DataModel.Contexts.VoucherUpdate voucher, Action
```
#### [Delete Voucher]
```csharp
public async Task Delete(string code, DataModel.Queries.VoucherDelete query)
public async Task Delete(string code)
public async Task Delete(string code, Core.DataModel.ForcedOperation query query)

public void Delete(string code, DataModel.Queries.VoucherDelete query, Action<ApiResponse> callback)
public void Delete(string code, Action<ApiResponse> callback)
public void Delete(string code, Core.DataModel.ForcedOperation query query, Action<ApiResponse> callback)
```
#### [List Vouchers]
```csharp
Expand Down Expand Up @@ -275,9 +288,11 @@ public void Update(string name, DataModel.Contexts.CampaignUpdate campaign, Acti
```
#### [Delete Campaigns]
```csharp
public async Task Delete(string name, DataModel.Queries.CampaignDelete query)
public async Task Delete(string name)
public async Task Delete(string name, Core.DataModel.ForcedOperation query query)

public void Delete(string name, DataModel.Queries.CampaignDelete query, Action<ApiResponse> callback)
public void Delete(string name, Action<ApiResponse> callback)
public void Delete(string name, Core.DataModel.ForcedOperation query query, Action<ApiResponse> callback)
```
#### [List Campaigns]
```csharp
Expand Down Expand Up @@ -486,8 +501,10 @@ public void Update(string productId, DataModel.Contexts.ProductUpdate product, A
#### [Delete Product]
```csharp
public async Task Delete(string productId)
public async Task Delete(string productId, Core.DataModel.ForcedOperation query)

public void Delete(string productId, Action<ApiResponse> callback)
public void Delete(string productId, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
```
#### [List Products]
```csharp
Expand Down Expand Up @@ -517,8 +534,10 @@ public void UpdateSku(string productId, string skuId, DataModel.Contexts.SkuUpda
#### [Delete SKU]
```csharp
public async Task DeleteSku(string productId, string skuId)
public async Task DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query)

public void DeleteSku(string productId, string skuId, Action<ApiResponse> callback)
public void DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
```
#### [List all product SKUs]
```csharp
Expand Down Expand Up @@ -731,6 +750,7 @@ Bug reports and pull requests are welcome through [GitHub Issues](https://github

## Changelog

- **2019-01-29** - `6.3.0` - Reorganized Delete methods with force option for: Voucher, Campaign, Product and Sku
- **2019-01-28** - `6.2.0` - Added ApplicableTo property to Validation class
- **2019-01-25** - `6.1.0` - Extended OrderItem OrderItemProduct OrderItemSKU. Improved QuerySerializer
- **2018-12-27** - `6.0.1` - Added CreatedAt and UpdatedAt property to VoucherFilter
Expand Down
7 changes: 6 additions & 1 deletion src/Voucherify/ApiEndpoints/Campaigns.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ public Campaigns(Api api) : base(api)
return await this.client.DoPutRequest<DataModel.Campaign, DataModel.Contexts.CampaignUpdate>(uriBuilder.Uri, campaign).ConfigureAwait(false);
}

public async Task Delete(string name, DataModel.Queries.CampaignDelete query)
public async Task Delete(string name)
{
await this.Delete(name, null);
}

public async Task Delete(string name, Core.DataModel.ForcedOperation query)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/campaigns/{0}", Uri.EscapeDataString(name))), query);
await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
Expand Down
6 changes: 5 additions & 1 deletion src/Voucherify/ApiEndpoints/Campaigns.Callback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public void Update(string name, DataModel.Contexts.CampaignUpdate campaign, Acti
this.client.DoPutRequest(uriBuilder.Uri, campaign, callback);
}

public void Delete(string name, DataModel.Queries.CampaignDelete query, Action<ApiResponse> callback)
public void Delete(string name, Action<ApiResponse> callback) {
this.Delete(name, null, callback);
}

public void Delete(string name, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/campaigns/{0}", Uri.EscapeDataString(name))), query);
this.client.DoDeleteRequest(uriBuilder.Uri, callback);
Expand Down
14 changes: 12 additions & 2 deletions src/Voucherify/ApiEndpoints/Products.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public Products(Api api) : base(api)

public async Task Delete(string productId)
{
UriBuilder uriBuilder = this.client.GetUriBuilder(string.Format("/products/{0}", Uri.EscapeDataString(productId)));
await this.Delete(productId, null);
}

public async Task Delete(string productId, Core.DataModel.ForcedOperation query)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}", Uri.EscapeDataString(productId))), query);
await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
}

Expand All @@ -62,7 +67,12 @@ public async Task Delete(string productId)

public async Task DeleteSku(string productId, string skuId)
{
UriBuilder uriBuilder = this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId)));
await this.DeleteSku(productId, skuId, null);
}

public async Task DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId))), query);
await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
}

Expand Down
14 changes: 12 additions & 2 deletions src/Voucherify/ApiEndpoints/Products.Callback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public void List(DataModel.Queries.ProductFilter filter, Action<ApiResponse<Data

public void Delete(string productId, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = this.client.GetUriBuilder(string.Format("/products/{0}", Uri.EscapeDataString(productId)));
this.Delete(productId, null, callback);
}

public void Delete(string productId, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}", Uri.EscapeDataString(productId))), query);
this.client.DoDeleteRequest(uriBuilder.Uri, callback);
}

Expand All @@ -61,7 +66,12 @@ public void UpdateSku(string productId, string skuId, DataModel.Contexts.SkuUpda

public void DeleteSku(string productId, string skuId, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId)));
this.DeleteSku(productId, skuId, null, callback);
}

public void DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId))), query);
this.client.DoDeleteRequest(uriBuilder.Uri, callback);
}

Expand Down
7 changes: 6 additions & 1 deletion src/Voucherify/ApiEndpoints/Vouchers.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public Vouchers(Api api) : base(api)
return await this.client.DoPostRequest<DataModel.Balance, DataModel.Contexts.VoucherAddGiftBalance>(uriBuilder.Uri, balance).ConfigureAwait(false);
}

public async Task Delete(string code, DataModel.Queries.VoucherDelete query)
public async Task Delete(string code)
{
await this.Delete(code, null);
}

public async Task Delete(string code, Core.DataModel.ForcedOperation query)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}", Uri.EscapeDataString(code))), query);
await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
Expand Down
7 changes: 6 additions & 1 deletion src/Voucherify/ApiEndpoints/Vouchers.Callback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ public void AddGiftBalance(string code, DataModel.Contexts.VoucherAddGiftBalance
this.client.DoPostRequest(uriBuilder.Uri, balance, callback);
}

public void Delete(string code, DataModel.Queries.VoucherDelete query, Action<ApiResponse> callback)
public void Delete(string code, Action<ApiResponse> callback)
{
this.Delete(code, null, callback);
}

public void Delete(string code, Core.DataModel.ForcedOperation query, Action<ApiResponse> callback)
{
UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}", Uri.EscapeDataString(code))), query);
this.client.DoDeleteRequest(uriBuilder.Uri, callback);
Expand Down
12 changes: 12 additions & 0 deletions src/Voucherify/Core/DataModel/ForcedOperation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Newtonsoft.Json;
using System;

namespace Voucherify.Core.DataModel
{
[JsonObject]
public class ForcedOperation
{
[JsonProperty(PropertyName = "force")]
public Boolean Force { get; set; }
}
}
5 changes: 2 additions & 3 deletions src/Voucherify/DataModel/Queries/CampaignDelete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
namespace Voucherify.DataModel.Queries
{
[JsonObject]
public class CampaignDelete
public class CampaignDelete : Core.DataModel.ForcedOperation
{
[JsonProperty(PropertyName = "force")]
public bool? Force { get; set; }
// Kept for backward comaptibility
}
}
#endif
5 changes: 2 additions & 3 deletions src/Voucherify/DataModel/Queries/VoucherDelete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
namespace Voucherify.DataModel.Queries
{
[JsonObject]
public class VoucherDelete
public class VoucherDelete : Core.DataModel.ForcedOperation
{
[JsonProperty(PropertyName = "force")]
public bool Force { get; set; }
// Kept for backward comaptibility
}
}
#endif
20 changes: 2 additions & 18 deletions src/Voucherify/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
#if VOUCHERIFYCLIENT
[assembly: AssemblyTitle("Voucherify.Client")]
#else
Expand All @@ -18,20 +15,7 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyVersion("6.3.0.0")]
[assembly: AssemblyFileVersion("6.3.0.0")]
5 changes: 4 additions & 1 deletion src/Voucherify/Voucherify.Client.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Voucherify.Client</id>
<version>6.2.0.0</version>
<version>6.3.0.0</version>
<title>Voucherify.Client</title>
<authors>Rspective</authors>
<owners>Rspective</owners>
Expand All @@ -11,6 +11,9 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.Net SDK for Voucherify - coupons, vouchers, promo codes - http://www.voucherify.io</description>
<releaseNotes>
2019-01-29: 6.3.0:
- Reorganized Delete methods with force option for: Voucher, Campaign, Product and Sku

2019-01-28: 6.2.0:
- Added ApplicableTo property to Validation class

Expand Down
5 changes: 4 additions & 1 deletion src/Voucherify/Voucherify.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Voucherify</id>
<version>6.2.0.0</version>
<version>6.3.0.0</version>
<title>Voucherify</title>
<authors>Rspective</authors>
<owners>Rspective</owners>
Expand All @@ -11,6 +11,9 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.Net SDK for Voucherify - coupons, vouchers, promo codes - http://www.voucherify.io</description>
<releaseNotes>
2019-01-29: 6.3.0:
- Reorganized Delete methods with force option for: Voucher, Campaign, Product and Sku

2019-01-28: 6.2.0:
- Added ApplicableTo property to Validation class

Expand Down

0 comments on commit 05a5a1f

Please sign in to comment.