-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathLoggingExamples.cs
35 lines (31 loc) · 1.42 KB
/
LoggingExamples.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using FikaAmazonAPI.Parameter.Order;
using FikaAmazonAPI.Utils;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace FikaAmazonAPI.SampleCode;
public class LoggingExamples
{
private AmazonConnection _amazonConnection;
public LoggingExamples(IConfigurationRoot config)
{
var factory = LoggerFactory.Create(builder => builder.AddConsole());
_amazonConnection = new AmazonConnection(new AmazonCredential()
{
//AccessKey = config.GetSection("FikaAmazonAPI:AccessKey").Value,
//SecretKey = config.GetSection("FikaAmazonAPI:SecretKey").Value,
//RoleArn = config.GetSection("FikaAmazonAPI:RoleArn").Value,
ClientId = config.GetSection("FikaAmazonAPI:ClientId").Value,
ClientSecret = config.GetSection("FikaAmazonAPI:ClientSecret").Value,
RefreshToken = config.GetSection("FikaAmazonAPI:RefreshToken").Value,
MarketPlaceID = config.GetSection("FikaAmazonAPI:MarketPlaceID").Value,
SellerID = config.GetSection("FikaAmazonAPI:SellerId").Value,
IsDebugMode = true,
Environment = Constants.Environments.Sandbox
}, loggerFactory: factory);
}
public async Task ConsoleLoggerExample()
{
var listingItemExample = new ListingsItemsSample(_amazonConnection);
await listingItemExample.SetListingsItemAttribute("test");
}
}