props/Props-Modules/Props.Shop/Ebay/EbayShop.cs

71 lines
1.8 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using Props.Shop.Framework;
namespace Props.Shop.Ebay
{
public class EbayShop : IShop
{
private bool disposedValue;
public string ShopName => "Ebay";
public string ShopDescription => "A multi-national online store host to consumer-to-consumer and business-to-consumer sales.";
public string ShopModuleAuthor => "Reslate";
public SupportedFeatures SupportedFeatures => new SupportedFeatures(
true,
true,
true,
true,
true
);
Configuration configuration;
private HttpClient httpClient;
public IEnumerable<IOption> Initialize(byte[] data)
{
httpClient = new HttpClient();
configuration = JsonSerializer.Deserialize<Configuration>(data);
return new List<IOption>() {
new SandboxOption(configuration),
};
}
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
httpClient.Dispose();
}
disposedValue = true;
}
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
public byte[] GetDataForPersistence()
{
return JsonSerializer.SerializeToUtf8Bytes(configuration);
}
public IAsyncEnumerable<ProductListing> Search(string query, Filters filters)
{
// TODO: Implement the search system.
throw new NotImplementedException();
}
}
}