YgoProDeck.Api.Client
1.0.0
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package YgoProDeck.Api.Client --version 1.0.0
NuGet\Install-Package YgoProDeck.Api.Client -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YgoProDeck.Api.Client" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="YgoProDeck.Api.Client" Version="1.0.0" />
<PackageReference Include="YgoProDeck.Api.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add YgoProDeck.Api.Client --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: YgoProDeck.Api.Client, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package YgoProDeck.Api.Client@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=YgoProDeck.Api.Client&version=1.0.0
#tool nuget:?package=YgoProDeck.Api.Client&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
YGOPRODECK-API-.NET-Client
.NET Client for the YGOPRODECK API
Using the YgoProDeck client in your project
First, add the card client to the service container.
private readonly IConfiguration _configuration;
public Startup(IConfiguration configuration)
{
_configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddYgoProDeck(_configuration);
}
Then use DI to get the IYuGiOhCardClient in your class. Given below are the calls you can make. The client has Polly policies implemented.
using System.Threading;
using YgoProDeck.Api.Client.Clients;
using YgoProDeck.Api.Client.Models;
namespace YgoProDeckTest
{
public class Foo
{
private readonly IYuGiOhCardClient _cardClient;
public Foo(IYuGiOhCardClient cardClient)
{
_cardClient = cardClient;
}
public async void Bar(CancellationToken cancellationToken)
{
// Getting card information
var options = new SearchOptions
{
Atk = 2000,
Def = 1500,
Level = 4
};
// Call to API returns a List<List<Card>> object as of now
var cards = await _cardClient.GetCardInformationAsync(options, cancellationToken);
// Getting a random card, returns a Card object
var randomCard = await _cardClient.GetRandomCardInformationAsync(cancellationToken);
// Getting card image by id, returns a byte array
var image = await _cardClient.GetImageAsync("12345678", cancellationToken);
var smallImage = await _cardClient.GetSmallImageAsync(randomCard.Id, cancellationToken);
// Getting card image by URL, returns a byte array
var imageByUrl = await _cardClient.GetImageByUrlAsync(randomCard.Image_Url, cancellationToken); // for regularly sized images
var smallImageByUrl = await _cardClient.GetImageByUrlAsync(randomCard.Image_Url_Small, cancellationToken); // for small sized images
}
}
}
The SearchOptions object has the following fields that can be used for filtering.
namespace YgoProDeck.Api.Client.Models
{
public class SearchOptions
{
/// <summary>
/// The exact name of the card. You can also pass a card ID to this.
/// </summary>
public string Name { get; set; }
/// <summary>
/// A fuzzy search using a string.
/// </summary>
public string FName { get; set; }
/// <summary>
/// The type of card you want to filter by.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Filter by ATK value.
/// </summary>
public int? Atk { get; set; }
/// <summary>
/// Filter by DEF value.
/// </summary>
public int? Def { get; set; }
/// <summary>
/// Filter by card level/RANK.
/// </summary>
public int? Level { get; set; }
/// <summary>
/// Filter by the card race, which is officially called type. This is also used for Spell/Trap cards.
/// </summary>
public string Race { get; set; }
/// <summary>
/// Filter by the card attribute.
/// </summary>
public string Attribute { get; set; }
/// <summary>
/// Filter the cards by Link value.
/// </summary>
public string Link { get; set; }
/// <summary>
/// Filter the cards by Link Marker value.
/// </summary>
public string LinkMarker { get; set; }
/// <summary>
/// Filter the cards by Pendulum Scale value.
/// </summary>
public string Scale { get; set; }
/// <summary>
/// Filter the cards by card set.
/// </summary>
public string Set { get; set; }
/// <summary>
/// Filter the cards by archetype.
/// </summary>
public string ArcheType { get; set; }
/// <summary>
/// Filter the cards by ban list.
/// </summary>
public string BanList { get; set; }
/// <summary>
/// Sort the order of the cards.
/// </summary>
public string Sort { get; set; }
/// <summary>
/// Filter the cards by Language.
/// </summary>
public string La { get; set; }
}
}
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Microsoft.Extensions.Http.Polly (>= 2.2.0)
- Newtonsoft.Json (>= 12.0.1)
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 |
|---|---|---|
| 1.1.1-develop | 611 | 4/6/2019 |
| 1.1.0-develop | 580 | 4/6/2019 |
| 1.0.0 | 842 | 4/6/2019 |
| 1.0.0-develop | 612 | 3/17/2019 |