Skip to content

Commit 224245c

Browse files
Updated to keep APIs under single TTXClient (#1)
1 parent 89d4aa7 commit 224245c

12 files changed

Lines changed: 4413 additions & 113 deletions

File tree

.openapi-generator/FILES

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ docs/CreatorPartialDtoPaginationDto.md
1111
docs/CreatorRarityDto.md
1212
docs/CreatorShareDto.md
1313
docs/CreatorTransactionDto.md
14-
docs/CreatorsApi.md
1514
docs/DiscordTokenDto.md
1615
docs/LinkDiscordTwitchDto.md
1716
docs/LootBoxDto.md
@@ -25,15 +24,13 @@ docs/PlayerPartialDto.md
2524
docs/PlayerShareDto.md
2625
docs/PlayerTransactionDto.md
2726
docs/PlayerType.md
28-
docs/PlayersApi.md
2927
docs/PortfolioSnapshotDto.md
3028
docs/Rarity.md
31-
docs/SessionsApi.md
3229
docs/StreamStatusDto.md
30+
docs/TTXClientApi.md
3331
docs/TimeStep.md
3432
docs/TokenDto.md
3533
docs/TransactionAction.md
36-
docs/TransactionsApi.md
3734
docs/TwitchUserDto.md
3835
docs/VoteDto.md
3936
git_push.sh
@@ -43,46 +40,10 @@ setup.cfg
4340
setup.py
4441
test-requirements.txt
4542
test/__init__.py
46-
test/test_create_transaction_dto.py
47-
test/test_creator_dto.py
48-
test/test_creator_order_by.py
49-
test/test_creator_partial_dto.py
50-
test/test_creator_partial_dto_pagination_dto.py
51-
test/test_creator_rarity_dto.py
52-
test/test_creator_share_dto.py
53-
test/test_creator_transaction_dto.py
54-
test/test_creators_api.py
55-
test/test_discord_token_dto.py
56-
test/test_link_discord_twitch_dto.py
57-
test/test_loot_box_dto.py
58-
test/test_loot_box_result_dto.py
59-
test/test_model_id.py
60-
test/test_order_direction.py
61-
test/test_player_dto.py
62-
test/test_player_dto_pagination_dto.py
63-
test/test_player_order_by.py
64-
test/test_player_partial_dto.py
65-
test/test_player_share_dto.py
66-
test/test_player_transaction_dto.py
67-
test/test_player_type.py
68-
test/test_players_api.py
69-
test/test_portfolio_snapshot_dto.py
70-
test/test_rarity.py
71-
test/test_sessions_api.py
72-
test/test_stream_status_dto.py
73-
test/test_time_step.py
74-
test/test_token_dto.py
75-
test/test_transaction_action.py
76-
test/test_transactions_api.py
77-
test/test_twitch_user_dto.py
78-
test/test_vote_dto.py
7943
tox.ini
8044
ttx/__init__.py
8145
ttx/api/__init__.py
82-
ttx/api/creators_api.py
83-
ttx/api/players_api.py
84-
ttx/api/sessions_api.py
85-
ttx/api/transactions_api.py
46+
ttx/api/ttx_client_api.py
8647
ttx/api_client.py
8748
ttx/api_response.py
8849
ttx/configuration.py

README.md

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
# Python API wrapper for TTX
1+
# ttx
22

3-
## Requirements.
3+
TTX API Wrapper
4+
5+
## Requirements
46

57
Python 3.9+
68

79
## Installation & Usage
10+
811
### pip install
912

1013
If the python package is hosted on a repository, you can install directly using:
1114

1215
```sh
1316
pip install git+https://github.com/ttxdev/ttx.py.git
1417
```
18+
1519
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/ttxdev/ttx.py.git`)
1620

1721
Then import the package:
22+
1823
```python
1924
import ttx
2025
```
@@ -26,9 +31,11 @@ Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
2631
```sh
2732
python setup.py install --user
2833
```
34+
2935
(or `sudo python setup.py install` to install the package for all users)
3036

3137
Then import the package:
38+
3239
```python
3340
import ttx
3441
```
@@ -58,16 +65,16 @@ configuration = ttx.Configuration(
5865
# Enter a context with an instance of the API client
5966
with ttx.ApiClient(configuration) as api_client:
6067
# Create an instance of the API class
61-
api_instance = ttx.CreatorsApi(api_client)
68+
api_instance = ttx.TTXClientApi(api_client)
6269
username = 'username_example' # str | (optional)
6370
ticker = 'ticker_example' # str | (optional)
6471

6572
try:
6673
api_response = api_instance.create_creator(username=username, ticker=ticker)
67-
print("The response of CreatorsApi->create_creator:\n")
74+
print("The response of TTXClientApi->create_creator:\n")
6875
pprint(api_response)
6976
except ApiException as e:
70-
print("Exception when calling CreatorsApi->create_creator: %s\n" % e)
77+
print("Exception when calling TTXClientApi->create_creator: %s\n" % e)
7178

7279
```
7380

@@ -77,61 +84,57 @@ All URIs are relative to *http://localhost*
7784

7885
Class | Method | HTTP request | Description
7986
------------ | ------------- | ------------- | -------------
80-
*CreatorsApi* | [**create_creator**](docs/CreatorsApi.md#create_creator) | **POST** /creators |
81-
*CreatorsApi* | [**get_creator**](docs/CreatorsApi.md#get_creator) | **GET** /creators/{slug} |
82-
*CreatorsApi* | [**get_creator_transactions**](docs/CreatorsApi.md#get_creator_transactions) | **GET** /creators/{creatorSlug}/transactions |
83-
*CreatorsApi* | [**get_creators**](docs/CreatorsApi.md#get_creators) | **GET** /creators |
84-
*PlayersApi* | [**gamba**](docs/PlayersApi.md#gamba) | **PUT** /players/me/lootboxes/{lootBoxId}/open |
85-
*PlayersApi* | [**get_player**](docs/PlayersApi.md#get_player) | **GET** /players/{username} |
86-
*PlayersApi* | [**get_players**](docs/PlayersApi.md#get_players) | **GET** /players |
87-
*PlayersApi* | [**get_self**](docs/PlayersApi.md#get_self) | **GET** /players/me |
88-
*SessionsApi* | [**discord_callback**](docs/SessionsApi.md#discord_callback) | **GET** /sessions/discord/callback |
89-
*SessionsApi* | [**link_discord_twitch**](docs/SessionsApi.md#link_discord_twitch) | **POST** /sessions/discord/link |
90-
*SessionsApi* | [**twitch_callback**](docs/SessionsApi.md#twitch_callback) | **GET** /sessions/twitch/callback |
91-
*TransactionsApi* | [**place_order**](docs/TransactionsApi.md#place_order) | **POST** /transactions |
92-
87+
*TTXClientApi* | [**create_creator**](docs/TTXClientApi.md#create_creator) | **POST** /creators |
88+
*TTXClientApi* | [**discord_callback**](docs/TTXClientApi.md#discord_callback) | **GET** /sessions/discord/callback |
89+
*TTXClientApi* | [**gamba**](docs/TTXClientApi.md#gamba) | **PUT** /players/me/lootboxes/{lootBoxId}/open |
90+
*TTXClientApi* | [**get_creator**](docs/TTXClientApi.md#get_creator) | **GET** /creators/{slug} |
91+
*TTXClientApi* | [**get_creator_transactions**](docs/TTXClientApi.md#get_creator_transactions) | **GET** /creators/{creatorSlug}/transactions |
92+
*TTXClientApi* | [**get_creators**](docs/TTXClientApi.md#get_creators) | **GET** /creators |
93+
*TTXClientApi* | [**get_player**](docs/TTXClientApi.md#get_player) | **GET** /players/{username} |
94+
*TTXClientApi* | [**get_players**](docs/TTXClientApi.md#get_players) | **GET** /players |
95+
*TTXClientApi* | [**get_self**](docs/TTXClientApi.md#get_self) | **GET** /players/me |
96+
*TTXClientApi* | [**link_discord_twitch**](docs/TTXClientApi.md#link_discord_twitch) | **POST** /sessions/discord/link |
97+
*TTXClientApi* | [**place_order**](docs/TTXClientApi.md#place_order) | **POST** /transactions |
98+
*TTXClientApi* | [**twitch_callback**](docs/TTXClientApi.md#twitch_callback) | **GET** /sessions/twitch/callback |
9399

94100
## Documentation For Models
95101

96-
- [CreateTransactionDto](docs/CreateTransactionDto.md)
97-
- [CreatorDto](docs/CreatorDto.md)
98-
- [CreatorOrderBy](docs/CreatorOrderBy.md)
99-
- [CreatorPartialDto](docs/CreatorPartialDto.md)
100-
- [CreatorPartialDtoPaginationDto](docs/CreatorPartialDtoPaginationDto.md)
101-
- [CreatorRarityDto](docs/CreatorRarityDto.md)
102-
- [CreatorShareDto](docs/CreatorShareDto.md)
103-
- [CreatorTransactionDto](docs/CreatorTransactionDto.md)
104-
- [DiscordTokenDto](docs/DiscordTokenDto.md)
105-
- [LinkDiscordTwitchDto](docs/LinkDiscordTwitchDto.md)
106-
- [LootBoxDto](docs/LootBoxDto.md)
107-
- [LootBoxResultDto](docs/LootBoxResultDto.md)
108-
- [ModelId](docs/ModelId.md)
109-
- [OrderDirection](docs/OrderDirection.md)
110-
- [PlayerDto](docs/PlayerDto.md)
111-
- [PlayerDtoPaginationDto](docs/PlayerDtoPaginationDto.md)
112-
- [PlayerOrderBy](docs/PlayerOrderBy.md)
113-
- [PlayerPartialDto](docs/PlayerPartialDto.md)
114-
- [PlayerShareDto](docs/PlayerShareDto.md)
115-
- [PlayerTransactionDto](docs/PlayerTransactionDto.md)
116-
- [PlayerType](docs/PlayerType.md)
117-
- [PortfolioSnapshotDto](docs/PortfolioSnapshotDto.md)
118-
- [Rarity](docs/Rarity.md)
119-
- [StreamStatusDto](docs/StreamStatusDto.md)
120-
- [TimeStep](docs/TimeStep.md)
121-
- [TokenDto](docs/TokenDto.md)
122-
- [TransactionAction](docs/TransactionAction.md)
123-
- [TwitchUserDto](docs/TwitchUserDto.md)
124-
- [VoteDto](docs/VoteDto.md)
125-
102+
- [CreateTransactionDto](docs/CreateTransactionDto.md)
103+
- [CreatorDto](docs/CreatorDto.md)
104+
- [CreatorOrderBy](docs/CreatorOrderBy.md)
105+
- [CreatorPartialDto](docs/CreatorPartialDto.md)
106+
- [CreatorPartialDtoPaginationDto](docs/CreatorPartialDtoPaginationDto.md)
107+
- [CreatorRarityDto](docs/CreatorRarityDto.md)
108+
- [CreatorShareDto](docs/CreatorShareDto.md)
109+
- [CreatorTransactionDto](docs/CreatorTransactionDto.md)
110+
- [DiscordTokenDto](docs/DiscordTokenDto.md)
111+
- [LinkDiscordTwitchDto](docs/LinkDiscordTwitchDto.md)
112+
- [LootBoxDto](docs/LootBoxDto.md)
113+
- [LootBoxResultDto](docs/LootBoxResultDto.md)
114+
- [ModelId](docs/ModelId.md)
115+
- [OrderDirection](docs/OrderDirection.md)
116+
- [PlayerDto](docs/PlayerDto.md)
117+
- [PlayerDtoPaginationDto](docs/PlayerDtoPaginationDto.md)
118+
- [PlayerOrderBy](docs/PlayerOrderBy.md)
119+
- [PlayerPartialDto](docs/PlayerPartialDto.md)
120+
- [PlayerShareDto](docs/PlayerShareDto.md)
121+
- [PlayerTransactionDto](docs/PlayerTransactionDto.md)
122+
- [PlayerType](docs/PlayerType.md)
123+
- [PortfolioSnapshotDto](docs/PortfolioSnapshotDto.md)
124+
- [Rarity](docs/Rarity.md)
125+
- [StreamStatusDto](docs/StreamStatusDto.md)
126+
- [TimeStep](docs/TimeStep.md)
127+
- [TokenDto](docs/TokenDto.md)
128+
- [TransactionAction](docs/TransactionAction.md)
129+
- [TwitchUserDto](docs/TwitchUserDto.md)
130+
- [VoteDto](docs/VoteDto.md)
126131

127132
<a id="documentation-for-authorization"></a>
133+
128134
## Documentation For Authorization
129135

130136
Endpoints do not require authorization.
131137

132-
133138
## Author
134139

135-
136-
137-
140+
[NathanRoberts55](https://github.com/nathanroberts55)

config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
generatorName: python
2+
inputSpec: https://api.ttx.gg/swagger/v1/swagger.json
3+
outputDir: .
4+
packageName: ttx
5+
packageVersion: 1.0.0
6+
projectName: ttx
7+
packageUrl: https://github.com/ttxdev/ttx.py
8+
gitHost: github.com
9+
gitUserId: ttxdev
10+
gitRepoId: ttx.py
11+
openapiNormalizer:
12+
SET_TAGS_FOR_ALL_OPERATIONS: TTXClient

0 commit comments

Comments
 (0)