Amilon.MyGate.API.Client
3.0.23
dotnet add package Amilon.MyGate.API.Client --version 3.0.23
NuGet\Install-Package Amilon.MyGate.API.Client -Version 3.0.23
<PackageReference Include="Amilon.MyGate.API.Client" Version="3.0.23" />
paket add Amilon.MyGate.API.Client --version 3.0.23
#r "nuget: Amilon.MyGate.API.Client, 3.0.23"
// Install Amilon.MyGate.API.Client as a Cake Addin #addin nuget:?package=Amilon.MyGate.API.Client&version=3.0.23 // Install Amilon.MyGate.API.Client as a Cake Tool #tool nuget:?package=Amilon.MyGate.API.Client&version=3.0.23
Amilon My Gate API Client
This client allows you to connect and use Amilon's My Gate API Client.
Usage
Single Tenant
You can configure the authentication parameters in the appsettings.json. Depending on your authentication type, you can configure
- ClientId
- ClientSecret
or/and optionally
- UserName
- Password
"MyGate_API_Client": {
"Environment": "STG",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"UserName": "your-username",
"Password": "your-password",
"Version": "2",
"GrantType": "password",
"Timeout": 60000
}
You can configure the client in your app through Dependency Injection
- Startup.cs
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddMyGateClient(Configuration);
}
- Host Builder
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddMyGateClient(builder.Configuration);
Multi Tenant
You can configure the authentication parameters in the appsettings.json. Depending on your authentication type, you can configure
- ClientId
- ClientSecret
or/and optionally
- UserName
- Password
In this Multi Tenant mode, you can customize the appSettings to your own needs, it does not have to use a specific structure as the client will be initialized manually using the needed parameters in the AddMyGateClient method call.
"MyGate_API_Client": {
"Environment": "STG",
"Version": "2",
"GrantType": "password",
"Timeout": 60000
},
"MultiTenant": [
{
"ClientId": "your-client-id_1",
"ClientSecret": "your-client-secret_1",
"MyGateCredentials": {
"UserName": "your-user-name_1",
"Password": "your-password_1"
}
},
{
"ClientId": "your-client-id_2",
"ClientSecret": "your-client-secret_2",
"MyGateCredentials": {
"UserName": "your-user-name_2",
"Password": "your-password_2"
}
},
]
You can configure the client in your app through Dependency Injection. MultiTenantHelper is a placeholder for a class you can make in order to get the specific credentials for a specific ClientId.
- Startup.cs
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
var GateConfig = Configuration.GetSection("MyGate_API_Client").Get<MyGateConfig>();
services.AddMyGateClient(_ =>
{
var config = new GateConfig();
var mygateCredentials = MultiTenantHelper.GetMyGateCredentials();
config.ClientId = mygateCredentials.ClientId;
config.ClientSecret = mygateCredentials.ClientSecret;
config.GrantType = GateConfig.GrantType;
config.Version = GateConfig.Version;
config.Password = mygateCredentials.Password;
config.UserName = mygateCredentials.UserName;
return config;
}, GateConfig.Environment, GateConfig.Timeout);
}
- Host Builder
var builder = Host.CreateApplicationBuilder(args);
var GateConfig = Configuration.GetSection("MyGate_API_Client").Get<MyGateConfig>();
builder.Services.AddMyGateClient(_ =>
{
var config = new GateConfig();
var mygateCredentials = MultiTenantHelper.GetMyGateCredentials();
config.ClientId = mygateCredentials.ClientId;
config.ClientSecret = mygateCredentials.ClientSecret;
config.GrantType = GateConfig.GrantType;
config.Version = GateConfig.Version;
config.Password = mygateCredentials.Password;
config.UserName = mygateCredentials.UserName;
return config;
}, GateConfig.Environment, GateConfig.Timeout);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.1
- Amilon.Commons (>= 3.0.23)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
-
net6.0
- Amilon.Commons (>= 3.0.23)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
-
net8.0
- Amilon.Commons (>= 3.0.23)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.0.23 | 84 | 11/6/2024 | |
3.0.21 | 101 | 10/29/2024 | |
3.0.20 | 79 | 10/25/2024 | |
3.0.19 | 71 | 10/23/2024 | |
3.0.18 | 85 | 10/10/2024 | |
3.0.17 | 108 | 9/13/2024 | |
3.0.16 | 95 | 9/9/2024 | |
3.0.15 | 118 | 9/3/2024 | |
3.0.13 | 130 | 5/13/2024 | |
3.0.12 | 113 | 5/8/2024 | |
3.0.11 | 109 | 4/18/2024 | |
3.0.4 | 114 | 4/18/2024 | |
3.0.3 | 112 | 4/18/2024 | |
3.0.2 | 115 | 4/18/2024 | |
3.0.1 | 106 | 4/18/2024 | |
2.3.1 | 237 | 3/4/2024 | |
2.2.3 | 719 | 6/7/2023 | |
2.2.2 | 641 | 6/7/2023 | |
2.2.1 | 647 | 6/6/2023 | |
2.1.8 | 710 | 5/26/2023 | |
2.1.4 | 684 | 5/2/2023 | |
2.1.2 | 736 | 3/21/2023 | |
2.1.1 | 734 | 3/16/2023 | |
2.0.13 | 938 | 11/11/2022 | |
2.0.12 | 887 | 11/11/2022 | |
2.0.11 | 997 | 6/24/2022 | |
2.0.10 | 975 | 6/23/2022 | |
2.0.9 | 947 | 6/9/2022 | |
2.0.8 | 924 | 6/9/2022 | |
2.0.7 | 949 | 6/9/2022 | |
2.0.6 | 959 | 6/9/2022 | |
2.0.4 | 978 | 6/9/2022 | |
2.0.2 | 966 | 6/9/2022 | |
2.0.1 | 926 | 6/9/2022 | |
1.8.0 | 958 | 6/8/2022 | |
1.7.1-beta | 700 | 5/2/2022 | |
1.6.6 | 914 | 5/19/2021 | |
1.6.5 | 869 | 5/11/2021 | |
1.6.4 | 896 | 3/30/2021 | |
1.6.3 | 849 | 3/30/2021 | |
1.6.1 | 871 | 3/23/2021 | |
1.6.0 | 975 | 3/23/2021 | |
1.5.0 | 993 | 2/12/2021 | |
1.0.1 | 93 | 5/15/2024 | |
1.0.0 | 901 | 6/9/2022 |