Skip to content

Commit

Permalink
Stores API method added.
Browse files Browse the repository at this point in the history
  • Loading branch information
shafaqat-ali-cms365 committed Jun 4, 2024
1 parent 2376b5a commit cf78330
Show file tree
Hide file tree
Showing 11 changed files with 1,233 additions and 247 deletions.
12 changes: 10 additions & 2 deletions EbaySharp/Controllers/EbayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
using EbaySharp.Entities.Sell.Inventory.Location;
using EbaySharp.Entities.Sell.Inventory.Offer;
using EbaySharp.Entities.Sell.Metadata.Marketplace;
using EbaySharp.Source;
using static EbaySharp.Source.Constants.SELL;
using EbaySharp.Entities.Sell.Stores.Store;

namespace EbaySharp.Controllers
{
Expand Down Expand Up @@ -195,5 +194,14 @@ public async Task<Transactions> GetTransactions(string filter=null, string sort=
}

#endregion

#region STORES

public async Task<StoreCategories> GetStoreCategories()
{
return await new StoresController(accessToken).GetStoreCategories();
}

#endregion
}
}
2 changes: 1 addition & 1 deletion EbaySharp/Controllers/MetadataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public MetadataController(string accessToken)
}
public async Task<ReturnPolicies> GetReturnPolicies(string marketplaceName)
{
string requestUrl = $"{Constants.API_SERVER_URL}{Constants.SELL.ENDPOINT_URL}{Constants.SELL.METADATA.ENDPOINT_URL}{string.Format(Constants.SELL.METADATA.METHODS.GET_RETURN_POLICIES, marketplaceName)}";
string requestUrl = $"{Constants.API_SERVER_URL}{Constants.SELL.ENDPOINT_URL}{Constants.SELL.METADATA.ENDPOINT_URL}{Constants.SELL.METADATA.MARKETPLACE.ENDPOINT_URL}{string.Format(Constants.SELL.METADATA.MARKETPLACE.METHODS.GET_RETURN_POLICIES, marketplaceName)}";
return await new RequestExecuter().ExecuteGetRequest<ReturnPolicies>(requestUrl, $"Bearer {accessToken}");
}
}
Expand Down
20 changes: 20 additions & 0 deletions EbaySharp/Controllers/StoresController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using EbaySharp.Entities.Commerce.Taxonomy;
using EbaySharp.Entities.Sell.Stores.Store;
using EbaySharp.Source;

namespace EbaySharp.Controllers
{
class StoresController
{
private string accessToken;
public StoresController(string accessToken)
{
this.accessToken = accessToken;
}
public async Task<StoreCategories> GetStoreCategories()
{
string requestUrl = $"{Constants.API_SERVER_URL}{Constants.SELL.ENDPOINT_URL}{Constants.SELL.STORES.ENDPOINT_URL}{Constants.SELL.STORES.STORE.ENDPOINT_URL}{Constants.SELL.STORES.STORE.METHODS.GET_STORE_CATEGORIES}";
return await new RequestExecuter().ExecuteGetRequest<StoreCategories>(requestUrl, $"Bearer {accessToken}");
}
}
}
6 changes: 3 additions & 3 deletions EbaySharp/EbaySharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<ApplicationIcon>EbaySharp_ico.ico</ApplicationIcon>
<PackageID>CMS365.EbaySharp</PackageID>
<Title>EbaySharp</Title>
<Version>6.6.1</Version>
<Version>6.6.2</Version>
<Authors>Shafaqat Ali</Authors>
<Company>CMS365 PTY LTD</Company>
<Description>EbaySharp is a .NET library that enables you to authenticate and make REST API calls to eBay. It's used for creating listings and managing orders using C# and .NET</Description>
<PackageProjectUrl>https://github.com/shafaqat-ali-cms365/EbaySharp</PackageProjectUrl>
<PackageProjectUrl>https://github.com/CMS365-PTY-LTD/EbaySharp</PackageProjectUrl>
<PackageIcon>EbaySharp_ico.png</PackageIcon>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/shafaqat-ali-cms365/EbaySharp.git</RepositoryUrl>
<RepositoryUrl>https://github.com/CMS365-PTY-LTD/EbaySharp.git</RepositoryUrl>
<PackageTags>eBay;.net;c#</PackageTags>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace EbaySharp.Entities.Sell.Metadata.Marketplace
using System.Text.Json.Serialization;

namespace EbaySharp.Entities.Sell.Metadata.Marketplace
{
public class ReturnPolicies
{
[JsonPropertyName("returnPolicies")]
public ReturnPolicy[] ReturnPolicyList { get; set; }
}
}
11 changes: 11 additions & 0 deletions EbaySharp/Entities/Sell/Stores/Store/ChildrenCategory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EbaySharp.Entities.Sell.Stores.Store
{
public class ChildrenCategory
{
public string CategoryId { get; set; }
public string CategoryName { get; set; }
public List<ChildrenCategory> ChildrenCategories { get; set; }
public int? Level { get; set; }
public int? Order { get; set; }
}
}
10 changes: 10 additions & 0 deletions EbaySharp/Entities/Sell/Stores/Store/StoreCategories.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Text.Json.Serialization;

namespace EbaySharp.Entities.Sell.Stores.Store
{
public class StoreCategories
{
[JsonPropertyName("storeCategories")]
public List<StoreCategory> StoreCategoriesList { get; set; }
}
}
11 changes: 11 additions & 0 deletions EbaySharp/Entities/Sell/Stores/Store/StoreCategory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EbaySharp.Entities.Sell.Stores.Store
{
public class StoreCategory
{
public string CategoryId { get; set; }
public string CategoryName { get; set; }
public List<ChildrenCategory> ChildrenCategories { get; set; }
public int? Level { get; set; }
public int? Order { get; set; }
}
}
Loading

0 comments on commit cf78330

Please sign in to comment.