Skip to content

Commit 62e0216

Browse files
committed
Auto-generate SDK for CoinAPI Exchange Rates Realtime API REST Historical
1 parent 3f8b8eb commit 62e0216

File tree

1,116 files changed

+124045
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,116 files changed

+124045
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.openapi-generator-ignore
2+
config.gpr
3+
defaultpackage.gpr
4+
src/-client.adb
5+
src/.ads
6+
src/client/-clients.adb
7+
src/client/-clients.ads
8+
src/model/-models.adb
9+
src/model/-models.ads
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.13.0
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
abstract project Config is
2+
for Source_Dirs use ();
3+
4+
type Yes_No is ("yes", "no");
5+
6+
type Library_Type_Type is ("relocatable", "static", "static-pic");
7+
8+
type Build_Type is ("distrib", "debug", "optimize", "profile", "coverage");
9+
Mode : Build_Type := external ("BUILD", "debug");
10+
11+
Processors := External ("PROCESSORS", "1");
12+
13+
package Builder is
14+
for Default_Switches ("Ada") use ("-j" & Processors);
15+
end Builder;
16+
17+
package compiler is
18+
warnings := ("-gnatwua");
19+
defaults := ("-gnat2012");
20+
case Mode is
21+
when "distrib" =>
22+
for Default_Switches ("Ada") use defaults & ("-O2", "-gnatafno", "-gnatVa", "-gnatwa");
23+
24+
when "debug" =>
25+
for Default_Switches ("Ada") use defaults & warnings
26+
& ("-g", "-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127");
27+
28+
when "coverage" =>
29+
for Default_Switches ("Ada") use defaults & warnings
30+
& ("-g", "-O2", "-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127",
31+
"-fprofile-arcs", "-ftest-coverage");
32+
33+
when "optimize" =>
34+
for Default_Switches ("Ada") use defaults & warnings
35+
& ("-O2", "-gnatn", "-gnatp", "-fdata-sections", "-ffunction-sections");
36+
37+
when "profile" =>
38+
for Default_Switches ("Ada") use defaults & warnings & ("-pg");
39+
40+
end case;
41+
end compiler;
42+
43+
package binder is
44+
case Mode is
45+
when "debug" =>
46+
for Default_Switches ("Ada") use ("-E");
47+
48+
when others =>
49+
for Default_Switches ("Ada") use ("-E");
50+
51+
end case;
52+
end binder;
53+
54+
package linker is
55+
case Mode is
56+
when "profile" =>
57+
for Default_Switches ("Ada") use ("-pg");
58+
59+
when "distrib" =>
60+
for Default_Switches ("Ada") use ("-s");
61+
62+
when "optimize" =>
63+
for Default_Switches ("Ada") use ("-Wl,--gc-sections");
64+
65+
when "coverage" =>
66+
for Default_Switches ("ada") use ("-fprofile-arcs");
67+
68+
when others =>
69+
null;
70+
end case;
71+
72+
end linker;
73+
74+
package Ide is
75+
for VCS_Kind use "git";
76+
end Ide;
77+
78+
end Config;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- Exchange Rates Realtime REST API
2+
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
3+
-- The version of the OpenAPI document: 1.0.0
4+
--
5+
-- https://openapi-generator.tech
6+
--
7+
-- NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
with "config";
9+
with "utilada_sys";
10+
with "utilada_xml";
11+
with "utilada_curl";
12+
with "security";
13+
with "swagger";
14+
project defaultPackage is
15+
16+
for Object_Dir use "obj/";
17+
for Source_Dirs use ("src", "src/model", "src/client");
18+
Mains := ("-client.adb");
19+
20+
package Binder renames Config.Binder;
21+
package Builder renames Config.Builder;
22+
package Compiler renames Config.Compiler;
23+
package Linker renames Config.Linker;
24+
25+
end defaultPackage;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
-- ------------ EDIT NOTE ------------
2+
-- Exchange Rates Realtime REST API
3+
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4+
-- This file was generated with openapi-generator. You can modify it to implement
5+
-- the client. After you modify this file, you should add the following line
6+
-- to the .openapi-generator-ignore file:
7+
--
8+
-- src/.ads
9+
--
10+
-- Then, you can drop this edit note comment.
11+
-- ------------ EDIT NOTE ------------
12+
with .Clients;
13+
with .Models;
14+
with Swagger;
15+
with Swagger.Credentials.OAuth;
16+
with Util.Http.Clients.Curl;
17+
with Ada.Text_IO;
18+
with Ada.Command_Line;
19+
with Ada.Calendar.Formatting;
20+
with Ada.Exceptions;
21+
procedure .Client is
22+
23+
use Ada.Text_IO;
24+
25+
procedure Usage;
26+
27+
Server : constant Swagger.UString := Swagger.To_UString ("http://localhost:8080/v2");
28+
Arg_Count : constant Natural := Ada.Command_Line.Argument_Count;
29+
Arg : Positive := 1;
30+
31+
procedure Usage is
32+
begin
33+
Put_Line ("Usage: defaultPackage {params}...");
34+
end Usage;
35+
36+
begin
37+
if Arg_Count <= 1 then
38+
Usage;
39+
return;
40+
end if;
41+
Util.Http.Clients.Curl.Register;
42+
declare
43+
Command : constant String := Ada.Command_Line.Argument (Arg);
44+
Item : constant String := Ada.Command_Line.Argument (Arg + 1);
45+
Cred : aliased Swagger.Credentials.OAuth.OAuth2_Credential_Type;
46+
C : .Clients.Client_Type;
47+
begin
48+
C.Set_Server (Server);
49+
C.Set_Credentials (Cred'Unchecked_Access);
50+
Arg := Arg + 2;
51+
52+
exception
53+
when E : Constraint_Error =>
54+
Put_Line ("Constraint error raised: " & Ada.Exceptions.Exception_Message (E));
55+
56+
end;
57+
end .Client;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Exchange Rates Realtime REST API
2+
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
3+
-- ------------ EDIT NOTE ------------
4+
-- This file was generated with openapi-generator. You can modify it to implement
5+
-- the server. After you modify this file, you should add the following line
6+
-- to the .openapi-generator-ignore file:
7+
--
8+
-- src/.ads
9+
--
10+
-- Then, you can drop this edit note comment.
11+
-- ------------ EDIT NOTE ------------
12+
package is
13+
14+
end ;
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
-- Exchange Rates Realtime REST API
2+
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
3+
--
4+
-- The version of the OpenAPI document: v1
5+
-- Contact: [email protected]
6+
--
7+
-- NOTE: This package is auto generated by OpenAPI-Generator 7.13.0.
8+
-- https://openapi-generator.tech
9+
-- Do not edit the class manually.
10+
11+
pragma Warnings (Off, "*is not referenced");
12+
with Swagger.Streams;
13+
package body .Clients is
14+
pragma Style_Checks ("-bmrIu");
15+
16+
Mime_1 : aliased constant String := "application/x-msgpack";
17+
Mime_2 : aliased constant String := "text/json";
18+
Media_List_1 : constant Swagger.Mime_List := (
19+
1 => Swagger.Mime_Json,
20+
21+
2 => Mime_1'Access,
22+
23+
3 => Mime_2'Access,
24+
25+
4 => Swagger.Mime_Text );
26+
27+
28+
-- Get specific rate
29+
-- Retrieves the exchange rate for a specific base and quote asset at a given time or the current rate.
30+
--
31+
-- :::info
32+
-- If you are using an exchange rate for mission-critical operations, then for best reliability, you should measure the difference between current time and the time returned from the response to ensure that value of the difference between those meets your internal requirements.
33+
-- :::
34+
procedure Get_Specific_Rate
35+
(Client : in out Client_Type;
36+
Asset_Id_Base : in Swagger.UString;
37+
Asset_Id_Quote : in Swagger.UString;
38+
Result : out .Models.V1ExchangeRate_Type) is
39+
URI : Swagger.Clients.URI_Type;
40+
Reply : Swagger.Value_Type;
41+
begin
42+
Client.Set_Accept (Media_List_1);
43+
44+
45+
URI.Set_Path ("/v1/exchangerate/{asset_id_base}/{asset_id_quote}");
46+
URI.Set_Path_Param ("asset_id_base", Asset_Id_Base);
47+
URI.Set_Path_Param ("asset_id_quote", Asset_Id_Quote);
48+
Client.Call (Swagger.Clients.GET, URI, Reply);
49+
.Models.Deserialize (Reply, "", Result);
50+
end Get_Specific_Rate;
51+
52+
-- Get all current rates
53+
-- Get the current exchange rate between requested asset and all other assets.
54+
--
55+
-- :::info
56+
-- If you are using an exchange rate for mission-critical operations, then for best reliability, you should measure the difference between current time and the time returned from the response to ensure that value of the difference between those meets your internal requirements.
57+
-- :::
58+
--
59+
-- :::info
60+
-- You can invert the rates by using Y = 1 / X equation, for example BTC/USD = 1 / (USD/BTC);
61+
-- :::
62+
procedure V_1Exchangerate_Asset_Id_Base_Get
63+
(Client : in out Client_Type;
64+
Asset_Id_Base : in Swagger.UString;
65+
Filter_Asset_Id : in Swagger.Nullable_UString;
66+
Invert : in Swagger.Nullable_Boolean;
67+
Result : out .Models.V1ExchangeRates_Type) is
68+
URI : Swagger.Clients.URI_Type;
69+
Reply : Swagger.Value_Type;
70+
begin
71+
Client.Set_Accept (Media_List_1);
72+
73+
74+
URI.Add_Param ("filter_asset_id", Filter_Asset_Id);
75+
URI.Add_Param ("invert", Invert);
76+
URI.Set_Path ("/v1/exchangerate/{asset_id_base}");
77+
URI.Set_Path_Param ("asset_id_base", Asset_Id_Base);
78+
Client.Call (Swagger.Clients.GET, URI, Reply);
79+
.Models.Deserialize (Reply, "", Result);
80+
end V_1Exchangerate_Asset_Id_Base_Get;
81+
82+
-- List all assets by asset ID
83+
procedure V_1Assets_Asset_Id_Get
84+
(Client : in out Client_Type;
85+
Asset_Id : in Swagger.UString;
86+
Result : out .Models.V1Asset_Type_Vectors.Vector) is
87+
URI : Swagger.Clients.URI_Type;
88+
Reply : Swagger.Value_Type;
89+
begin
90+
Client.Set_Accept (Media_List_1);
91+
92+
93+
URI.Set_Path ("/v1/assets/{asset_id}");
94+
URI.Set_Path_Param ("asset_id", Asset_Id);
95+
Client.Call (Swagger.Clients.GET, URI, Reply);
96+
.Models.Deserialize (Reply, "", Result);
97+
end V_1Assets_Asset_Id_Get;
98+
99+
-- List all assets
100+
-- Retrieves all assets.
101+
--
102+
-- :::info
103+
-- Our asset identifiers are aligned with the ISO 4217 currency codes standard only for fiat money (government or law regulated currency).
104+
-- :::
105+
--
106+
-- :::info
107+
-- Properties of the output are providing aggregated information from across all symbols related to the specific asset. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source.
108+
-- :::
109+
procedure V_1Assets_Get
110+
(Client : in out Client_Type;
111+
Filter_Asset_Id : in Swagger.Nullable_UString;
112+
Result : out .Models.V1Asset_Type_Vectors.Vector) is
113+
URI : Swagger.Clients.URI_Type;
114+
Reply : Swagger.Value_Type;
115+
begin
116+
Client.Set_Accept (Media_List_1);
117+
118+
119+
URI.Add_Param ("filter_asset_id", Filter_Asset_Id);
120+
URI.Set_Path ("/v1/assets");
121+
Client.Call (Swagger.Clients.GET, URI, Reply);
122+
.Models.Deserialize (Reply, "", Result);
123+
end V_1Assets_Get;
124+
125+
-- List all asset icons
126+
-- Gets the list of icons (of the given size) for all the assets.
127+
procedure V_1Assets_Icons_Size_Get
128+
(Client : in out Client_Type;
129+
Size : in Integer;
130+
Result : out .Models.V1Icon_Type_Vectors.Vector) is
131+
URI : Swagger.Clients.URI_Type;
132+
Reply : Swagger.Value_Type;
133+
begin
134+
Client.Set_Accept (Media_List_1);
135+
136+
137+
URI.Set_Path ("/v1/assets/icons/{size}");
138+
URI.Set_Path_Param ("size", .Models.To_String (Size));
139+
Client.Call (Swagger.Clients.GET, URI, Reply);
140+
.Models.Deserialize (Reply, "", Result);
141+
end V_1Assets_Icons_Size_Get;
142+
end .Clients;

0 commit comments

Comments
 (0)