Hannibalystic.Amazon.Base
1.0.0.5
dotnet add package Hannibalystic.Amazon.Base --version 1.0.0.5
NuGet\Install-Package Hannibalystic.Amazon.Base -Version 1.0.0.5
<PackageReference Include="Hannibalystic.Amazon.Base" Version="1.0.0.5" />
paket add Hannibalystic.Amazon.Base --version 1.0.0.5
#r "nuget: Hannibalystic.Amazon.Base, 1.0.0.5"
// Install Hannibalystic.Amazon.Base as a Cake Addin #addin nuget:?package=Hannibalystic.Amazon.Base&version=1.0.0.5 // Install Hannibalystic.Amazon.Base as a Cake Tool #tool nuget:?package=Hannibalystic.Amazon.Base&version=1.0.0.5
Selling Partner API Authentication/Authorization Library
This is a fork of the Amazon SP-API SDK. I have replaced the RateLimiter library because the original simply does not work. There are other changes as well. See the source code at selling-partner-api-models. If you would like additional SP-API models added to the library, please contact me directly.
LWAAuthorizationSigner
Obtains and signs a request with an access token from LWA (Login with Amazon) for the specified endpoint using the provided LWA credentials.
Example
using RestSharp;
using Amazon.SellingPartnerAPIAA;
string resource = "/my/api/path";
RestClient restClient = new RestClient("https://...");
IRestRequest restRequest = new RestRequest(resource, Method.GET);
// Seller APIs
LWAAuthorizationCredentials lwaAuthorizationCredentials = new LWAAuthorizationCredentials
{
ClientId = "...",
ClientSecret = "",
RefreshToken = "",
Endpoint = new Uri("...")
};
/* Sellerless APIs
The Selling Partner API scopes can be retrieved from the ScopeConstants class and used to specify a list of scopes of an LWAAuthorizationCredentials instance. */
LWAAuthorizationCredentials lwaAuthorizationCredentials = new LWAAuthorizationCredentials
{
ClientId = "...",
ClientSecret = "",
Scopes = new List<string>() { ScopeConstants.ScopeNotificationsAPI, ScopeConstants.ScopeMigrationAPI }
Endpoint = new Uri("...")
};
restRequest = new LWAAuthorizationSigner(lwaAuthorizationCredentials).Sign(restRequest);
Note the IRestRequest reference is treated as mutable when signed.
RateLimitConfiguration
Interface to set and get rateLimit configurations that are used with RateLimiter. RateLimiter is used on client side to restrict the rate at which requests are made. RateLimiter Configuration takes Permit, rate which requests are made and TimeOut
Example
RateLimitConfiguration rateLimitConfig = new RateLimitConfigurationOnRequests
{
RateLimitPermit = ..,
WaitTimeOutInMilliSeconds = ...
};
Exception
This package returns a custom LWAException when there is an error returned during LWA authorization. LWAException provides additional details like errorCode and errorDescription to help fix the issue.
Example
catch (LWAException e)
{
Console.WriteLine("LWA Exception when calling Selling partner API");
Console.WriteLine(e.getErrorCode());
Console.WriteLine(e.getErrorMessage());
Console.WriteLine(e.Message);
}
Version
Selling Partner API Authentication/Authorization Library version 2.0.
Resources
This package features Mustache templates designed for use with swagger codegen. When you build Selling Partner API Swagger models with these templates, they help generate a rich SDK with functionality to invoke Selling Partner APIs built in. The templates are located in resources/swagger-codegen.
Building
This package is built as a .NET Standard Library via a Visual Studio Solution with implementation and test projects. The Visual Studio Community Edition can be obtained for free from Microsoft and used to build the solution and generate a .dll assembly which can be imported into other projects.
Dependencies
All dependencies can be installed via NuGet
- RestSharp - 106.12.0
- Newtonsoft.Json 12.0.3
- NETStandard.Library 2.0.3 (platform-specific implementation requirements are documented on the Microsoft .NET Guide)
License
Swagger Codegen templates are subject to the Swagger Codegen License.
All other work licensed as follows:
Copyright 2020 Amazon.com, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- RestSharp (>= 106.12.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Hannibalystic.Amazon.Base:
Package | Downloads |
---|---|
Hannibalystic.Amazon.Client
A library generated from the Amazon Selling Partner API Swagger doc. |
GitHub repositories
This package is not used by any popular GitHub repositories.