PolyApi.Tools 0.1.8

dotnet tool install --global PolyApi.Tools --version 0.1.8
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local PolyApi.Tools --version 0.1.8
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=PolyApi.Tools&version=0.1.8
                    
nuke :add-package PolyApi.Tools --version 0.1.8
                    

polyapi-dotnet

Prerequisities

  1. Install .NET SDK 8.0
  2. Install following Add-Ons into VS Code (and restart VS Code):

(Optional) Boostrap console project

  1. create project folder
  2. go to the project folder
  3. Run: dotnet new console

Install PolyApi-Tools

  1. (Optional) - To instal the PolyApi-Tool locally we need to prepare manifest in project folder or any folder above it (so it can be shared with multiple projects). Details: https://learn.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use

    • Go to the foder where you want to crate manifest (e.g. project folder, root of your repository,..)
    • Run dotnet new tool-manifest command
  2. Install of update PolyApi-Tools using (this will install latest version)

    • Locally (with step 1): dotnet tool install PolyApi.Tools
    • Globally: dotnet tool install -g PolyApi.Tools

Use PolyApi-Tools

  1. (optional) Setup for local environment. This will write PolyApi BaseUrl and ApiKey into tools configuration.
    • Run: dotnet tool run polyapi setup
    • Enter configuration values
  2. Generate Client:
    • when configured using step 1. Run: dotnet tool run polyapi generate
    • when NOT configured using step 1. (e.g. in build pipelines ...) Run: dotnet tool run polyapi generate --BaseUrl={POLY INSTANCE BASE URL} --ApiKey={POLY API KEY}

Example

To test the setup, enter the following code into Program.cs (bootstrapped as described above) and run it using the dotnet run command:

using PolyApi.PolyContext;

var todos = await Poly.jsonPlaceholder.todos.getList();   

foreach (var todo in todos.Data)
{
    Console.WriteLine(@$"
    Title: {todo.Title} 
    ID: {todo.Id} 
    Completed: {todo.Completed}");
}
Product Compatible and additional computed target framework versions.
.NET 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.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.1.8 139 7/19/2024
0.1.2 155 6/28/2024
0.1.1 145 6/28/2024
0.1.0 135 6/27/2024