diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c044bef..c5bfabe 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,76 +2,91 @@ .gitignore .gitlab-ci.yml README.md -docs/Authentification200Response.md -docs/Authentification401Response.md -docs/AuthentificationApi.md -docs/AuthentificationRequest.md -docs/Folder200Response.md -docs/Folder200ResponseFoldersInner.md -docs/FolderApi.md -docs/FolderRequest.md -docs/LinkApi.md -docs/ReduceLink200Response.md -docs/ReduceLink400Response.md -docs/ReduceLinkRequest.md -docs/Stats200Response.md -docs/Stats400Response.md -docs/StatsApi.md -docs/StatsRequest.md -docs/Team200Response.md -docs/Team200ResponseTeamsInner.md -docs/TeamApi.md +docs/AccessTokensApi.md +docs/CreateAccessToken200Response.md +docs/CreateAccessToken401Response.md +docs/CreateAccessTokenRequest.md +docs/CreateLink201Response.md +docs/CreateLink429Response.md +docs/CreateLink500Response.md +docs/CreateLinkRequest.md +docs/FoldersApi.md +docs/GetFolders200Response.md +docs/GetFolders200ResponseFoldersInner.md +docs/GetLink200Response.md +docs/GetLink401Response.md +docs/GetLink404Response.md +docs/GetLink422Response.md +docs/GetStatistics200Response.md +docs/GetStatisticsRequest.md +docs/GetTeams200Response.md +docs/GetTeams200ResponseTeamsInner.md +docs/LinksApi.md +docs/RefreshAccessToken401Response.md +docs/RefreshAccessTokenRequest.md +docs/StatisticsApi.md +docs/TeamsApi.md pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_authentification200_response.py -test/test_authentification401_response.py -test/test_authentification_api.py -test/test_authentification_request.py -test/test_folder200_response.py -test/test_folder200_response_folders_inner.py -test/test_folder_api.py -test/test_folder_request.py -test/test_link_api.py -test/test_reduce_link200_response.py -test/test_reduce_link400_response.py -test/test_reduce_link_request.py -test/test_stats200_response.py -test/test_stats400_response.py -test/test_stats_api.py -test/test_stats_request.py -test/test_team200_response.py -test/test_team200_response_teams_inner.py -test/test_team_api.py +test/test_access_tokens_api.py +test/test_create_access_token200_response.py +test/test_create_access_token401_response.py +test/test_create_access_token_request.py +test/test_create_link201_response.py +test/test_create_link429_response.py +test/test_create_link500_response.py +test/test_create_link_request.py +test/test_folders_api.py +test/test_get_folders200_response.py +test/test_get_folders200_response_folders_inner.py +test/test_get_link200_response.py +test/test_get_link401_response.py +test/test_get_link404_response.py +test/test_get_link422_response.py +test/test_get_statistics200_response.py +test/test_get_statistics_request.py +test/test_get_teams200_response.py +test/test_get_teams200_response_teams_inner.py +test/test_links_api.py +test/test_refresh_access_token401_response.py +test/test_refresh_access_token_request.py +test/test_statistics_api.py +test/test_teams_api.py tox.ini urlr/__init__.py urlr/api/__init__.py -urlr/api/authentification_api.py -urlr/api/folder_api.py -urlr/api/link_api.py -urlr/api/stats_api.py -urlr/api/team_api.py +urlr/api/access_tokens_api.py +urlr/api/folders_api.py +urlr/api/links_api.py +urlr/api/statistics_api.py +urlr/api/teams_api.py urlr/api_client.py urlr/api_response.py urlr/configuration.py urlr/exceptions.py urlr/models/__init__.py -urlr/models/authentification200_response.py -urlr/models/authentification401_response.py -urlr/models/authentification_request.py -urlr/models/folder200_response.py -urlr/models/folder200_response_folders_inner.py -urlr/models/folder_request.py -urlr/models/reduce_link200_response.py -urlr/models/reduce_link400_response.py -urlr/models/reduce_link_request.py -urlr/models/stats200_response.py -urlr/models/stats400_response.py -urlr/models/stats_request.py -urlr/models/team200_response.py -urlr/models/team200_response_teams_inner.py +urlr/models/create_access_token200_response.py +urlr/models/create_access_token401_response.py +urlr/models/create_access_token_request.py +urlr/models/create_link201_response.py +urlr/models/create_link429_response.py +urlr/models/create_link500_response.py +urlr/models/create_link_request.py +urlr/models/get_folders200_response.py +urlr/models/get_folders200_response_folders_inner.py +urlr/models/get_link200_response.py +urlr/models/get_link401_response.py +urlr/models/get_link404_response.py +urlr/models/get_link422_response.py +urlr/models/get_statistics200_response.py +urlr/models/get_statistics_request.py +urlr/models/get_teams200_response.py +urlr/models/get_teams200_response_teams_inner.py +urlr/models/refresh_access_token401_response.py +urlr/models/refresh_access_token_request.py urlr/py.typed urlr/rest.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 18bb418..93c8dda 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.6.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ae7cc4..679c42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.0.0] - 2024-05-29 + +- Updated URLR API version to 1.0 +- Updated to OpenAPI Generator 7.6.0 + ## [1.2.0] - 2024-04-02 - Updated URLR API version to 0.4 diff --git a/README.md b/README.md index c240e34..055880d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# urlr@1.2.0 +# urlr@2.0.0 ![PyPI - Version](https://img.shields.io/pypi/v/urlr) ![PyPI - Downloads](https://img.shields.io/pypi/dm/urlr) ![PyPI - License](https://img.shields.io/pypi/l/urlr) This SDK is automatically generated with the [OpenAPI Generator](https://openapi-generator.tech) project. -- API version: 0.3 -- Package version: 1.2.0 +- API version: 1.0 +- Package version: 2.0.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://urlr.me/en](https://urlr.me/en) @@ -89,33 +89,40 @@ A complete example is [available here](examples/example1.py). ## API Endpoints -All URIs are relative to *https://urlr.me/api* +All URIs are relative to *https://urlr.me/api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AuthentificationApi* | [**authentification**](docs/AuthentificationApi.md#authentification) | **POST** /login_check | Get an access token -*FolderApi* | [**folder**](docs/FolderApi.md#folder) | **GET** /folder | Get folders of team -*LinkApi* | [**reduce_link**](docs/LinkApi.md#reduce_link) | **POST** /reduce-link | Shorten a link -*StatsApi* | [**stats**](docs/StatsApi.md#stats) | **POST** /stats | Get statistics of a link -*TeamApi* | [**team**](docs/TeamApi.md#team) | **GET** /team | Get teams of user +*AccessTokensApi* | [**create_access_token**](docs/AccessTokensApi.md#create_access_token) | **POST** /access_tokens/create | Get an access token +*AccessTokensApi* | [**refresh_access_token**](docs/AccessTokensApi.md#refresh_access_token) | **POST** /access_tokens/refresh | Refresh an access token +*FoldersApi* | [**get_folders**](docs/FoldersApi.md#get_folders) | **GET** /folders/{team_id} | Get folders of team +*LinksApi* | [**create_link**](docs/LinksApi.md#create_link) | **POST** /links/create | Create a link +*LinksApi* | [**get_link**](docs/LinksApi.md#get_link) | **GET** /links/{link_id} | Get a link +*StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **POST** /statistics | Get statistics of a link +*TeamsApi* | [**get_teams**](docs/TeamsApi.md#get_teams) | **GET** /teams | Get teams of user ## Models - - [Authentification200Response](docs/Authentification200Response.md) - - [Authentification401Response](docs/Authentification401Response.md) - - [AuthentificationRequest](docs/AuthentificationRequest.md) - - [Folder200Response](docs/Folder200Response.md) - - [Folder200ResponseFoldersInner](docs/Folder200ResponseFoldersInner.md) - - [FolderRequest](docs/FolderRequest.md) - - [ReduceLink200Response](docs/ReduceLink200Response.md) - - [ReduceLink400Response](docs/ReduceLink400Response.md) - - [ReduceLinkRequest](docs/ReduceLinkRequest.md) - - [Stats200Response](docs/Stats200Response.md) - - [Stats400Response](docs/Stats400Response.md) - - [StatsRequest](docs/StatsRequest.md) - - [Team200Response](docs/Team200Response.md) - - [Team200ResponseTeamsInner](docs/Team200ResponseTeamsInner.md) + - [CreateAccessToken200Response](docs/CreateAccessToken200Response.md) + - [CreateAccessToken401Response](docs/CreateAccessToken401Response.md) + - [CreateAccessTokenRequest](docs/CreateAccessTokenRequest.md) + - [CreateLink201Response](docs/CreateLink201Response.md) + - [CreateLink429Response](docs/CreateLink429Response.md) + - [CreateLink500Response](docs/CreateLink500Response.md) + - [CreateLinkRequest](docs/CreateLinkRequest.md) + - [GetFolders200Response](docs/GetFolders200Response.md) + - [GetFolders200ResponseFoldersInner](docs/GetFolders200ResponseFoldersInner.md) + - [GetLink200Response](docs/GetLink200Response.md) + - [GetLink401Response](docs/GetLink401Response.md) + - [GetLink404Response](docs/GetLink404Response.md) + - [GetLink422Response](docs/GetLink422Response.md) + - [GetStatistics200Response](docs/GetStatistics200Response.md) + - [GetStatisticsRequest](docs/GetStatisticsRequest.md) + - [GetTeams200Response](docs/GetTeams200Response.md) + - [GetTeams200ResponseTeamsInner](docs/GetTeams200ResponseTeamsInner.md) + - [RefreshAccessToken401Response](docs/RefreshAccessToken401Response.md) + - [RefreshAccessTokenRequest](docs/RefreshAccessTokenRequest.md) diff --git a/docs/AccessTokensApi.md b/docs/AccessTokensApi.md new file mode 100644 index 0000000..d878afe --- /dev/null +++ b/docs/AccessTokensApi.md @@ -0,0 +1,146 @@ +# urlr.AccessTokensApi + +All URIs are relative to *https://urlr.me/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_access_token**](AccessTokensApi.md#create_access_token) | **POST** /access_tokens/create | Get an access token +[**refresh_access_token**](AccessTokensApi.md#refresh_access_token) | **POST** /access_tokens/refresh | Refresh an access token + + +# **create_access_token** +> CreateAccessToken200Response create_access_token(create_access_token_request=create_access_token_request) + +Get an access token + +### Example + + +```python +import urlr +from urlr.models.create_access_token200_response import CreateAccessToken200Response +from urlr.models.create_access_token_request import CreateAccessTokenRequest +from urlr.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://urlr.me/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = urlr.Configuration( + host = "https://urlr.me/api/v1" +) + + +# Enter a context with an instance of the API client +with urlr.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = urlr.AccessTokensApi(api_client) + create_access_token_request = urlr.CreateAccessTokenRequest() # CreateAccessTokenRequest | Your credentials (optional) + + try: + # Get an access token + api_response = api_instance.create_access_token(create_access_token_request=create_access_token_request) + print("The response of AccessTokensApi->create_access_token:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccessTokensApi->create_access_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_access_token_request** | [**CreateAccessTokenRequest**](CreateAccessTokenRequest.md)| Your credentials | [optional] + +### Return type + +[**CreateAccessToken200Response**](CreateAccessToken200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Access token | - | +**401** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **refresh_access_token** +> CreateAccessToken200Response refresh_access_token(refresh_access_token_request=refresh_access_token_request) + +Refresh an access token + +### Example + + +```python +import urlr +from urlr.models.create_access_token200_response import CreateAccessToken200Response +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest +from urlr.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://urlr.me/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = urlr.Configuration( + host = "https://urlr.me/api/v1" +) + + +# Enter a context with an instance of the API client +with urlr.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = urlr.AccessTokensApi(api_client) + refresh_access_token_request = urlr.RefreshAccessTokenRequest() # RefreshAccessTokenRequest | Your credentials (optional) + + try: + # Refresh an access token + api_response = api_instance.refresh_access_token(refresh_access_token_request=refresh_access_token_request) + print("The response of AccessTokensApi->refresh_access_token:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccessTokensApi->refresh_access_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **refresh_access_token_request** | [**RefreshAccessTokenRequest**](RefreshAccessTokenRequest.md)| Your credentials | [optional] + +### Return type + +[**CreateAccessToken200Response**](CreateAccessToken200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Refreshed access token | - | +**401** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Authentification200Response.md b/docs/Authentification200Response.md deleted file mode 100644 index 9d4eec0..0000000 --- a/docs/Authentification200Response.md +++ /dev/null @@ -1,29 +0,0 @@ -# Authentification200Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | **str** | | [optional] - -## Example - -```python -from urlr.models.authentification200_response import Authentification200Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Authentification200Response from a JSON string -authentification200_response_instance = Authentification200Response.from_json(json) -# print the JSON string representation of the object -print(Authentification200Response.to_json()) - -# convert the object into a dict -authentification200_response_dict = authentification200_response_instance.to_dict() -# create an instance of Authentification200Response from a dict -authentification200_response_from_dict = Authentification200Response.from_dict(authentification200_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Authentification401Response.md b/docs/Authentification401Response.md deleted file mode 100644 index 4c9d994..0000000 --- a/docs/Authentification401Response.md +++ /dev/null @@ -1,30 +0,0 @@ -# Authentification401Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**message** | **str** | | [optional] - -## Example - -```python -from urlr.models.authentification401_response import Authentification401Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Authentification401Response from a JSON string -authentification401_response_instance = Authentification401Response.from_json(json) -# print the JSON string representation of the object -print(Authentification401Response.to_json()) - -# convert the object into a dict -authentification401_response_dict = authentification401_response_instance.to_dict() -# create an instance of Authentification401Response from a dict -authentification401_response_from_dict = Authentification401Response.from_dict(authentification401_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AuthentificationApi.md b/docs/AuthentificationApi.md deleted file mode 100644 index 3e21da9..0000000 --- a/docs/AuthentificationApi.md +++ /dev/null @@ -1,77 +0,0 @@ -# urlr.AuthentificationApi - -All URIs are relative to *https://urlr.me/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**authentification**](AuthentificationApi.md#authentification) | **POST** /login_check | Get an access token - - -# **authentification** -> Authentification200Response authentification(authentification_request=authentification_request) - -Get an access token - -### Example - - -```python -import urlr -from urlr.models.authentification200_response import Authentification200Response -from urlr.models.authentification_request import AuthentificationRequest -from urlr.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://urlr.me/api -# See configuration.py for a list of all supported configuration parameters. -configuration = urlr.Configuration( - host = "https://urlr.me/api" -) - - -# Enter a context with an instance of the API client -with urlr.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = urlr.AuthentificationApi(api_client) - authentification_request = urlr.AuthentificationRequest() # AuthentificationRequest | Your credentials (optional) - - try: - # Get an access token - api_response = api_instance.authentification(authentification_request=authentification_request) - print("The response of AuthentificationApi->authentification:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AuthentificationApi->authentification: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **authentification_request** | [**AuthentificationRequest**](AuthentificationRequest.md)| Your credentials | [optional] - -### Return type - -[**Authentification200Response**](Authentification200Response.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Your token is ready! | - | -**401** | Invalid credentials | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/AuthentificationRequest.md b/docs/AuthentificationRequest.md deleted file mode 100644 index 94eacc1..0000000 --- a/docs/AuthentificationRequest.md +++ /dev/null @@ -1,30 +0,0 @@ -# AuthentificationRequest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Email | [optional] -**password** | **str** | Password | [optional] - -## Example - -```python -from urlr.models.authentification_request import AuthentificationRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of AuthentificationRequest from a JSON string -authentification_request_instance = AuthentificationRequest.from_json(json) -# print the JSON string representation of the object -print(AuthentificationRequest.to_json()) - -# convert the object into a dict -authentification_request_dict = authentification_request_instance.to_dict() -# create an instance of AuthentificationRequest from a dict -authentification_request_from_dict = AuthentificationRequest.from_dict(authentification_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateAccessToken200Response.md b/docs/CreateAccessToken200Response.md new file mode 100644 index 0000000..0c6967e --- /dev/null +++ b/docs/CreateAccessToken200Response.md @@ -0,0 +1,30 @@ +# CreateAccessToken200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | Access token (JWT) valid for 1 hour | [optional] +**refresh_token** | **str** | Refresh token valid for 1 month | [optional] + +## Example + +```python +from urlr.models.create_access_token200_response import CreateAccessToken200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAccessToken200Response from a JSON string +create_access_token200_response_instance = CreateAccessToken200Response.from_json(json) +# print the JSON string representation of the object +print(CreateAccessToken200Response.to_json()) + +# convert the object into a dict +create_access_token200_response_dict = create_access_token200_response_instance.to_dict() +# create an instance of CreateAccessToken200Response from a dict +create_access_token200_response_from_dict = CreateAccessToken200Response.from_dict(create_access_token200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateAccessToken401Response.md b/docs/CreateAccessToken401Response.md new file mode 100644 index 0000000..3e35bd0 --- /dev/null +++ b/docs/CreateAccessToken401Response.md @@ -0,0 +1,30 @@ +# CreateAccessToken401Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**message** | **str** | | [optional] + +## Example + +```python +from urlr.models.create_access_token401_response import CreateAccessToken401Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAccessToken401Response from a JSON string +create_access_token401_response_instance = CreateAccessToken401Response.from_json(json) +# print the JSON string representation of the object +print(CreateAccessToken401Response.to_json()) + +# convert the object into a dict +create_access_token401_response_dict = create_access_token401_response_instance.to_dict() +# create an instance of CreateAccessToken401Response from a dict +create_access_token401_response_from_dict = CreateAccessToken401Response.from_dict(create_access_token401_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateAccessTokenRequest.md b/docs/CreateAccessTokenRequest.md new file mode 100644 index 0000000..56a918a --- /dev/null +++ b/docs/CreateAccessTokenRequest.md @@ -0,0 +1,30 @@ +# CreateAccessTokenRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | Email | +**password** | **str** | Password | + +## Example + +```python +from urlr.models.create_access_token_request import CreateAccessTokenRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAccessTokenRequest from a JSON string +create_access_token_request_instance = CreateAccessTokenRequest.from_json(json) +# print the JSON string representation of the object +print(CreateAccessTokenRequest.to_json()) + +# convert the object into a dict +create_access_token_request_dict = create_access_token_request_instance.to_dict() +# create an instance of CreateAccessTokenRequest from a dict +create_access_token_request_from_dict = CreateAccessTokenRequest.from_dict(create_access_token_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateLink201Response.md b/docs/CreateLink201Response.md new file mode 100644 index 0000000..c5895fe --- /dev/null +++ b/docs/CreateLink201Response.md @@ -0,0 +1,38 @@ +# CreateLink201Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Link API ID | [optional] +**url** | **str** | Original URL | [optional] +**team** | **str** | Team API ID | [optional] +**folder_id** | **str** | Folder API ID | [optional] +**domain_id** | **str** | Domain | [optional] +**code** | **str** | Short code | [optional] +**label** | **str** | Label | [optional] +**created_at** | **datetime** | Creation date | [optional] +**updated_at** | **datetime** | Modification date | [optional] +**expired_at** | **datetime** | Expiration date | [optional] + +## Example + +```python +from urlr.models.create_link201_response import CreateLink201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLink201Response from a JSON string +create_link201_response_instance = CreateLink201Response.from_json(json) +# print the JSON string representation of the object +print(CreateLink201Response.to_json()) + +# convert the object into a dict +create_link201_response_dict = create_link201_response_instance.to_dict() +# create an instance of CreateLink201Response from a dict +create_link201_response_from_dict = CreateLink201Response.from_dict(create_link201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateLink429Response.md b/docs/CreateLink429Response.md new file mode 100644 index 0000000..e4b3f15 --- /dev/null +++ b/docs/CreateLink429Response.md @@ -0,0 +1,32 @@ +# CreateLink429Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**title** | **str** | | [optional] +**status** | **int** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from urlr.models.create_link429_response import CreateLink429Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLink429Response from a JSON string +create_link429_response_instance = CreateLink429Response.from_json(json) +# print the JSON string representation of the object +print(CreateLink429Response.to_json()) + +# convert the object into a dict +create_link429_response_dict = create_link429_response_instance.to_dict() +# create an instance of CreateLink429Response from a dict +create_link429_response_from_dict = CreateLink429Response.from_dict(create_link429_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateLink500Response.md b/docs/CreateLink500Response.md new file mode 100644 index 0000000..d84e69d --- /dev/null +++ b/docs/CreateLink500Response.md @@ -0,0 +1,32 @@ +# CreateLink500Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**title** | **str** | | [optional] +**status** | **int** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from urlr.models.create_link500_response import CreateLink500Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLink500Response from a JSON string +create_link500_response_instance = CreateLink500Response.from_json(json) +# print the JSON string representation of the object +print(CreateLink500Response.to_json()) + +# convert the object into a dict +create_link500_response_dict = create_link500_response_instance.to_dict() +# create an instance of CreateLink500Response from a dict +create_link500_response_from_dict = CreateLink500Response.from_dict(create_link500_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateLinkRequest.md b/docs/CreateLinkRequest.md new file mode 100644 index 0000000..12897bc --- /dev/null +++ b/docs/CreateLinkRequest.md @@ -0,0 +1,35 @@ +# CreateLinkRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | URL to shorten | +**team_id** | **str** | Team API ID | +**folder_id** | **str** | Folder API ID | [optional] +**code** | **str** | Custom short code | [optional] +**label** | **str** | Label | [optional] +**password** | **str** | Password | [optional] +**expired_at** | **datetime** | Expiration date | [optional] + +## Example + +```python +from urlr.models.create_link_request import CreateLinkRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLinkRequest from a JSON string +create_link_request_instance = CreateLinkRequest.from_json(json) +# print the JSON string representation of the object +print(CreateLinkRequest.to_json()) + +# convert the object into a dict +create_link_request_dict = create_link_request_instance.to_dict() +# create an instance of CreateLinkRequest from a dict +create_link_request_from_dict = CreateLinkRequest.from_dict(create_link_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Folder200Response.md b/docs/Folder200Response.md deleted file mode 100644 index beba50c..0000000 --- a/docs/Folder200Response.md +++ /dev/null @@ -1,29 +0,0 @@ -# Folder200Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**folders** | [**List[Folder200ResponseFoldersInner]**](Folder200ResponseFoldersInner.md) | | [optional] - -## Example - -```python -from urlr.models.folder200_response import Folder200Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Folder200Response from a JSON string -folder200_response_instance = Folder200Response.from_json(json) -# print the JSON string representation of the object -print(Folder200Response.to_json()) - -# convert the object into a dict -folder200_response_dict = folder200_response_instance.to_dict() -# create an instance of Folder200Response from a dict -folder200_response_from_dict = Folder200Response.from_dict(folder200_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Folder200ResponseFoldersInner.md b/docs/Folder200ResponseFoldersInner.md deleted file mode 100644 index 28d9185..0000000 --- a/docs/Folder200ResponseFoldersInner.md +++ /dev/null @@ -1,30 +0,0 @@ -# Folder200ResponseFoldersInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Folder ID | [optional] -**name** | **str** | Folder name | [optional] - -## Example - -```python -from urlr.models.folder200_response_folders_inner import Folder200ResponseFoldersInner - -# TODO update the JSON string below -json = "{}" -# create an instance of Folder200ResponseFoldersInner from a JSON string -folder200_response_folders_inner_instance = Folder200ResponseFoldersInner.from_json(json) -# print the JSON string representation of the object -print(Folder200ResponseFoldersInner.to_json()) - -# convert the object into a dict -folder200_response_folders_inner_dict = folder200_response_folders_inner_instance.to_dict() -# create an instance of Folder200ResponseFoldersInner from a dict -folder200_response_folders_inner_from_dict = Folder200ResponseFoldersInner.from_dict(folder200_response_folders_inner_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FolderRequest.md b/docs/FolderRequest.md deleted file mode 100644 index 9a14f0d..0000000 --- a/docs/FolderRequest.md +++ /dev/null @@ -1,29 +0,0 @@ -# FolderRequest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**team** | **int** | Team ID (displayed on dashboard) | - -## Example - -```python -from urlr.models.folder_request import FolderRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of FolderRequest from a JSON string -folder_request_instance = FolderRequest.from_json(json) -# print the JSON string representation of the object -print(FolderRequest.to_json()) - -# convert the object into a dict -folder_request_dict = folder_request_instance.to_dict() -# create an instance of FolderRequest from a dict -folder_request_from_dict = FolderRequest.from_dict(folder_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/FolderApi.md b/docs/FoldersApi.md similarity index 63% rename from docs/FolderApi.md rename to docs/FoldersApi.md index f174279..921b35f 100644 --- a/docs/FolderApi.md +++ b/docs/FoldersApi.md @@ -1,14 +1,14 @@ -# urlr.FolderApi +# urlr.FoldersApi -All URIs are relative to *https://urlr.me/api* +All URIs are relative to *https://urlr.me/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**folder**](FolderApi.md#folder) | **GET** /folder | Get folders of team +[**get_folders**](FoldersApi.md#get_folders) | **GET** /folders/{team_id} | Get folders of team -# **folder** -> Folder200Response folder(folder_request=folder_request) +# **get_folders** +> GetFolders200Response get_folders(team_id) Get folders of team @@ -18,15 +18,14 @@ Get folders of team ```python import urlr -from urlr.models.folder200_response import Folder200Response -from urlr.models.folder_request import FolderRequest +from urlr.models.get_folders200_response import GetFolders200Response from urlr.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://urlr.me/api +# Defining the host is optional and defaults to https://urlr.me/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = urlr.Configuration( - host = "https://urlr.me/api" + host = "https://urlr.me/api/v1" ) # The client must configure the authentication and authorization parameters @@ -42,16 +41,16 @@ configuration = urlr.Configuration( # Enter a context with an instance of the API client with urlr.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = urlr.FolderApi(api_client) - folder_request = urlr.FolderRequest() # FolderRequest | Infos to provide to get folders of team (optional) + api_instance = urlr.FoldersApi(api_client) + team_id = 'ffefc6c4-d970-4373-a867-2a69c8be2c89' # str | Team API ID try: # Get folders of team - api_response = api_instance.folder(folder_request=folder_request) - print("The response of FolderApi->folder:\n") + api_response = api_instance.get_folders(team_id) + print("The response of FoldersApi->get_folders:\n") pprint(api_response) except Exception as e: - print("Exception when calling FolderApi->folder: %s\n" % e) + print("Exception when calling FoldersApi->get_folders: %s\n" % e) ``` @@ -61,11 +60,11 @@ with urlr.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **folder_request** | [**FolderRequest**](FolderRequest.md)| Infos to provide to get folders of team | [optional] + **team_id** | **str**| Team API ID | ### Return type -[**Folder200Response**](Folder200Response.md) +[**GetFolders200Response**](GetFolders200Response.md) ### Authorization @@ -73,14 +72,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Folders of team | - | +**404** | Not Found | - | +**401** | Unauthorized | - | +**422** | Validation Failed | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/GetFolders200Response.md b/docs/GetFolders200Response.md new file mode 100644 index 0000000..6a00307 --- /dev/null +++ b/docs/GetFolders200Response.md @@ -0,0 +1,29 @@ +# GetFolders200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folders** | [**List[GetFolders200ResponseFoldersInner]**](GetFolders200ResponseFoldersInner.md) | | [optional] + +## Example + +```python +from urlr.models.get_folders200_response import GetFolders200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetFolders200Response from a JSON string +get_folders200_response_instance = GetFolders200Response.from_json(json) +# print the JSON string representation of the object +print(GetFolders200Response.to_json()) + +# convert the object into a dict +get_folders200_response_dict = get_folders200_response_instance.to_dict() +# create an instance of GetFolders200Response from a dict +get_folders200_response_from_dict = GetFolders200Response.from_dict(get_folders200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetFolders200ResponseFoldersInner.md b/docs/GetFolders200ResponseFoldersInner.md new file mode 100644 index 0000000..37df22b --- /dev/null +++ b/docs/GetFolders200ResponseFoldersInner.md @@ -0,0 +1,30 @@ +# GetFolders200ResponseFoldersInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Folder API ID | [optional] +**name** | **str** | Folder name | [optional] + +## Example + +```python +from urlr.models.get_folders200_response_folders_inner import GetFolders200ResponseFoldersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of GetFolders200ResponseFoldersInner from a JSON string +get_folders200_response_folders_inner_instance = GetFolders200ResponseFoldersInner.from_json(json) +# print the JSON string representation of the object +print(GetFolders200ResponseFoldersInner.to_json()) + +# convert the object into a dict +get_folders200_response_folders_inner_dict = get_folders200_response_folders_inner_instance.to_dict() +# create an instance of GetFolders200ResponseFoldersInner from a dict +get_folders200_response_folders_inner_from_dict = GetFolders200ResponseFoldersInner.from_dict(get_folders200_response_folders_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetLink200Response.md b/docs/GetLink200Response.md new file mode 100644 index 0000000..0b756d6 --- /dev/null +++ b/docs/GetLink200Response.md @@ -0,0 +1,29 @@ +# GetLink200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Link API ID | [optional] + +## Example + +```python +from urlr.models.get_link200_response import GetLink200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetLink200Response from a JSON string +get_link200_response_instance = GetLink200Response.from_json(json) +# print the JSON string representation of the object +print(GetLink200Response.to_json()) + +# convert the object into a dict +get_link200_response_dict = get_link200_response_instance.to_dict() +# create an instance of GetLink200Response from a dict +get_link200_response_from_dict = GetLink200Response.from_dict(get_link200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetLink401Response.md b/docs/GetLink401Response.md new file mode 100644 index 0000000..0001772 --- /dev/null +++ b/docs/GetLink401Response.md @@ -0,0 +1,32 @@ +# GetLink401Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**title** | **str** | | [optional] +**status** | **int** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from urlr.models.get_link401_response import GetLink401Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetLink401Response from a JSON string +get_link401_response_instance = GetLink401Response.from_json(json) +# print the JSON string representation of the object +print(GetLink401Response.to_json()) + +# convert the object into a dict +get_link401_response_dict = get_link401_response_instance.to_dict() +# create an instance of GetLink401Response from a dict +get_link401_response_from_dict = GetLink401Response.from_dict(get_link401_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetLink404Response.md b/docs/GetLink404Response.md new file mode 100644 index 0000000..04f2660 --- /dev/null +++ b/docs/GetLink404Response.md @@ -0,0 +1,32 @@ +# GetLink404Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**title** | **str** | | [optional] +**status** | **int** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from urlr.models.get_link404_response import GetLink404Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetLink404Response from a JSON string +get_link404_response_instance = GetLink404Response.from_json(json) +# print the JSON string representation of the object +print(GetLink404Response.to_json()) + +# convert the object into a dict +get_link404_response_dict = get_link404_response_instance.to_dict() +# create an instance of GetLink404Response from a dict +get_link404_response_from_dict = GetLink404Response.from_dict(get_link404_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetLink422Response.md b/docs/GetLink422Response.md new file mode 100644 index 0000000..3f03b97 --- /dev/null +++ b/docs/GetLink422Response.md @@ -0,0 +1,32 @@ +# GetLink422Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**title** | **str** | | [optional] +**status** | **int** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from urlr.models.get_link422_response import GetLink422Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetLink422Response from a JSON string +get_link422_response_instance = GetLink422Response.from_json(json) +# print the JSON string representation of the object +print(GetLink422Response.to_json()) + +# convert the object into a dict +get_link422_response_dict = get_link422_response_instance.to_dict() +# create an instance of GetLink422Response from a dict +get_link422_response_from_dict = GetLink422Response.from_dict(get_link422_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetStatistics200Response.md b/docs/GetStatistics200Response.md new file mode 100644 index 0000000..6fea5d6 --- /dev/null +++ b/docs/GetStatistics200Response.md @@ -0,0 +1,31 @@ +# GetStatistics200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_id** | **str** | Link API ID | [optional] +**clicks** | **int** | Clicks | [optional] +**unique_clicks** | **int** | Unique clicks | [optional] + +## Example + +```python +from urlr.models.get_statistics200_response import GetStatistics200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetStatistics200Response from a JSON string +get_statistics200_response_instance = GetStatistics200Response.from_json(json) +# print the JSON string representation of the object +print(GetStatistics200Response.to_json()) + +# convert the object into a dict +get_statistics200_response_dict = get_statistics200_response_instance.to_dict() +# create an instance of GetStatistics200Response from a dict +get_statistics200_response_from_dict = GetStatistics200Response.from_dict(get_statistics200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetStatisticsRequest.md b/docs/GetStatisticsRequest.md new file mode 100644 index 0000000..004a4ae --- /dev/null +++ b/docs/GetStatisticsRequest.md @@ -0,0 +1,32 @@ +# GetStatisticsRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_id** | **str** | Link API ID | [optional] +**var_from** | **datetime** | Get stats from this date | [optional] +**to** | **datetime** | Get stats until this date | [optional] +**include_bots** | **bool** | Whether include bots or not in statistics | [optional] [default to False] + +## Example + +```python +from urlr.models.get_statistics_request import GetStatisticsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GetStatisticsRequest from a JSON string +get_statistics_request_instance = GetStatisticsRequest.from_json(json) +# print the JSON string representation of the object +print(GetStatisticsRequest.to_json()) + +# convert the object into a dict +get_statistics_request_dict = get_statistics_request_instance.to_dict() +# create an instance of GetStatisticsRequest from a dict +get_statistics_request_from_dict = GetStatisticsRequest.from_dict(get_statistics_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetTeams200Response.md b/docs/GetTeams200Response.md new file mode 100644 index 0000000..a95e055 --- /dev/null +++ b/docs/GetTeams200Response.md @@ -0,0 +1,29 @@ +# GetTeams200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**teams** | [**List[GetTeams200ResponseTeamsInner]**](GetTeams200ResponseTeamsInner.md) | | [optional] + +## Example + +```python +from urlr.models.get_teams200_response import GetTeams200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTeams200Response from a JSON string +get_teams200_response_instance = GetTeams200Response.from_json(json) +# print the JSON string representation of the object +print(GetTeams200Response.to_json()) + +# convert the object into a dict +get_teams200_response_dict = get_teams200_response_instance.to_dict() +# create an instance of GetTeams200Response from a dict +get_teams200_response_from_dict = GetTeams200Response.from_dict(get_teams200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetTeams200ResponseTeamsInner.md b/docs/GetTeams200ResponseTeamsInner.md new file mode 100644 index 0000000..bd3facd --- /dev/null +++ b/docs/GetTeams200ResponseTeamsInner.md @@ -0,0 +1,30 @@ +# GetTeams200ResponseTeamsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Team API ID | [optional] +**name** | **str** | Team name | [optional] + +## Example + +```python +from urlr.models.get_teams200_response_teams_inner import GetTeams200ResponseTeamsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of GetTeams200ResponseTeamsInner from a JSON string +get_teams200_response_teams_inner_instance = GetTeams200ResponseTeamsInner.from_json(json) +# print the JSON string representation of the object +print(GetTeams200ResponseTeamsInner.to_json()) + +# convert the object into a dict +get_teams200_response_teams_inner_dict = get_teams200_response_teams_inner_instance.to_dict() +# create an instance of GetTeams200ResponseTeamsInner from a dict +get_teams200_response_teams_inner_from_dict = GetTeams200ResponseTeamsInner.from_dict(get_teams200_response_teams_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LinkApi.md b/docs/LinkApi.md deleted file mode 100644 index 2e692e5..0000000 --- a/docs/LinkApi.md +++ /dev/null @@ -1,87 +0,0 @@ -# urlr.LinkApi - -All URIs are relative to *https://urlr.me/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**reduce_link**](LinkApi.md#reduce_link) | **POST** /reduce-link | Shorten a link - - -# **reduce_link** -> ReduceLink200Response reduce_link(reduce_link_request=reduce_link_request) - -Shorten a link - -### Example - -* Bearer (JWT) Authentication (bearerAuth): - -```python -import urlr -from urlr.models.reduce_link200_response import ReduceLink200Response -from urlr.models.reduce_link_request import ReduceLinkRequest -from urlr.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://urlr.me/api -# See configuration.py for a list of all supported configuration parameters. -configuration = urlr.Configuration( - host = "https://urlr.me/api" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization (JWT): bearerAuth -configuration = urlr.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with urlr.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = urlr.LinkApi(api_client) - reduce_link_request = urlr.ReduceLinkRequest() # ReduceLinkRequest | Info of the link to shorten (optional) - - try: - # Shorten a link - api_response = api_instance.reduce_link(reduce_link_request=reduce_link_request) - print("The response of LinkApi->reduce_link:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling LinkApi->reduce_link: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **reduce_link_request** | [**ReduceLinkRequest**](ReduceLinkRequest.md)| Info of the link to shorten | [optional] - -### Return type - -[**ReduceLink200Response**](ReduceLink200Response.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The shortened link | - | -**400** | An error occurred | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/LinksApi.md b/docs/LinksApi.md new file mode 100644 index 0000000..09365eb --- /dev/null +++ b/docs/LinksApi.md @@ -0,0 +1,170 @@ +# urlr.LinksApi + +All URIs are relative to *https://urlr.me/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_link**](LinksApi.md#create_link) | **POST** /links/create | Create a link +[**get_link**](LinksApi.md#get_link) | **GET** /links/{link_id} | Get a link + + +# **create_link** +> CreateLink201Response create_link(create_link_request=create_link_request) + +Create a link + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import urlr +from urlr.models.create_link201_response import CreateLink201Response +from urlr.models.create_link_request import CreateLinkRequest +from urlr.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://urlr.me/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = urlr.Configuration( + host = "https://urlr.me/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = urlr.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with urlr.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = urlr.LinksApi(api_client) + create_link_request = urlr.CreateLinkRequest() # CreateLinkRequest | Info of the link to create (optional) + + try: + # Create a link + api_response = api_instance.create_link(create_link_request=create_link_request) + print("The response of LinksApi->create_link:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinksApi->create_link: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_link_request** | [**CreateLinkRequest**](CreateLinkRequest.md)| Info of the link to create | [optional] + +### Return type + +[**CreateLink201Response**](CreateLink201Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Link | - | +**401** | Unauthorized | - | +**422** | Validation Failed | - | +**429** | Limits Exceeded | - | +**500** | Internal Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_link** +> GetLink200Response get_link(link_id) + +Get a link + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import urlr +from urlr.models.get_link200_response import GetLink200Response +from urlr.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://urlr.me/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = urlr.Configuration( + host = "https://urlr.me/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = urlr.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with urlr.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = urlr.LinksApi(api_client) + link_id = 'ffefc6c4-d970-4373-a867-2a69c8be2c89' # str | Link API ID + + try: + # Get a link + api_response = api_instance.get_link(link_id) + print("The response of LinksApi->get_link:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinksApi->get_link: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **link_id** | **str**| Link API ID | + +### Return type + +[**GetLink200Response**](GetLink200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Link | - | +**404** | Not Found | - | +**401** | Unauthorized | - | +**422** | Validation Failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ReduceLink200Response.md b/docs/ReduceLink200Response.md deleted file mode 100644 index 603df80..0000000 --- a/docs/ReduceLink200Response.md +++ /dev/null @@ -1,35 +0,0 @@ -# ReduceLink200Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **str** | Original URL | [optional] -**expired_at** | **str** | Expiration date | [optional] -**team** | **int** | Team ID (displayed on dashboard) | [optional] -**folder** | **int** | Folder ID (displayed on dashboard) | [optional] -**url_code** | **str** | Short code | [optional] -**domain** | **str** | Domain | [optional] -**code** | **int** | HTTP status code | [optional] - -## Example - -```python -from urlr.models.reduce_link200_response import ReduceLink200Response - -# TODO update the JSON string below -json = "{}" -# create an instance of ReduceLink200Response from a JSON string -reduce_link200_response_instance = ReduceLink200Response.from_json(json) -# print the JSON string representation of the object -print(ReduceLink200Response.to_json()) - -# convert the object into a dict -reduce_link200_response_dict = reduce_link200_response_instance.to_dict() -# create an instance of ReduceLink200Response from a dict -reduce_link200_response_from_dict = ReduceLink200Response.from_dict(reduce_link200_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReduceLink400Response.md b/docs/ReduceLink400Response.md deleted file mode 100644 index 0921de7..0000000 --- a/docs/ReduceLink400Response.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReduceLink400Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | HTTP status code | [optional] -**error** | **int** | Error code | [optional] -**message** | **str** | Message describing the error | [optional] - -## Example - -```python -from urlr.models.reduce_link400_response import ReduceLink400Response - -# TODO update the JSON string below -json = "{}" -# create an instance of ReduceLink400Response from a JSON string -reduce_link400_response_instance = ReduceLink400Response.from_json(json) -# print the JSON string representation of the object -print(ReduceLink400Response.to_json()) - -# convert the object into a dict -reduce_link400_response_dict = reduce_link400_response_instance.to_dict() -# create an instance of ReduceLink400Response from a dict -reduce_link400_response_from_dict = ReduceLink400Response.from_dict(reduce_link400_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReduceLinkRequest.md b/docs/ReduceLinkRequest.md deleted file mode 100644 index 6bc088b..0000000 --- a/docs/ReduceLinkRequest.md +++ /dev/null @@ -1,35 +0,0 @@ -# ReduceLinkRequest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **str** | URL to shorten | -**team** | **str** | Team ID (displayed on dashboard) | -**folder** | **str** | Folder ID (displayed on dashboard) | [optional] -**code** | **str** | Custom short code | [optional] -**label** | **str** | Label | [optional] -**password** | **str** | Password | [optional] -**expired_at** | **str** | Expiration date | [optional] - -## Example - -```python -from urlr.models.reduce_link_request import ReduceLinkRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of ReduceLinkRequest from a JSON string -reduce_link_request_instance = ReduceLinkRequest.from_json(json) -# print the JSON string representation of the object -print(ReduceLinkRequest.to_json()) - -# convert the object into a dict -reduce_link_request_dict = reduce_link_request_instance.to_dict() -# create an instance of ReduceLinkRequest from a dict -reduce_link_request_from_dict = ReduceLinkRequest.from_dict(reduce_link_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RefreshAccessToken401Response.md b/docs/RefreshAccessToken401Response.md new file mode 100644 index 0000000..c2562f5 --- /dev/null +++ b/docs/RefreshAccessToken401Response.md @@ -0,0 +1,30 @@ +# RefreshAccessToken401Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**message** | **str** | | [optional] + +## Example + +```python +from urlr.models.refresh_access_token401_response import RefreshAccessToken401Response + +# TODO update the JSON string below +json = "{}" +# create an instance of RefreshAccessToken401Response from a JSON string +refresh_access_token401_response_instance = RefreshAccessToken401Response.from_json(json) +# print the JSON string representation of the object +print(RefreshAccessToken401Response.to_json()) + +# convert the object into a dict +refresh_access_token401_response_dict = refresh_access_token401_response_instance.to_dict() +# create an instance of RefreshAccessToken401Response from a dict +refresh_access_token401_response_from_dict = RefreshAccessToken401Response.from_dict(refresh_access_token401_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RefreshAccessTokenRequest.md b/docs/RefreshAccessTokenRequest.md new file mode 100644 index 0000000..93f16d6 --- /dev/null +++ b/docs/RefreshAccessTokenRequest.md @@ -0,0 +1,29 @@ +# RefreshAccessTokenRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**refresh_token** | **str** | Refresh token | + +## Example + +```python +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of RefreshAccessTokenRequest from a JSON string +refresh_access_token_request_instance = RefreshAccessTokenRequest.from_json(json) +# print the JSON string representation of the object +print(RefreshAccessTokenRequest.to_json()) + +# convert the object into a dict +refresh_access_token_request_dict = refresh_access_token_request_instance.to_dict() +# create an instance of RefreshAccessTokenRequest from a dict +refresh_access_token_request_from_dict = RefreshAccessTokenRequest.from_dict(refresh_access_token_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StatsApi.md b/docs/StatisticsApi.md similarity index 56% rename from docs/StatsApi.md rename to docs/StatisticsApi.md index f3c503e..bcad288 100644 --- a/docs/StatsApi.md +++ b/docs/StatisticsApi.md @@ -1,14 +1,14 @@ -# urlr.StatsApi +# urlr.StatisticsApi -All URIs are relative to *https://urlr.me/api* +All URIs are relative to *https://urlr.me/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**stats**](StatsApi.md#stats) | **POST** /stats | Get statistics of a link +[**get_statistics**](StatisticsApi.md#get_statistics) | **POST** /statistics | Get statistics of a link -# **stats** -> Stats200Response stats(stats_request=stats_request) +# **get_statistics** +> GetStatistics200Response get_statistics(get_statistics_request=get_statistics_request) Get statistics of a link @@ -18,15 +18,15 @@ Get statistics of a link ```python import urlr -from urlr.models.stats200_response import Stats200Response -from urlr.models.stats_request import StatsRequest +from urlr.models.get_statistics200_response import GetStatistics200Response +from urlr.models.get_statistics_request import GetStatisticsRequest from urlr.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://urlr.me/api +# Defining the host is optional and defaults to https://urlr.me/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = urlr.Configuration( - host = "https://urlr.me/api" + host = "https://urlr.me/api/v1" ) # The client must configure the authentication and authorization parameters @@ -42,16 +42,16 @@ configuration = urlr.Configuration( # Enter a context with an instance of the API client with urlr.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = urlr.StatsApi(api_client) - stats_request = urlr.StatsRequest() # StatsRequest | Infos to provide to get statistics of a link (optional) + api_instance = urlr.StatisticsApi(api_client) + get_statistics_request = urlr.GetStatisticsRequest() # GetStatisticsRequest | Infos to provide to get statistics of a link (optional) try: # Get statistics of a link - api_response = api_instance.stats(stats_request=stats_request) - print("The response of StatsApi->stats:\n") + api_response = api_instance.get_statistics(get_statistics_request=get_statistics_request) + print("The response of StatisticsApi->get_statistics:\n") pprint(api_response) except Exception as e: - print("Exception when calling StatsApi->stats: %s\n" % e) + print("Exception when calling StatisticsApi->get_statistics: %s\n" % e) ``` @@ -61,11 +61,11 @@ with urlr.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **stats_request** | [**StatsRequest**](StatsRequest.md)| Infos to provide to get statistics of a link | [optional] + **get_statistics_request** | [**GetStatisticsRequest**](GetStatisticsRequest.md)| Infos to provide to get statistics of a link | [optional] ### Return type -[**Stats200Response**](Stats200Response.md) +[**GetStatistics200Response**](GetStatistics200Response.md) ### Authorization @@ -74,14 +74,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: application/json, application/problem+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Statistics of the link | - | -**400** | An error occurred | - | +**404** | Not Found | - | +**401** | Unauthorized | - | +**422** | Validation Failed | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/Stats200Response.md b/docs/Stats200Response.md deleted file mode 100644 index 31b9872..0000000 --- a/docs/Stats200Response.md +++ /dev/null @@ -1,30 +0,0 @@ -# Stats200Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**clicks** | **int** | Clicks | [optional] -**unique_clicks** | **int** | Unique clicks | [optional] - -## Example - -```python -from urlr.models.stats200_response import Stats200Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Stats200Response from a JSON string -stats200_response_instance = Stats200Response.from_json(json) -# print the JSON string representation of the object -print(Stats200Response.to_json()) - -# convert the object into a dict -stats200_response_dict = stats200_response_instance.to_dict() -# create an instance of Stats200Response from a dict -stats200_response_from_dict = Stats200Response.from_dict(stats200_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Stats400Response.md b/docs/Stats400Response.md deleted file mode 100644 index 5c33a22..0000000 --- a/docs/Stats400Response.md +++ /dev/null @@ -1,30 +0,0 @@ -# Stats400Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**error** | **int** | | [optional] - -## Example - -```python -from urlr.models.stats400_response import Stats400Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Stats400Response from a JSON string -stats400_response_instance = Stats400Response.from_json(json) -# print the JSON string representation of the object -print(Stats400Response.to_json()) - -# convert the object into a dict -stats400_response_dict = stats400_response_instance.to_dict() -# create an instance of Stats400Response from a dict -stats400_response_from_dict = Stats400Response.from_dict(stats400_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/StatsRequest.md b/docs/StatsRequest.md deleted file mode 100644 index f8413ed..0000000 --- a/docs/StatsRequest.md +++ /dev/null @@ -1,32 +0,0 @@ -# StatsRequest - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **str** | The short code of the URL | -**var_from** | **str** | Get stats from this date | [optional] -**to** | **str** | Get stats until this date | [optional] -**include_bots** | **bool** | Whether include bots or not in statistics | [optional] - -## Example - -```python -from urlr.models.stats_request import StatsRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of StatsRequest from a JSON string -stats_request_instance = StatsRequest.from_json(json) -# print the JSON string representation of the object -print(StatsRequest.to_json()) - -# convert the object into a dict -stats_request_dict = stats_request_instance.to_dict() -# create an instance of StatsRequest from a dict -stats_request_from_dict = StatsRequest.from_dict(stats_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Team200Response.md b/docs/Team200Response.md deleted file mode 100644 index e6bcef0..0000000 --- a/docs/Team200Response.md +++ /dev/null @@ -1,29 +0,0 @@ -# Team200Response - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**teams** | [**List[Team200ResponseTeamsInner]**](Team200ResponseTeamsInner.md) | | [optional] - -## Example - -```python -from urlr.models.team200_response import Team200Response - -# TODO update the JSON string below -json = "{}" -# create an instance of Team200Response from a JSON string -team200_response_instance = Team200Response.from_json(json) -# print the JSON string representation of the object -print(Team200Response.to_json()) - -# convert the object into a dict -team200_response_dict = team200_response_instance.to_dict() -# create an instance of Team200Response from a dict -team200_response_from_dict = Team200Response.from_dict(team200_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Team200ResponseTeamsInner.md b/docs/Team200ResponseTeamsInner.md deleted file mode 100644 index 3596757..0000000 --- a/docs/Team200ResponseTeamsInner.md +++ /dev/null @@ -1,30 +0,0 @@ -# Team200ResponseTeamsInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Team ID | [optional] -**name** | **str** | Team name | [optional] - -## Example - -```python -from urlr.models.team200_response_teams_inner import Team200ResponseTeamsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of Team200ResponseTeamsInner from a JSON string -team200_response_teams_inner_instance = Team200ResponseTeamsInner.from_json(json) -# print the JSON string representation of the object -print(Team200ResponseTeamsInner.to_json()) - -# convert the object into a dict -team200_response_teams_inner_dict = team200_response_teams_inner_instance.to_dict() -# create an instance of Team200ResponseTeamsInner from a dict -team200_response_teams_inner_from_dict = Team200ResponseTeamsInner.from_dict(team200_response_teams_inner_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/TeamApi.md b/docs/TeamsApi.md similarity index 70% rename from docs/TeamApi.md rename to docs/TeamsApi.md index bab586e..56fadce 100644 --- a/docs/TeamApi.md +++ b/docs/TeamsApi.md @@ -1,14 +1,14 @@ -# urlr.TeamApi +# urlr.TeamsApi -All URIs are relative to *https://urlr.me/api* +All URIs are relative to *https://urlr.me/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**team**](TeamApi.md#team) | **GET** /team | Get teams of user +[**get_teams**](TeamsApi.md#get_teams) | **GET** /teams | Get teams of user -# **team** -> Team200Response team() +# **get_teams** +> GetTeams200Response get_teams() Get teams of user @@ -18,14 +18,14 @@ Get teams of user ```python import urlr -from urlr.models.team200_response import Team200Response +from urlr.models.get_teams200_response import GetTeams200Response from urlr.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://urlr.me/api +# Defining the host is optional and defaults to https://urlr.me/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = urlr.Configuration( - host = "https://urlr.me/api" + host = "https://urlr.me/api/v1" ) # The client must configure the authentication and authorization parameters @@ -41,15 +41,15 @@ configuration = urlr.Configuration( # Enter a context with an instance of the API client with urlr.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = urlr.TeamApi(api_client) + api_instance = urlr.TeamsApi(api_client) try: # Get teams of user - api_response = api_instance.team() - print("The response of TeamApi->team:\n") + api_response = api_instance.get_teams() + print("The response of TeamsApi->get_teams:\n") pprint(api_response) except Exception as e: - print("Exception when calling TeamApi->team: %s\n" % e) + print("Exception when calling TeamsApi->get_teams: %s\n" % e) ``` @@ -60,7 +60,7 @@ This endpoint does not need any parameter. ### Return type -[**Team200Response**](Team200Response.md) +[**GetTeams200Response**](GetTeams200Response.md) ### Authorization @@ -69,13 +69,14 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/json, application/problem+json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Teams of user | - | +**401** | Unauthorized | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/pyproject.toml b/pyproject.toml index 79e27bf..5972005 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "urlr" -version = "1.2.0" +version = "2.0.0" description = "Python client for URLR" authors = ["URLR "] license = "MIT" diff --git a/setup.py b/setup.py index f377247..fc82d47 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "urlr" -VERSION = "1.2.0" +VERSION = "2.0.0" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", @@ -45,7 +45,7 @@ license="MIT", long_description_content_type='text/markdown', long_description="""\ - API powering the features of URLR. + API powering the features of URLR.<br><br>Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.<br><br>Key API principles:<br> <ul><li>All dates follow **ISO-8601** format</li><li>Most errors follow **RFC 9457** standard</li><li>All responses are delivered in English</li></ul> """, # noqa: E501 package_data={"urlr": ["py.typed"]}, ) diff --git a/test/test_access_tokens_api.py b/test/test_access_tokens_api.py new file mode 100644 index 0000000..09337f3 --- /dev/null +++ b/test/test_access_tokens_api.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.api.access_tokens_api import AccessTokensApi + + +class TestAccessTokensApi(unittest.TestCase): + """AccessTokensApi unit test stubs""" + + def setUp(self) -> None: + self.api = AccessTokensApi() + + def tearDown(self) -> None: + pass + + def test_create_access_token(self) -> None: + """Test case for create_access_token + + Get an access token + """ + pass + + def test_refresh_access_token(self) -> None: + """Test case for refresh_access_token + + Refresh an access token + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_authentification200_response.py b/test/test_authentification200_response.py deleted file mode 100644 index e979ea7..0000000 --- a/test/test_authentification200_response.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.authentification200_response import Authentification200Response - -class TestAuthentification200Response(unittest.TestCase): - """Authentification200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Authentification200Response: - """Test Authentification200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Authentification200Response` - """ - model = Authentification200Response() - if include_optional: - return Authentification200Response( - token = '' - ) - else: - return Authentification200Response( - ) - """ - - def testAuthentification200Response(self): - """Test Authentification200Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_authentification401_response.py b/test/test_authentification401_response.py deleted file mode 100644 index 2932a93..0000000 --- a/test/test_authentification401_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.authentification401_response import Authentification401Response - -class TestAuthentification401Response(unittest.TestCase): - """Authentification401Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Authentification401Response: - """Test Authentification401Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Authentification401Response` - """ - model = Authentification401Response() - if include_optional: - return Authentification401Response( - code = 401, - message = 'Invalid credentials.' - ) - else: - return Authentification401Response( - ) - """ - - def testAuthentification401Response(self): - """Test Authentification401Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_authentification_api.py b/test/test_authentification_api.py deleted file mode 100644 index c3e907f..0000000 --- a/test/test_authentification_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.api.authentification_api import AuthentificationApi - - -class TestAuthentificationApi(unittest.TestCase): - """AuthentificationApi unit test stubs""" - - def setUp(self) -> None: - self.api = AuthentificationApi() - - def tearDown(self) -> None: - pass - - def test_authentification(self) -> None: - """Test case for authentification - - Get an access token - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_authentification_request.py b/test/test_authentification_request.py deleted file mode 100644 index a48088e..0000000 --- a/test/test_authentification_request.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.authentification_request import AuthentificationRequest - -class TestAuthentificationRequest(unittest.TestCase): - """AuthentificationRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AuthentificationRequest: - """Test AuthentificationRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AuthentificationRequest` - """ - model = AuthentificationRequest() - if include_optional: - return AuthentificationRequest( - username = '', - password = '' - ) - else: - return AuthentificationRequest( - ) - """ - - def testAuthentificationRequest(self): - """Test AuthentificationRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_access_token200_response.py b/test/test_create_access_token200_response.py new file mode 100644 index 0000000..ca9249a --- /dev/null +++ b/test/test_create_access_token200_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_access_token200_response import CreateAccessToken200Response + +class TestCreateAccessToken200Response(unittest.TestCase): + """CreateAccessToken200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAccessToken200Response: + """Test CreateAccessToken200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAccessToken200Response` + """ + model = CreateAccessToken200Response() + if include_optional: + return CreateAccessToken200Response( + token = '', + refresh_token = '' + ) + else: + return CreateAccessToken200Response( + ) + """ + + def testCreateAccessToken200Response(self): + """Test CreateAccessToken200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_access_token401_response.py b/test/test_create_access_token401_response.py new file mode 100644 index 0000000..f0a18c6 --- /dev/null +++ b/test/test_create_access_token401_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_access_token401_response import CreateAccessToken401Response + +class TestCreateAccessToken401Response(unittest.TestCase): + """CreateAccessToken401Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAccessToken401Response: + """Test CreateAccessToken401Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAccessToken401Response` + """ + model = CreateAccessToken401Response() + if include_optional: + return CreateAccessToken401Response( + code = 401, + message = 'Invalid credentials.' + ) + else: + return CreateAccessToken401Response( + ) + """ + + def testCreateAccessToken401Response(self): + """Test CreateAccessToken401Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_access_token_request.py b/test/test_create_access_token_request.py new file mode 100644 index 0000000..7298035 --- /dev/null +++ b/test/test_create_access_token_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_access_token_request import CreateAccessTokenRequest + +class TestCreateAccessTokenRequest(unittest.TestCase): + """CreateAccessTokenRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAccessTokenRequest: + """Test CreateAccessTokenRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAccessTokenRequest` + """ + model = CreateAccessTokenRequest() + if include_optional: + return CreateAccessTokenRequest( + username = '', + password = '' + ) + else: + return CreateAccessTokenRequest( + username = '', + password = '', + ) + """ + + def testCreateAccessTokenRequest(self): + """Test CreateAccessTokenRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_link201_response.py b/test/test_create_link201_response.py new file mode 100644 index 0000000..5319860 --- /dev/null +++ b/test/test_create_link201_response.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_link201_response import CreateLink201Response + +class TestCreateLink201Response(unittest.TestCase): + """CreateLink201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateLink201Response: + """Test CreateLink201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLink201Response` + """ + model = CreateLink201Response() + if include_optional: + return CreateLink201Response( + id = '', + url = '', + team = '', + folder_id = '', + domain_id = 'urlr.me', + code = 'xxxxx', + label = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + expired_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return CreateLink201Response( + ) + """ + + def testCreateLink201Response(self): + """Test CreateLink201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_link429_response.py b/test/test_create_link429_response.py new file mode 100644 index 0000000..bf66c7d --- /dev/null +++ b/test/test_create_link429_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_link429_response import CreateLink429Response + +class TestCreateLink429Response(unittest.TestCase): + """CreateLink429Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateLink429Response: + """Test CreateLink429Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLink429Response` + """ + model = CreateLink429Response() + if include_optional: + return CreateLink429Response( + type = '', + title = '', + status = 429, + detail = '' + ) + else: + return CreateLink429Response( + ) + """ + + def testCreateLink429Response(self): + """Test CreateLink429Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_link500_response.py b/test/test_create_link500_response.py new file mode 100644 index 0000000..3a468b6 --- /dev/null +++ b/test/test_create_link500_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_link500_response import CreateLink500Response + +class TestCreateLink500Response(unittest.TestCase): + """CreateLink500Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateLink500Response: + """Test CreateLink500Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLink500Response` + """ + model = CreateLink500Response() + if include_optional: + return CreateLink500Response( + type = '', + title = '', + status = 500, + detail = '' + ) + else: + return CreateLink500Response( + ) + """ + + def testCreateLink500Response(self): + """Test CreateLink500Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_link_request.py b/test/test_create_link_request.py new file mode 100644 index 0000000..ca451c1 --- /dev/null +++ b/test/test_create_link_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.create_link_request import CreateLinkRequest + +class TestCreateLinkRequest(unittest.TestCase): + """CreateLinkRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateLinkRequest: + """Test CreateLinkRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLinkRequest` + """ + model = CreateLinkRequest() + if include_optional: + return CreateLinkRequest( + url = '', + team_id = '', + folder_id = '', + code = 'xxxxx', + label = '', + password = '', + expired_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return CreateLinkRequest( + url = '', + team_id = '', + ) + """ + + def testCreateLinkRequest(self): + """Test CreateLinkRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_folder200_response.py b/test/test_folder200_response.py deleted file mode 100644 index 0d13d7d..0000000 --- a/test/test_folder200_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.folder200_response import Folder200Response - -class TestFolder200Response(unittest.TestCase): - """Folder200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Folder200Response: - """Test Folder200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Folder200Response` - """ - model = Folder200Response() - if include_optional: - return Folder200Response( - folders = [ - urlr.models.folder_200_response_folders_inner.folder_200_response_folders_inner( - id = 123, - name = 'folder-campaign-google-ads', ) - ] - ) - else: - return Folder200Response( - ) - """ - - def testFolder200Response(self): - """Test Folder200Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_folder200_response_folders_inner.py b/test/test_folder200_response_folders_inner.py deleted file mode 100644 index cc3a437..0000000 --- a/test/test_folder200_response_folders_inner.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.folder200_response_folders_inner import Folder200ResponseFoldersInner - -class TestFolder200ResponseFoldersInner(unittest.TestCase): - """Folder200ResponseFoldersInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Folder200ResponseFoldersInner: - """Test Folder200ResponseFoldersInner - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Folder200ResponseFoldersInner` - """ - model = Folder200ResponseFoldersInner() - if include_optional: - return Folder200ResponseFoldersInner( - id = 123, - name = 'folder-campaign-google-ads' - ) - else: - return Folder200ResponseFoldersInner( - ) - """ - - def testFolder200ResponseFoldersInner(self): - """Test Folder200ResponseFoldersInner""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_folder_api.py b/test/test_folder_api.py deleted file mode 100644 index 2672eaa..0000000 --- a/test/test_folder_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.api.folder_api import FolderApi - - -class TestFolderApi(unittest.TestCase): - """FolderApi unit test stubs""" - - def setUp(self) -> None: - self.api = FolderApi() - - def tearDown(self) -> None: - pass - - def test_folder(self) -> None: - """Test case for folder - - Get folders of team - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_folder_request.py b/test/test_folder_request.py deleted file mode 100644 index 2f01ad4..0000000 --- a/test/test_folder_request.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.folder_request import FolderRequest - -class TestFolderRequest(unittest.TestCase): - """FolderRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> FolderRequest: - """Test FolderRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `FolderRequest` - """ - model = FolderRequest() - if include_optional: - return FolderRequest( - team = 123 - ) - else: - return FolderRequest( - team = 123, - ) - """ - - def testFolderRequest(self): - """Test FolderRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_folders_api.py b/test/test_folders_api.py new file mode 100644 index 0000000..a94ac25 --- /dev/null +++ b/test/test_folders_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.api.folders_api import FoldersApi + + +class TestFoldersApi(unittest.TestCase): + """FoldersApi unit test stubs""" + + def setUp(self) -> None: + self.api = FoldersApi() + + def tearDown(self) -> None: + pass + + def test_get_folders(self) -> None: + """Test case for get_folders + + Get folders of team + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_folders200_response.py b/test/test_get_folders200_response.py new file mode 100644 index 0000000..63aad53 --- /dev/null +++ b/test/test_get_folders200_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_folders200_response import GetFolders200Response + +class TestGetFolders200Response(unittest.TestCase): + """GetFolders200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetFolders200Response: + """Test GetFolders200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetFolders200Response` + """ + model = GetFolders200Response() + if include_optional: + return GetFolders200Response( + folders = [ + urlr.models.get_folders_200_response_folders_inner.getFolders_200_response_folders_inner( + id = '436b5d20-e174-4363-94e5-2b3dd4e74b5f', + name = 'folder-campaign-google-ads', ) + ] + ) + else: + return GetFolders200Response( + ) + """ + + def testGetFolders200Response(self): + """Test GetFolders200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_folders200_response_folders_inner.py b/test/test_get_folders200_response_folders_inner.py new file mode 100644 index 0000000..62fc8c1 --- /dev/null +++ b/test/test_get_folders200_response_folders_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_folders200_response_folders_inner import GetFolders200ResponseFoldersInner + +class TestGetFolders200ResponseFoldersInner(unittest.TestCase): + """GetFolders200ResponseFoldersInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetFolders200ResponseFoldersInner: + """Test GetFolders200ResponseFoldersInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetFolders200ResponseFoldersInner` + """ + model = GetFolders200ResponseFoldersInner() + if include_optional: + return GetFolders200ResponseFoldersInner( + id = '436b5d20-e174-4363-94e5-2b3dd4e74b5f', + name = 'folder-campaign-google-ads' + ) + else: + return GetFolders200ResponseFoldersInner( + ) + """ + + def testGetFolders200ResponseFoldersInner(self): + """Test GetFolders200ResponseFoldersInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_link200_response.py b/test/test_get_link200_response.py new file mode 100644 index 0000000..c9f839c --- /dev/null +++ b/test/test_get_link200_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_link200_response import GetLink200Response + +class TestGetLink200Response(unittest.TestCase): + """GetLink200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetLink200Response: + """Test GetLink200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetLink200Response` + """ + model = GetLink200Response() + if include_optional: + return GetLink200Response( + id = '436b5d20-e174-4363-94e5-2b3dd4e74b5f' + ) + else: + return GetLink200Response( + ) + """ + + def testGetLink200Response(self): + """Test GetLink200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_link401_response.py b/test/test_get_link401_response.py new file mode 100644 index 0000000..4311055 --- /dev/null +++ b/test/test_get_link401_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_link401_response import GetLink401Response + +class TestGetLink401Response(unittest.TestCase): + """GetLink401Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetLink401Response: + """Test GetLink401Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetLink401Response` + """ + model = GetLink401Response() + if include_optional: + return GetLink401Response( + type = '', + title = '', + status = 401, + detail = '' + ) + else: + return GetLink401Response( + ) + """ + + def testGetLink401Response(self): + """Test GetLink401Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_link404_response.py b/test/test_get_link404_response.py new file mode 100644 index 0000000..e72a6a1 --- /dev/null +++ b/test/test_get_link404_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_link404_response import GetLink404Response + +class TestGetLink404Response(unittest.TestCase): + """GetLink404Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetLink404Response: + """Test GetLink404Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetLink404Response` + """ + model = GetLink404Response() + if include_optional: + return GetLink404Response( + type = '', + title = '', + status = 404, + detail = '' + ) + else: + return GetLink404Response( + ) + """ + + def testGetLink404Response(self): + """Test GetLink404Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_link422_response.py b/test/test_get_link422_response.py new file mode 100644 index 0000000..54fd2b4 --- /dev/null +++ b/test/test_get_link422_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_link422_response import GetLink422Response + +class TestGetLink422Response(unittest.TestCase): + """GetLink422Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetLink422Response: + """Test GetLink422Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetLink422Response` + """ + model = GetLink422Response() + if include_optional: + return GetLink422Response( + type = '', + title = '', + status = 422, + detail = '' + ) + else: + return GetLink422Response( + ) + """ + + def testGetLink422Response(self): + """Test GetLink422Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_statistics200_response.py b/test/test_get_statistics200_response.py new file mode 100644 index 0000000..dd27244 --- /dev/null +++ b/test/test_get_statistics200_response.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_statistics200_response import GetStatistics200Response + +class TestGetStatistics200Response(unittest.TestCase): + """GetStatistics200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetStatistics200Response: + """Test GetStatistics200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetStatistics200Response` + """ + model = GetStatistics200Response() + if include_optional: + return GetStatistics200Response( + link_id = '', + clicks = 32, + unique_clicks = 51 + ) + else: + return GetStatistics200Response( + ) + """ + + def testGetStatistics200Response(self): + """Test GetStatistics200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_statistics_request.py b/test/test_get_statistics_request.py new file mode 100644 index 0000000..0904367 --- /dev/null +++ b/test/test_get_statistics_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_statistics_request import GetStatisticsRequest + +class TestGetStatisticsRequest(unittest.TestCase): + """GetStatisticsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetStatisticsRequest: + """Test GetStatisticsRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetStatisticsRequest` + """ + model = GetStatisticsRequest() + if include_optional: + return GetStatisticsRequest( + link_id = '', + var_from = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + to = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + include_bots = True + ) + else: + return GetStatisticsRequest( + ) + """ + + def testGetStatisticsRequest(self): + """Test GetStatisticsRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_teams200_response.py b/test/test_get_teams200_response.py new file mode 100644 index 0000000..7733742 --- /dev/null +++ b/test/test_get_teams200_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_teams200_response import GetTeams200Response + +class TestGetTeams200Response(unittest.TestCase): + """GetTeams200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTeams200Response: + """Test GetTeams200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTeams200Response` + """ + model = GetTeams200Response() + if include_optional: + return GetTeams200Response( + teams = [ + urlr.models.get_teams_200_response_teams_inner.getTeams_200_response_teams_inner( + id = 'ffefc6c4-d970-4373-a867-2a69c8be2c89', + name = 'the best team', ) + ] + ) + else: + return GetTeams200Response( + ) + """ + + def testGetTeams200Response(self): + """Test GetTeams200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_teams200_response_teams_inner.py b/test/test_get_teams200_response_teams_inner.py new file mode 100644 index 0000000..150f2ce --- /dev/null +++ b/test/test_get_teams200_response_teams_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.get_teams200_response_teams_inner import GetTeams200ResponseTeamsInner + +class TestGetTeams200ResponseTeamsInner(unittest.TestCase): + """GetTeams200ResponseTeamsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetTeams200ResponseTeamsInner: + """Test GetTeams200ResponseTeamsInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetTeams200ResponseTeamsInner` + """ + model = GetTeams200ResponseTeamsInner() + if include_optional: + return GetTeams200ResponseTeamsInner( + id = 'ffefc6c4-d970-4373-a867-2a69c8be2c89', + name = 'the best team' + ) + else: + return GetTeams200ResponseTeamsInner( + ) + """ + + def testGetTeams200ResponseTeamsInner(self): + """Test GetTeams200ResponseTeamsInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_link_api.py b/test/test_link_api.py deleted file mode 100644 index b4c1f68..0000000 --- a/test/test_link_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.api.link_api import LinkApi - - -class TestLinkApi(unittest.TestCase): - """LinkApi unit test stubs""" - - def setUp(self) -> None: - self.api = LinkApi() - - def tearDown(self) -> None: - pass - - def test_reduce_link(self) -> None: - """Test case for reduce_link - - Shorten a link - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_links_api.py b/test/test_links_api.py new file mode 100644 index 0000000..b189d43 --- /dev/null +++ b/test/test_links_api.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.api.links_api import LinksApi + + +class TestLinksApi(unittest.TestCase): + """LinksApi unit test stubs""" + + def setUp(self) -> None: + self.api = LinksApi() + + def tearDown(self) -> None: + pass + + def test_create_link(self) -> None: + """Test case for create_link + + Create a link + """ + pass + + def test_get_link(self) -> None: + """Test case for get_link + + Get a link + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reduce_link200_response.py b/test/test_reduce_link200_response.py deleted file mode 100644 index 76edbff..0000000 --- a/test/test_reduce_link200_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.reduce_link200_response import ReduceLink200Response - -class TestReduceLink200Response(unittest.TestCase): - """ReduceLink200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReduceLink200Response: - """Test ReduceLink200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReduceLink200Response` - """ - model = ReduceLink200Response() - if include_optional: - return ReduceLink200Response( - url = '', - expired_at = '', - team = 56, - folder = 56, - url_code = 'xMs5c', - domain = 'urlr.me', - code = 200 - ) - else: - return ReduceLink200Response( - ) - """ - - def testReduceLink200Response(self): - """Test ReduceLink200Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_reduce_link400_response.py b/test/test_reduce_link400_response.py deleted file mode 100644 index ceea81b..0000000 --- a/test/test_reduce_link400_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.reduce_link400_response import ReduceLink400Response - -class TestReduceLink400Response(unittest.TestCase): - """ReduceLink400Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReduceLink400Response: - """Test ReduceLink400Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReduceLink400Response` - """ - model = ReduceLink400Response() - if include_optional: - return ReduceLink400Response( - code = 401, - error = -1, - message = '' - ) - else: - return ReduceLink400Response( - ) - """ - - def testReduceLink400Response(self): - """Test ReduceLink400Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_reduce_link_request.py b/test/test_reduce_link_request.py deleted file mode 100644 index a673042..0000000 --- a/test/test_reduce_link_request.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.reduce_link_request import ReduceLinkRequest - -class TestReduceLinkRequest(unittest.TestCase): - """ReduceLinkRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReduceLinkRequest: - """Test ReduceLinkRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReduceLinkRequest` - """ - model = ReduceLinkRequest() - if include_optional: - return ReduceLinkRequest( - url = '', - team = '', - folder = '', - code = 'zA9LCSLv1C1ylmgd0-Y2TA5', - label = '', - password = '', - expired_at = '' - ) - else: - return ReduceLinkRequest( - url = '', - team = '', - ) - """ - - def testReduceLinkRequest(self): - """Test ReduceLinkRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_refresh_access_token401_response.py b/test/test_refresh_access_token401_response.py new file mode 100644 index 0000000..64834ee --- /dev/null +++ b/test/test_refresh_access_token401_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.refresh_access_token401_response import RefreshAccessToken401Response + +class TestRefreshAccessToken401Response(unittest.TestCase): + """RefreshAccessToken401Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RefreshAccessToken401Response: + """Test RefreshAccessToken401Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RefreshAccessToken401Response` + """ + model = RefreshAccessToken401Response() + if include_optional: + return RefreshAccessToken401Response( + code = 401, + message = 'Missing JWT Refresh Token' + ) + else: + return RefreshAccessToken401Response( + ) + """ + + def testRefreshAccessToken401Response(self): + """Test RefreshAccessToken401Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_refresh_access_token_request.py b/test/test_refresh_access_token_request.py new file mode 100644 index 0000000..be0fa7b --- /dev/null +++ b/test/test_refresh_access_token_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest + +class TestRefreshAccessTokenRequest(unittest.TestCase): + """RefreshAccessTokenRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RefreshAccessTokenRequest: + """Test RefreshAccessTokenRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RefreshAccessTokenRequest` + """ + model = RefreshAccessTokenRequest() + if include_optional: + return RefreshAccessTokenRequest( + refresh_token = '' + ) + else: + return RefreshAccessTokenRequest( + refresh_token = '', + ) + """ + + def testRefreshAccessTokenRequest(self): + """Test RefreshAccessTokenRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_statistics_api.py b/test/test_statistics_api.py new file mode 100644 index 0000000..780520f --- /dev/null +++ b/test/test_statistics_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.api.statistics_api import StatisticsApi + + +class TestStatisticsApi(unittest.TestCase): + """StatisticsApi unit test stubs""" + + def setUp(self) -> None: + self.api = StatisticsApi() + + def tearDown(self) -> None: + pass + + def test_get_statistics(self) -> None: + """Test case for get_statistics + + Get statistics of a link + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_stats200_response.py b/test/test_stats200_response.py deleted file mode 100644 index c5847b9..0000000 --- a/test/test_stats200_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.stats200_response import Stats200Response - -class TestStats200Response(unittest.TestCase): - """Stats200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Stats200Response: - """Test Stats200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Stats200Response` - """ - model = Stats200Response() - if include_optional: - return Stats200Response( - clicks = 32, - unique_clicks = 51 - ) - else: - return Stats200Response( - ) - """ - - def testStats200Response(self): - """Test Stats200Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_stats400_response.py b/test/test_stats400_response.py deleted file mode 100644 index 9b3d2aa..0000000 --- a/test/test_stats400_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.stats400_response import Stats400Response - -class TestStats400Response(unittest.TestCase): - """Stats400Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Stats400Response: - """Test Stats400Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Stats400Response` - """ - model = Stats400Response() - if include_optional: - return Stats400Response( - code = 401, - error = -1 - ) - else: - return Stats400Response( - ) - """ - - def testStats400Response(self): - """Test Stats400Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_stats_api.py b/test/test_stats_api.py deleted file mode 100644 index f0a6acb..0000000 --- a/test/test_stats_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.api.stats_api import StatsApi - - -class TestStatsApi(unittest.TestCase): - """StatsApi unit test stubs""" - - def setUp(self) -> None: - self.api = StatsApi() - - def tearDown(self) -> None: - pass - - def test_stats(self) -> None: - """Test case for stats - - Get statistics of a link - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_stats_request.py b/test/test_stats_request.py deleted file mode 100644 index 7f32b28..0000000 --- a/test/test_stats_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.stats_request import StatsRequest - -class TestStatsRequest(unittest.TestCase): - """StatsRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> StatsRequest: - """Test StatsRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `StatsRequest` - """ - model = StatsRequest() - if include_optional: - return StatsRequest( - code = 'zA9LCSLv1C1ylmgd0-Y2TA5', - var_from = 'dd/mm/yyyy', - to = 'dd/mm/yyyy', - include_bots = True - ) - else: - return StatsRequest( - code = 'zA9LCSLv1C1ylmgd0-Y2TA5', - ) - """ - - def testStatsRequest(self): - """Test StatsRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_team200_response.py b/test/test_team200_response.py deleted file mode 100644 index d28bcc2..0000000 --- a/test/test_team200_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.team200_response import Team200Response - -class TestTeam200Response(unittest.TestCase): - """Team200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Team200Response: - """Test Team200Response - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Team200Response` - """ - model = Team200Response() - if include_optional: - return Team200Response( - teams = [ - urlr.models.team_200_response_teams_inner.team_200_response_teams_inner( - id = 131, - name = 'the best team', ) - ] - ) - else: - return Team200Response( - ) - """ - - def testTeam200Response(self): - """Test Team200Response""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_team200_response_teams_inner.py b/test/test_team200_response_teams_inner.py deleted file mode 100644 index 14514f4..0000000 --- a/test/test_team200_response_teams_inner.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.models.team200_response_teams_inner import Team200ResponseTeamsInner - -class TestTeam200ResponseTeamsInner(unittest.TestCase): - """Team200ResponseTeamsInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Team200ResponseTeamsInner: - """Test Team200ResponseTeamsInner - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Team200ResponseTeamsInner` - """ - model = Team200ResponseTeamsInner() - if include_optional: - return Team200ResponseTeamsInner( - id = 131, - name = 'the best team' - ) - else: - return Team200ResponseTeamsInner( - ) - """ - - def testTeam200ResponseTeamsInner(self): - """Test Team200ResponseTeamsInner""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_team_api.py b/test/test_team_api.py deleted file mode 100644 index 251e674..0000000 --- a/test/test_team_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from urlr.api.team_api import TeamApi - - -class TestTeamApi(unittest.TestCase): - """TeamApi unit test stubs""" - - def setUp(self) -> None: - self.api = TeamApi() - - def tearDown(self) -> None: - pass - - def test_team(self) -> None: - """Test case for team - - Get teams of user - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_teams_api.py b/test/test_teams_api.py new file mode 100644 index 0000000..e9dc838 --- /dev/null +++ b/test/test_teams_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from urlr.api.teams_api import TeamsApi + + +class TestTeamsApi(unittest.TestCase): + """TeamsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TeamsApi() + + def tearDown(self) -> None: + pass + + def test_get_teams(self) -> None: + """Test case for get_teams + + Get teams of user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/urlr/__init__.py b/urlr/__init__.py index c267d33..d75a608 100644 --- a/urlr/__init__.py +++ b/urlr/__init__.py @@ -3,11 +3,11 @@ # flake8: noqa """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,14 +15,14 @@ """ # noqa: E501 -__version__ = "1.2.0" +__version__ = "2.0.0" # import apis into sdk package -from urlr.api.authentification_api import AuthentificationApi -from urlr.api.folder_api import FolderApi -from urlr.api.link_api import LinkApi -from urlr.api.stats_api import StatsApi -from urlr.api.team_api import TeamApi +from urlr.api.access_tokens_api import AccessTokensApi +from urlr.api.folders_api import FoldersApi +from urlr.api.links_api import LinksApi +from urlr.api.statistics_api import StatisticsApi +from urlr.api.teams_api import TeamsApi # import ApiClient from urlr.api_response import ApiResponse @@ -36,17 +36,22 @@ from urlr.exceptions import ApiException # import models into sdk package -from urlr.models.authentification200_response import Authentification200Response -from urlr.models.authentification401_response import Authentification401Response -from urlr.models.authentification_request import AuthentificationRequest -from urlr.models.folder200_response import Folder200Response -from urlr.models.folder200_response_folders_inner import Folder200ResponseFoldersInner -from urlr.models.folder_request import FolderRequest -from urlr.models.reduce_link200_response import ReduceLink200Response -from urlr.models.reduce_link400_response import ReduceLink400Response -from urlr.models.reduce_link_request import ReduceLinkRequest -from urlr.models.stats200_response import Stats200Response -from urlr.models.stats400_response import Stats400Response -from urlr.models.stats_request import StatsRequest -from urlr.models.team200_response import Team200Response -from urlr.models.team200_response_teams_inner import Team200ResponseTeamsInner +from urlr.models.create_access_token200_response import CreateAccessToken200Response +from urlr.models.create_access_token401_response import CreateAccessToken401Response +from urlr.models.create_access_token_request import CreateAccessTokenRequest +from urlr.models.create_link201_response import CreateLink201Response +from urlr.models.create_link429_response import CreateLink429Response +from urlr.models.create_link500_response import CreateLink500Response +from urlr.models.create_link_request import CreateLinkRequest +from urlr.models.get_folders200_response import GetFolders200Response +from urlr.models.get_folders200_response_folders_inner import GetFolders200ResponseFoldersInner +from urlr.models.get_link200_response import GetLink200Response +from urlr.models.get_link401_response import GetLink401Response +from urlr.models.get_link404_response import GetLink404Response +from urlr.models.get_link422_response import GetLink422Response +from urlr.models.get_statistics200_response import GetStatistics200Response +from urlr.models.get_statistics_request import GetStatisticsRequest +from urlr.models.get_teams200_response import GetTeams200Response +from urlr.models.get_teams200_response_teams_inner import GetTeams200ResponseTeamsInner +from urlr.models.refresh_access_token401_response import RefreshAccessToken401Response +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest diff --git a/urlr/api/__init__.py b/urlr/api/__init__.py index cf46716..c755df3 100644 --- a/urlr/api/__init__.py +++ b/urlr/api/__init__.py @@ -1,9 +1,9 @@ # flake8: noqa # import apis into api package -from urlr.api.authentification_api import AuthentificationApi -from urlr.api.folder_api import FolderApi -from urlr.api.link_api import LinkApi -from urlr.api.stats_api import StatsApi -from urlr.api.team_api import TeamApi +from urlr.api.access_tokens_api import AccessTokensApi +from urlr.api.folders_api import FoldersApi +from urlr.api.links_api import LinksApi +from urlr.api.statistics_api import StatisticsApi +from urlr.api.teams_api import TeamsApi diff --git a/urlr/api/access_tokens_api.py b/urlr/api/access_tokens_api.py new file mode 100644 index 0000000..0ea9181 --- /dev/null +++ b/urlr/api/access_tokens_api.py @@ -0,0 +1,582 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from urlr.models.create_access_token200_response import CreateAccessToken200Response +from urlr.models.create_access_token_request import CreateAccessTokenRequest +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest + +from urlr.api_client import ApiClient, RequestSerialized +from urlr.api_response import ApiResponse +from urlr.rest import RESTResponseType + + +class AccessTokensApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_access_token( + self, + create_access_token_request: Annotated[Optional[CreateAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateAccessToken200Response: + """Get an access token + + + :param create_access_token_request: Your credentials + :type create_access_token_request: CreateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_access_token_serialize( + create_access_token_request=create_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "CreateAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_access_token_with_http_info( + self, + create_access_token_request: Annotated[Optional[CreateAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateAccessToken200Response]: + """Get an access token + + + :param create_access_token_request: Your credentials + :type create_access_token_request: CreateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_access_token_serialize( + create_access_token_request=create_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "CreateAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_access_token_without_preload_content( + self, + create_access_token_request: Annotated[Optional[CreateAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an access token + + + :param create_access_token_request: Your credentials + :type create_access_token_request: CreateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_access_token_serialize( + create_access_token_request=create_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "CreateAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_access_token_serialize( + self, + create_access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_access_token_request is not None: + _body_params = create_access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/access_tokens/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def refresh_access_token( + self, + refresh_access_token_request: Annotated[Optional[RefreshAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateAccessToken200Response: + """Refresh an access token + + + :param refresh_access_token_request: Your credentials + :type refresh_access_token_request: RefreshAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._refresh_access_token_serialize( + refresh_access_token_request=refresh_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "RefreshAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def refresh_access_token_with_http_info( + self, + refresh_access_token_request: Annotated[Optional[RefreshAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateAccessToken200Response]: + """Refresh an access token + + + :param refresh_access_token_request: Your credentials + :type refresh_access_token_request: RefreshAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._refresh_access_token_serialize( + refresh_access_token_request=refresh_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "RefreshAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def refresh_access_token_without_preload_content( + self, + refresh_access_token_request: Annotated[Optional[RefreshAccessTokenRequest], Field(description="Your credentials")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Refresh an access token + + + :param refresh_access_token_request: Your credentials + :type refresh_access_token_request: RefreshAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._refresh_access_token_serialize( + refresh_access_token_request=refresh_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateAccessToken200Response", + '401': "RefreshAccessToken401Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _refresh_access_token_serialize( + self, + refresh_access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if refresh_access_token_request is not None: + _body_params = refresh_access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/access_tokens/refresh', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/urlr/api/authentification_api.py b/urlr/api/authentification_api.py deleted file mode 100644 index b7dfdb4..0000000 --- a/urlr/api/authentification_api.py +++ /dev/null @@ -1,311 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field -from typing import Optional -from typing_extensions import Annotated -from urlr.models.authentification200_response import Authentification200Response -from urlr.models.authentification_request import AuthentificationRequest - -from urlr.api_client import ApiClient, RequestSerialized -from urlr.api_response import ApiResponse -from urlr.rest import RESTResponseType - - -class AuthentificationApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def authentification( - self, - authentification_request: Annotated[Optional[AuthentificationRequest], Field(description="Your credentials")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Authentification200Response: - """Get an access token - - - :param authentification_request: Your credentials - :type authentification_request: AuthentificationRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._authentification_serialize( - authentification_request=authentification_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Authentification200Response", - '401': "Authentification401Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def authentification_with_http_info( - self, - authentification_request: Annotated[Optional[AuthentificationRequest], Field(description="Your credentials")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Authentification200Response]: - """Get an access token - - - :param authentification_request: Your credentials - :type authentification_request: AuthentificationRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._authentification_serialize( - authentification_request=authentification_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Authentification200Response", - '401': "Authentification401Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def authentification_without_preload_content( - self, - authentification_request: Annotated[Optional[AuthentificationRequest], Field(description="Your credentials")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get an access token - - - :param authentification_request: Your credentials - :type authentification_request: AuthentificationRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._authentification_serialize( - authentification_request=authentification_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Authentification200Response", - '401': "Authentification401Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _authentification_serialize( - self, - authentification_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authentification_request is not None: - _body_params = authentification_request - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/login_check', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/urlr/api/folder_api.py b/urlr/api/folders_api.py similarity index 80% rename from urlr/api/folder_api.py rename to urlr/api/folders_api.py index 35a24c0..4ca313f 100644 --- a/urlr/api/folder_api.py +++ b/urlr/api/folders_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,18 +17,16 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictStr from typing_extensions import Annotated -from urlr.models.folder200_response import Folder200Response -from urlr.models.folder_request import FolderRequest +from urlr.models.get_folders200_response import GetFolders200Response from urlr.api_client import ApiClient, RequestSerialized from urlr.api_response import ApiResponse from urlr.rest import RESTResponseType -class FolderApi: +class FoldersApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -42,9 +40,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def folder( + def get_folders( self, - folder_request: Annotated[Optional[FolderRequest], Field(description="Infos to provide to get folders of team")] = None, + team_id: Annotated[StrictStr, Field(description="Team API ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -57,12 +55,12 @@ def folder( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Folder200Response: + ) -> GetFolders200Response: """Get folders of team - :param folder_request: Infos to provide to get folders of team - :type folder_request: FolderRequest + :param team_id: Team API ID (required) + :type team_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -85,8 +83,8 @@ def folder( :return: Returns the result object. """ # noqa: E501 - _param = self._folder_serialize( - folder_request=folder_request, + _param = self._get_folders_serialize( + team_id=team_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -94,7 +92,10 @@ def folder( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Folder200Response", + '200': "GetFolders200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -108,9 +109,9 @@ def folder( @validate_call - def folder_with_http_info( + def get_folders_with_http_info( self, - folder_request: Annotated[Optional[FolderRequest], Field(description="Infos to provide to get folders of team")] = None, + team_id: Annotated[StrictStr, Field(description="Team API ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -123,12 +124,12 @@ def folder_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Folder200Response]: + ) -> ApiResponse[GetFolders200Response]: """Get folders of team - :param folder_request: Infos to provide to get folders of team - :type folder_request: FolderRequest + :param team_id: Team API ID (required) + :type team_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -151,8 +152,8 @@ def folder_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._folder_serialize( - folder_request=folder_request, + _param = self._get_folders_serialize( + team_id=team_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -160,7 +161,10 @@ def folder_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Folder200Response", + '200': "GetFolders200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -174,9 +178,9 @@ def folder_with_http_info( @validate_call - def folder_without_preload_content( + def get_folders_without_preload_content( self, - folder_request: Annotated[Optional[FolderRequest], Field(description="Infos to provide to get folders of team")] = None, + team_id: Annotated[StrictStr, Field(description="Team API ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -193,8 +197,8 @@ def folder_without_preload_content( """Get folders of team - :param folder_request: Infos to provide to get folders of team - :type folder_request: FolderRequest + :param team_id: Team API ID (required) + :type team_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -217,8 +221,8 @@ def folder_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._folder_serialize( - folder_request=folder_request, + _param = self._get_folders_serialize( + team_id=team_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -226,7 +230,10 @@ def folder_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Folder200Response", + '200': "GetFolders200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -235,9 +242,9 @@ def folder_without_preload_content( return response_data.response - def _folder_serialize( + def _get_folders_serialize( self, - folder_request, + team_id, _request_auth, _content_type, _headers, @@ -257,34 +264,22 @@ def _folder_serialize( _body_params: Optional[bytes] = None # process the path parameters + if team_id is not None: + _path_params['team_id'] = team_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if folder_request is not None: - _body_params = folder_request # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/json', + 'application/problem+json' ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -293,7 +288,7 @@ def _folder_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/folder', + resource_path='/folders/{team_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/urlr/api/link_api.py b/urlr/api/link_api.py deleted file mode 100644 index be18ec2..0000000 --- a/urlr/api/link_api.py +++ /dev/null @@ -1,312 +0,0 @@ -# coding: utf-8 - -""" - Developer API - URLR - - API powering the features of URLR. - - The version of the OpenAPI document: 0.3 - Contact: contact@urlr.me - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field -from typing import Optional -from typing_extensions import Annotated -from urlr.models.reduce_link200_response import ReduceLink200Response -from urlr.models.reduce_link_request import ReduceLinkRequest - -from urlr.api_client import ApiClient, RequestSerialized -from urlr.api_response import ApiResponse -from urlr.rest import RESTResponseType - - -class LinkApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def reduce_link( - self, - reduce_link_request: Annotated[Optional[ReduceLinkRequest], Field(description="Info of the link to shorten")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ReduceLink200Response: - """Shorten a link - - - :param reduce_link_request: Info of the link to shorten - :type reduce_link_request: ReduceLinkRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reduce_link_serialize( - reduce_link_request=reduce_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReduceLink200Response", - '400': "ReduceLink400Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def reduce_link_with_http_info( - self, - reduce_link_request: Annotated[Optional[ReduceLinkRequest], Field(description="Info of the link to shorten")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ReduceLink200Response]: - """Shorten a link - - - :param reduce_link_request: Info of the link to shorten - :type reduce_link_request: ReduceLinkRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reduce_link_serialize( - reduce_link_request=reduce_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReduceLink200Response", - '400': "ReduceLink400Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def reduce_link_without_preload_content( - self, - reduce_link_request: Annotated[Optional[ReduceLinkRequest], Field(description="Info of the link to shorten")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Shorten a link - - - :param reduce_link_request: Info of the link to shorten - :type reduce_link_request: ReduceLinkRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reduce_link_serialize( - reduce_link_request=reduce_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReduceLink200Response", - '400': "ReduceLink400Response", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _reduce_link_serialize( - self, - reduce_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if reduce_link_request is not None: - _body_params = reduce_link_request - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'bearerAuth' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/reduce-link', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/urlr/api/links_api.py b/urlr/api/links_api.py new file mode 100644 index 0000000..17da264 --- /dev/null +++ b/urlr/api/links_api.py @@ -0,0 +1,588 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from urlr.models.create_link201_response import CreateLink201Response +from urlr.models.create_link_request import CreateLinkRequest +from urlr.models.get_link200_response import GetLink200Response + +from urlr.api_client import ApiClient, RequestSerialized +from urlr.api_response import ApiResponse +from urlr.rest import RESTResponseType + + +class LinksApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_link( + self, + create_link_request: Annotated[Optional[CreateLinkRequest], Field(description="Info of the link to create")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateLink201Response: + """Create a link + + + :param create_link_request: Info of the link to create + :type create_link_request: CreateLinkRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_link_serialize( + create_link_request=create_link_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateLink201Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + '429': "CreateLink429Response", + '500': "CreateLink500Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_link_with_http_info( + self, + create_link_request: Annotated[Optional[CreateLinkRequest], Field(description="Info of the link to create")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateLink201Response]: + """Create a link + + + :param create_link_request: Info of the link to create + :type create_link_request: CreateLinkRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_link_serialize( + create_link_request=create_link_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateLink201Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + '429': "CreateLink429Response", + '500': "CreateLink500Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_link_without_preload_content( + self, + create_link_request: Annotated[Optional[CreateLinkRequest], Field(description="Info of the link to create")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a link + + + :param create_link_request: Info of the link to create + :type create_link_request: CreateLinkRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_link_serialize( + create_link_request=create_link_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateLink201Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + '429': "CreateLink429Response", + '500': "CreateLink500Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_link_serialize( + self, + create_link_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_link_request is not None: + _body_params = create_link_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/links/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_link( + self, + link_id: Annotated[StrictStr, Field(description="Link API ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetLink200Response: + """Get a link + + + :param link_id: Link API ID (required) + :type link_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_link_serialize( + link_id=link_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLink200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_link_with_http_info( + self, + link_id: Annotated[StrictStr, Field(description="Link API ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetLink200Response]: + """Get a link + + + :param link_id: Link API ID (required) + :type link_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_link_serialize( + link_id=link_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLink200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_link_without_preload_content( + self, + link_id: Annotated[StrictStr, Field(description="Link API ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a link + + + :param link_id: Link API ID (required) + :type link_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_link_serialize( + link_id=link_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLink200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_link_serialize( + self, + link_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if link_id is not None: + _path_params['link_id'] = link_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/links/{link_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/urlr/api/stats_api.py b/urlr/api/statistics_api.py similarity index 78% rename from urlr/api/stats_api.py rename to urlr/api/statistics_api.py index ca923b9..10eacbb 100644 --- a/urlr/api/stats_api.py +++ b/urlr/api/statistics_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,15 +20,15 @@ from pydantic import Field from typing import Optional from typing_extensions import Annotated -from urlr.models.stats200_response import Stats200Response -from urlr.models.stats_request import StatsRequest +from urlr.models.get_statistics200_response import GetStatistics200Response +from urlr.models.get_statistics_request import GetStatisticsRequest from urlr.api_client import ApiClient, RequestSerialized from urlr.api_response import ApiResponse from urlr.rest import RESTResponseType -class StatsApi: +class StatisticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -42,9 +42,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def stats( + def get_statistics( self, - stats_request: Annotated[Optional[StatsRequest], Field(description="Infos to provide to get statistics of a link")] = None, + get_statistics_request: Annotated[Optional[GetStatisticsRequest], Field(description="Infos to provide to get statistics of a link")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -57,12 +57,12 @@ def stats( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Stats200Response: + ) -> GetStatistics200Response: """Get statistics of a link - :param stats_request: Infos to provide to get statistics of a link - :type stats_request: StatsRequest + :param get_statistics_request: Infos to provide to get statistics of a link + :type get_statistics_request: GetStatisticsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -85,8 +85,8 @@ def stats( :return: Returns the result object. """ # noqa: E501 - _param = self._stats_serialize( - stats_request=stats_request, + _param = self._get_statistics_serialize( + get_statistics_request=get_statistics_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -94,8 +94,10 @@ def stats( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Stats200Response", - '400': "Stats400Response", + '200': "GetStatistics200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -109,9 +111,9 @@ def stats( @validate_call - def stats_with_http_info( + def get_statistics_with_http_info( self, - stats_request: Annotated[Optional[StatsRequest], Field(description="Infos to provide to get statistics of a link")] = None, + get_statistics_request: Annotated[Optional[GetStatisticsRequest], Field(description="Infos to provide to get statistics of a link")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -124,12 +126,12 @@ def stats_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Stats200Response]: + ) -> ApiResponse[GetStatistics200Response]: """Get statistics of a link - :param stats_request: Infos to provide to get statistics of a link - :type stats_request: StatsRequest + :param get_statistics_request: Infos to provide to get statistics of a link + :type get_statistics_request: GetStatisticsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -152,8 +154,8 @@ def stats_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._stats_serialize( - stats_request=stats_request, + _param = self._get_statistics_serialize( + get_statistics_request=get_statistics_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -161,8 +163,10 @@ def stats_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Stats200Response", - '400': "Stats400Response", + '200': "GetStatistics200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -176,9 +180,9 @@ def stats_with_http_info( @validate_call - def stats_without_preload_content( + def get_statistics_without_preload_content( self, - stats_request: Annotated[Optional[StatsRequest], Field(description="Infos to provide to get statistics of a link")] = None, + get_statistics_request: Annotated[Optional[GetStatisticsRequest], Field(description="Infos to provide to get statistics of a link")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -195,8 +199,8 @@ def stats_without_preload_content( """Get statistics of a link - :param stats_request: Infos to provide to get statistics of a link - :type stats_request: StatsRequest + :param get_statistics_request: Infos to provide to get statistics of a link + :type get_statistics_request: GetStatisticsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -219,8 +223,8 @@ def stats_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._stats_serialize( - stats_request=stats_request, + _param = self._get_statistics_serialize( + get_statistics_request=get_statistics_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -228,8 +232,10 @@ def stats_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Stats200Response", - '400': "Stats400Response", + '200': "GetStatistics200Response", + '404': "GetLink404Response", + '401': "GetLink401Response", + '422': "GetLink422Response", } response_data = self.api_client.call_api( *_param, @@ -238,9 +244,9 @@ def stats_without_preload_content( return response_data.response - def _stats_serialize( + def _get_statistics_serialize( self, - stats_request, + get_statistics_request, _request_auth, _content_type, _headers, @@ -264,14 +270,15 @@ def _stats_serialize( # process the header parameters # process the form parameters # process the body parameter - if stats_request is not None: - _body_params = stats_request + if get_statistics_request is not None: + _body_params = get_statistics_request # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/json', + 'application/problem+json' ] ) @@ -296,7 +303,7 @@ def _stats_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/stats', + resource_path='/statistics', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/urlr/api/team_api.py b/urlr/api/teams_api.py similarity index 88% rename from urlr/api/team_api.py rename to urlr/api/teams_api.py index c811e73..5d46fe8 100644 --- a/urlr/api/team_api.py +++ b/urlr/api/teams_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,14 +17,14 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from urlr.models.team200_response import Team200Response +from urlr.models.get_teams200_response import GetTeams200Response from urlr.api_client import ApiClient, RequestSerialized from urlr.api_response import ApiResponse from urlr.rest import RESTResponseType -class TeamApi: +class TeamsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -38,7 +38,7 @@ def __init__(self, api_client=None) -> None: @validate_call - def team( + def get_teams( self, _request_timeout: Union[ None, @@ -52,7 +52,7 @@ def team( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Team200Response: + ) -> GetTeams200Response: """Get teams of user @@ -78,7 +78,7 @@ def team( :return: Returns the result object. """ # noqa: E501 - _param = self._team_serialize( + _param = self._get_teams_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -86,7 +86,8 @@ def team( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Team200Response", + '200': "GetTeams200Response", + '401': "GetLink401Response", } response_data = self.api_client.call_api( *_param, @@ -100,7 +101,7 @@ def team( @validate_call - def team_with_http_info( + def get_teams_with_http_info( self, _request_timeout: Union[ None, @@ -114,7 +115,7 @@ def team_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Team200Response]: + ) -> ApiResponse[GetTeams200Response]: """Get teams of user @@ -140,7 +141,7 @@ def team_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._team_serialize( + _param = self._get_teams_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -148,7 +149,8 @@ def team_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Team200Response", + '200': "GetTeams200Response", + '401': "GetLink401Response", } response_data = self.api_client.call_api( *_param, @@ -162,7 +164,7 @@ def team_with_http_info( @validate_call - def team_without_preload_content( + def get_teams_without_preload_content( self, _request_timeout: Union[ None, @@ -202,7 +204,7 @@ def team_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._team_serialize( + _param = self._get_teams_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -210,7 +212,8 @@ def team_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Team200Response", + '200': "GetTeams200Response", + '401': "GetLink401Response", } response_data = self.api_client.call_api( *_param, @@ -219,7 +222,7 @@ def team_without_preload_content( return response_data.response - def _team_serialize( + def _get_teams_serialize( self, _request_auth, _content_type, @@ -249,7 +252,8 @@ def _team_serialize( # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( [ - 'application/json' + 'application/json', + 'application/problem+json' ] ) @@ -261,7 +265,7 @@ def _team_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/team', + resource_path='/teams', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/urlr/api_client.py b/urlr/api_client.py index 8a1ef85..882d1a6 100644 --- a/urlr/api_client.py +++ b/urlr/api_client.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -89,7 +89,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.2.0/python' + self.user_agent = 'OpenAPI-Generator/2.0.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/urlr/configuration.py b/urlr/configuration.py index 64a46fe..b08c272 100644 --- a/urlr/configuration.py +++ b/urlr/configuration.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -71,7 +71,7 @@ def __init__(self, host=None, ) -> None: """Constructor """ - self._base_path = "https://urlr.me/api" if host is None else host + self._base_path = "https://urlr.me/api/v1" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -379,8 +379,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 0.3\n"\ - "SDK Package Version: 1.2.0".\ + "Version of the API: 1.0\n"\ + "SDK Package Version: 2.0.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): @@ -390,7 +390,7 @@ def get_host_settings(self): """ return [ { - 'url': "https://urlr.me/api", + 'url': "https://urlr.me/api/v1", 'description': "Main API entry point", } ] diff --git a/urlr/exceptions.py b/urlr/exceptions.py index d299aa9..cfb1a0b 100644 --- a/urlr/exceptions.py +++ b/urlr/exceptions.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/urlr/models/__init__.py b/urlr/models/__init__.py index 631427a..9a11f38 100644 --- a/urlr/models/__init__.py +++ b/urlr/models/__init__.py @@ -2,11 +2,11 @@ # flake8: noqa """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,17 +15,22 @@ # import models into model package -from urlr.models.authentification200_response import Authentification200Response -from urlr.models.authentification401_response import Authentification401Response -from urlr.models.authentification_request import AuthentificationRequest -from urlr.models.folder200_response import Folder200Response -from urlr.models.folder200_response_folders_inner import Folder200ResponseFoldersInner -from urlr.models.folder_request import FolderRequest -from urlr.models.reduce_link200_response import ReduceLink200Response -from urlr.models.reduce_link400_response import ReduceLink400Response -from urlr.models.reduce_link_request import ReduceLinkRequest -from urlr.models.stats200_response import Stats200Response -from urlr.models.stats400_response import Stats400Response -from urlr.models.stats_request import StatsRequest -from urlr.models.team200_response import Team200Response -from urlr.models.team200_response_teams_inner import Team200ResponseTeamsInner +from urlr.models.create_access_token200_response import CreateAccessToken200Response +from urlr.models.create_access_token401_response import CreateAccessToken401Response +from urlr.models.create_access_token_request import CreateAccessTokenRequest +from urlr.models.create_link201_response import CreateLink201Response +from urlr.models.create_link429_response import CreateLink429Response +from urlr.models.create_link500_response import CreateLink500Response +from urlr.models.create_link_request import CreateLinkRequest +from urlr.models.get_folders200_response import GetFolders200Response +from urlr.models.get_folders200_response_folders_inner import GetFolders200ResponseFoldersInner +from urlr.models.get_link200_response import GetLink200Response +from urlr.models.get_link401_response import GetLink401Response +from urlr.models.get_link404_response import GetLink404Response +from urlr.models.get_link422_response import GetLink422Response +from urlr.models.get_statistics200_response import GetStatistics200Response +from urlr.models.get_statistics_request import GetStatisticsRequest +from urlr.models.get_teams200_response import GetTeams200Response +from urlr.models.get_teams200_response_teams_inner import GetTeams200ResponseTeamsInner +from urlr.models.refresh_access_token401_response import RefreshAccessToken401Response +from urlr.models.refresh_access_token_request import RefreshAccessTokenRequest diff --git a/urlr/models/create_access_token200_response.py b/urlr/models/create_access_token200_response.py new file mode 100644 index 0000000..0a8918b --- /dev/null +++ b/urlr/models/create_access_token200_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateAccessToken200Response(BaseModel): + """ + CreateAccessToken200Response + """ # noqa: E501 + token: Optional[StrictStr] = Field(default=None, description="Access token (JWT) valid for 1 hour") + refresh_token: Optional[StrictStr] = Field(default=None, description="Refresh token valid for 1 month") + __properties: ClassVar[List[str]] = ["token", "refresh_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAccessToken200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateAccessToken200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token": obj.get("token"), + "refresh_token": obj.get("refresh_token") + }) + return _obj + + diff --git a/urlr/models/authentification401_response.py b/urlr/models/create_access_token401_response.py similarity index 77% rename from urlr/models/authentification401_response.py rename to urlr/models/create_access_token401_response.py index 082148b..2ca003e 100644 --- a/urlr/models/authentification401_response.py +++ b/urlr/models/create_access_token401_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class Authentification401Response(BaseModel): +class CreateAccessToken401Response(BaseModel): """ - Authentification401Response + CreateAccessToken401Response """ # noqa: E501 code: Optional[StrictInt] = None message: Optional[StrictStr] = None @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Authentification401Response from a JSON string""" + """Create an instance of CreateAccessToken401Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Authentification401Response from a dict""" + """Create an instance of CreateAccessToken401Response from a dict""" if obj is None: return None diff --git a/urlr/models/authentification_request.py b/urlr/models/create_access_token_request.py similarity index 73% rename from urlr/models/authentification_request.py rename to urlr/models/create_access_token_request.py index 87378f9..0c254da 100644 --- a/urlr/models/authentification_request.py +++ b/urlr/models/create_access_token_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,16 +19,16 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class AuthentificationRequest(BaseModel): +class CreateAccessTokenRequest(BaseModel): """ - AuthentificationRequest + CreateAccessTokenRequest """ # noqa: E501 - username: Optional[StrictStr] = Field(default=None, description="Email") - password: Optional[StrictStr] = Field(default=None, description="Password") + username: StrictStr = Field(description="Email") + password: StrictStr = Field(description="Password") __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthentificationRequest from a JSON string""" + """Create an instance of CreateAccessTokenRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthentificationRequest from a dict""" + """Create an instance of CreateAccessTokenRequest from a dict""" if obj is None: return None diff --git a/urlr/models/reduce_link200_response.py b/urlr/models/create_link201_response.py similarity index 52% rename from urlr/models/reduce_link200_response.py rename to urlr/models/create_link201_response.py index 28eab99..39a69ec 100644 --- a/urlr/models/reduce_link200_response.py +++ b/urlr/models/create_link201_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class ReduceLink200Response(BaseModel): +class CreateLink201Response(BaseModel): """ - ReduceLink200Response + CreateLink201Response """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Link API ID") url: Optional[StrictStr] = Field(default=None, description="Original URL") - expired_at: Optional[StrictStr] = Field(default=None, description="Expiration date") - team: Optional[StrictInt] = Field(default=None, description="Team ID (displayed on dashboard)") - folder: Optional[StrictInt] = Field(default=None, description="Folder ID (displayed on dashboard)") - url_code: Optional[StrictStr] = Field(default=None, description="Short code") - domain: Optional[StrictStr] = Field(default=None, description="Domain") - code: Optional[StrictInt] = Field(default=None, description="HTTP status code") - __properties: ClassVar[List[str]] = ["url", "expired_at", "team", "folder", "url_code", "domain", "code"] + team: Optional[StrictStr] = Field(default=None, description="Team API ID") + folder_id: Optional[StrictStr] = Field(default=None, description="Folder API ID") + domain_id: Optional[StrictStr] = Field(default=None, description="Domain") + code: Optional[StrictStr] = Field(default=None, description="Short code") + label: Optional[StrictStr] = Field(default=None, description="Label") + created_at: Optional[datetime] = Field(default=None, description="Creation date") + updated_at: Optional[datetime] = Field(default=None, description="Modification date") + expired_at: Optional[datetime] = Field(default=None, description="Expiration date") + __properties: ClassVar[List[str]] = ["id", "url", "team", "folder_id", "domain_id", "code", "label", "created_at", "updated_at", "expired_at"] model_config = ConfigDict( populate_by_name=True, @@ -54,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReduceLink200Response from a JSON string""" + """Create an instance of CreateLink201Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReduceLink200Response from a dict""" + """Create an instance of CreateLink201Response from a dict""" if obj is None: return None @@ -87,13 +91,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "id": obj.get("id"), "url": obj.get("url"), - "expired_at": obj.get("expired_at"), "team": obj.get("team"), - "folder": obj.get("folder"), - "url_code": obj.get("url_code"), - "domain": obj.get("domain"), - "code": obj.get("code") + "folder_id": obj.get("folder_id"), + "domain_id": obj.get("domain_id"), + "code": obj.get("code"), + "label": obj.get("label"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "expired_at": obj.get("expired_at") }) return _obj diff --git a/urlr/models/create_link429_response.py b/urlr/models/create_link429_response.py new file mode 100644 index 0000000..4c88cd6 --- /dev/null +++ b/urlr/models/create_link429_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateLink429Response(BaseModel): + """ + CreateLink429Response + """ # noqa: E501 + type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + status: Optional[StrictInt] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateLink429Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLink429Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/urlr/models/create_link500_response.py b/urlr/models/create_link500_response.py new file mode 100644 index 0000000..b4a343c --- /dev/null +++ b/urlr/models/create_link500_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateLink500Response(BaseModel): + """ + CreateLink500Response + """ # noqa: E501 + type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + status: Optional[StrictInt] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateLink500Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLink500Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/urlr/models/reduce_link_request.py b/urlr/models/create_link_request.py similarity index 73% rename from urlr/models/reduce_link_request.py rename to urlr/models/create_link_request.py index 3b37650..ee65739 100644 --- a/urlr/models/reduce_link_request.py +++ b/urlr/models/create_link_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,24 +18,25 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class ReduceLinkRequest(BaseModel): +class CreateLinkRequest(BaseModel): """ - ReduceLinkRequest + CreateLinkRequest """ # noqa: E501 url: StrictStr = Field(description="URL to shorten") - team: StrictStr = Field(description="Team ID (displayed on dashboard)") - folder: Optional[StrictStr] = Field(default=None, description="Folder ID (displayed on dashboard)") + team_id: StrictStr = Field(description="Team API ID") + folder_id: Optional[StrictStr] = Field(default=None, description="Folder API ID") code: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Custom short code") label: Optional[StrictStr] = Field(default=None, description="Label") password: Optional[StrictStr] = Field(default=None, description="Password") - expired_at: Optional[StrictStr] = Field(default=None, description="Expiration date") - __properties: ClassVar[List[str]] = ["url", "team", "folder", "code", "label", "password", "expired_at"] + expired_at: Optional[datetime] = Field(default=None, description="Expiration date") + __properties: ClassVar[List[str]] = ["url", "team_id", "folder_id", "code", "label", "password", "expired_at"] @field_validator('code') def code_validate_regular_expression(cls, value): @@ -65,7 +66,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReduceLinkRequest from a JSON string""" + """Create an instance of CreateLinkRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -90,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReduceLinkRequest from a dict""" + """Create an instance of CreateLinkRequest from a dict""" if obj is None: return None @@ -99,8 +100,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "url": obj.get("url"), - "team": obj.get("team"), - "folder": obj.get("folder"), + "team_id": obj.get("team_id"), + "folder_id": obj.get("folder_id"), "code": obj.get("code"), "label": obj.get("label"), "password": obj.get("password"), diff --git a/urlr/models/folder200_response.py b/urlr/models/get_folders200_response.py similarity index 71% rename from urlr/models/folder200_response.py rename to urlr/models/get_folders200_response.py index a8401fe..3991692 100644 --- a/urlr/models/folder200_response.py +++ b/urlr/models/get_folders200_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,15 +20,15 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from urlr.models.folder200_response_folders_inner import Folder200ResponseFoldersInner +from urlr.models.get_folders200_response_folders_inner import GetFolders200ResponseFoldersInner from typing import Optional, Set from typing_extensions import Self -class Folder200Response(BaseModel): +class GetFolders200Response(BaseModel): """ - Folder200Response + GetFolders200Response """ # noqa: E501 - folders: Optional[List[Folder200ResponseFoldersInner]] = None + folders: Optional[List[GetFolders200ResponseFoldersInner]] = None __properties: ClassVar[List[str]] = ["folders"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Folder200Response from a JSON string""" + """Create an instance of GetFolders200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Folder200Response from a dict""" + """Create an instance of GetFolders200Response from a dict""" if obj is None: return None @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "folders": [Folder200ResponseFoldersInner.from_dict(_item) for _item in obj["folders"]] if obj.get("folders") is not None else None + "folders": [GetFolders200ResponseFoldersInner.from_dict(_item) for _item in obj["folders"]] if obj.get("folders") is not None else None }) return _obj diff --git a/urlr/models/team200_response_teams_inner.py b/urlr/models/get_folders200_response_folders_inner.py similarity index 72% rename from urlr/models/team200_response_teams_inner.py rename to urlr/models/get_folders200_response_folders_inner.py index d6e99b4..913f056 100644 --- a/urlr/models/team200_response_teams_inner.py +++ b/urlr/models/get_folders200_response_folders_inner.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Team200ResponseTeamsInner(BaseModel): +class GetFolders200ResponseFoldersInner(BaseModel): """ - Team200ResponseTeamsInner + GetFolders200ResponseFoldersInner """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="Team ID") - name: Optional[StrictStr] = Field(default=None, description="Team name") + id: Optional[StrictStr] = Field(default=None, description="Folder API ID") + name: Optional[StrictStr] = Field(default=None, description="Folder name") __properties: ClassVar[List[str]] = ["id", "name"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Team200ResponseTeamsInner from a JSON string""" + """Create an instance of GetFolders200ResponseFoldersInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Team200ResponseTeamsInner from a dict""" + """Create an instance of GetFolders200ResponseFoldersInner from a dict""" if obj is None: return None diff --git a/urlr/models/authentification200_response.py b/urlr/models/get_link200_response.py similarity index 70% rename from urlr/models/authentification200_response.py rename to urlr/models/get_link200_response.py index 9cc9d65..f5acdb1 100644 --- a/urlr/models/authentification200_response.py +++ b/urlr/models/get_link200_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Authentification200Response(BaseModel): +class GetLink200Response(BaseModel): """ - Authentification200Response + GetLink200Response """ # noqa: E501 - token: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["token"] + id: Optional[StrictStr] = Field(default=None, description="Link API ID") + __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Authentification200Response from a JSON string""" + """Create an instance of GetLink200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Authentification200Response from a dict""" + """Create an instance of GetLink200Response from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "token": obj.get("token") + "id": obj.get("id") }) return _obj diff --git a/urlr/models/stats400_response.py b/urlr/models/get_link401_response.py similarity index 65% rename from urlr/models/stats400_response.py rename to urlr/models/get_link401_response.py index 06461f8..d5f0a25 100644 --- a/urlr/models/stats400_response.py +++ b/urlr/models/get_link401_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,20 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Stats400Response(BaseModel): +class GetLink401Response(BaseModel): """ - Stats400Response + GetLink401Response """ # noqa: E501 - code: Optional[StrictInt] = None - error: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["code", "error"] + type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + status: Optional[StrictInt] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Stats400Response from a JSON string""" + """Create an instance of GetLink401Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Stats400Response from a dict""" + """Create an instance of GetLink401Response from a dict""" if obj is None: return None @@ -82,8 +84,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "code": obj.get("code"), - "error": obj.get("error") + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail") }) return _obj diff --git a/urlr/models/get_link404_response.py b/urlr/models/get_link404_response.py new file mode 100644 index 0000000..b07d09d --- /dev/null +++ b/urlr/models/get_link404_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GetLink404Response(BaseModel): + """ + GetLink404Response + """ # noqa: E501 + type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + status: Optional[StrictInt] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetLink404Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetLink404Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/urlr/models/get_link422_response.py b/urlr/models/get_link422_response.py new file mode 100644 index 0000000..3df4f47 --- /dev/null +++ b/urlr/models/get_link422_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + URLR API Reference + + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
+ + The version of the OpenAPI document: 1.0 + Contact: contact@urlr.me + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GetLink422Response(BaseModel): + """ + GetLink422Response + """ # noqa: E501 + type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + status: Optional[StrictInt] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetLink422Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetLink422Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/urlr/models/stats200_response.py b/urlr/models/get_statistics200_response.py similarity index 68% rename from urlr/models/stats200_response.py rename to urlr/models/get_statistics200_response.py index ba77501..3866e02 100644 --- a/urlr/models/stats200_response.py +++ b/urlr/models/get_statistics200_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Stats200Response(BaseModel): +class GetStatistics200Response(BaseModel): """ - Stats200Response + GetStatistics200Response """ # noqa: E501 + link_id: Optional[StrictStr] = Field(default=None, description="Link API ID") clicks: Optional[StrictInt] = Field(default=None, description="Clicks") - unique_clicks: Optional[StrictInt] = Field(default=None, description="Unique clicks", alias="uniqueClicks") - __properties: ClassVar[List[str]] = ["clicks", "uniqueClicks"] + unique_clicks: Optional[StrictInt] = Field(default=None, description="Unique clicks") + __properties: ClassVar[List[str]] = ["link_id", "clicks", "unique_clicks"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Stats200Response from a JSON string""" + """Create an instance of GetStatistics200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Stats200Response from a dict""" + """Create an instance of GetStatistics200Response from a dict""" if obj is None: return None @@ -82,8 +83,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "link_id": obj.get("link_id"), "clicks": obj.get("clicks"), - "uniqueClicks": obj.get("uniqueClicks") + "unique_clicks": obj.get("unique_clicks") }) return _obj diff --git a/urlr/models/stats_request.py b/urlr/models/get_statistics_request.py similarity index 62% rename from urlr/models/stats_request.py rename to urlr/models/get_statistics_request.py index b55f65d..1ab634a 100644 --- a/urlr/models/stats_request.py +++ b/urlr/models/get_statistics_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,28 +18,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class StatsRequest(BaseModel): +class GetStatisticsRequest(BaseModel): """ - StatsRequest + GetStatisticsRequest """ # noqa: E501 - code: Annotated[str, Field(strict=True)] = Field(description="The short code of the URL") - var_from: Optional[StrictStr] = Field(default=None, description="Get stats from this date", alias="from") - to: Optional[StrictStr] = Field(default=None, description="Get stats until this date") - include_bots: Optional[StrictBool] = Field(default=None, description="Whether include bots or not in statistics", alias="includeBots") - __properties: ClassVar[List[str]] = ["code", "from", "to", "includeBots"] - - @field_validator('code') - def code_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[a-zA-Z0-9!-]{3,50}$", value): - raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9!-]{3,50}$/") - return value + link_id: Optional[StrictStr] = Field(default=None, description="Link API ID") + var_from: Optional[datetime] = Field(default=None, description="Get stats from this date", alias="from") + to: Optional[datetime] = Field(default=None, description="Get stats until this date") + include_bots: Optional[StrictBool] = Field(default=False, description="Whether include bots or not in statistics") + __properties: ClassVar[List[str]] = ["link_id", "from", "to", "include_bots"] model_config = ConfigDict( populate_by_name=True, @@ -59,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of StatsRequest from a JSON string""" + """Create an instance of GetStatisticsRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StatsRequest from a dict""" + """Create an instance of GetStatisticsRequest from a dict""" if obj is None: return None @@ -92,10 +85,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "code": obj.get("code"), + "link_id": obj.get("link_id"), "from": obj.get("from"), "to": obj.get("to"), - "includeBots": obj.get("includeBots") + "include_bots": obj.get("include_bots") if obj.get("include_bots") is not None else False }) return _obj diff --git a/urlr/models/team200_response.py b/urlr/models/get_teams200_response.py similarity index 72% rename from urlr/models/team200_response.py rename to urlr/models/get_teams200_response.py index c0fe38a..c8c221e 100644 --- a/urlr/models/team200_response.py +++ b/urlr/models/get_teams200_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,15 +20,15 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from urlr.models.team200_response_teams_inner import Team200ResponseTeamsInner +from urlr.models.get_teams200_response_teams_inner import GetTeams200ResponseTeamsInner from typing import Optional, Set from typing_extensions import Self -class Team200Response(BaseModel): +class GetTeams200Response(BaseModel): """ - Team200Response + GetTeams200Response """ # noqa: E501 - teams: Optional[List[Team200ResponseTeamsInner]] = None + teams: Optional[List[GetTeams200ResponseTeamsInner]] = None __properties: ClassVar[List[str]] = ["teams"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Team200Response from a JSON string""" + """Create an instance of GetTeams200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Team200Response from a dict""" + """Create an instance of GetTeams200Response from a dict""" if obj is None: return None @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "teams": [Team200ResponseTeamsInner.from_dict(_item) for _item in obj["teams"]] if obj.get("teams") is not None else None + "teams": [GetTeams200ResponseTeamsInner.from_dict(_item) for _item in obj["teams"]] if obj.get("teams") is not None else None }) return _obj diff --git a/urlr/models/folder200_response_folders_inner.py b/urlr/models/get_teams200_response_teams_inner.py similarity index 74% rename from urlr/models/folder200_response_folders_inner.py rename to urlr/models/get_teams200_response_teams_inner.py index 47586db..de1309f 100644 --- a/urlr/models/folder200_response_folders_inner.py +++ b/urlr/models/get_teams200_response_teams_inner.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Folder200ResponseFoldersInner(BaseModel): +class GetTeams200ResponseTeamsInner(BaseModel): """ - Folder200ResponseFoldersInner + GetTeams200ResponseTeamsInner """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, description="Folder ID") - name: Optional[StrictStr] = Field(default=None, description="Folder name") + id: Optional[StrictStr] = Field(default=None, description="Team API ID") + name: Optional[StrictStr] = Field(default=None, description="Team name") __properties: ClassVar[List[str]] = ["id", "name"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Folder200ResponseFoldersInner from a JSON string""" + """Create an instance of GetTeams200ResponseTeamsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Folder200ResponseFoldersInner from a dict""" + """Create an instance of GetTeams200ResponseTeamsInner from a dict""" if obj is None: return None diff --git a/urlr/models/reduce_link400_response.py b/urlr/models/refresh_access_token401_response.py similarity index 70% rename from urlr/models/reduce_link400_response.py rename to urlr/models/refresh_access_token401_response.py index c5b398f..4bb7db9 100644 --- a/urlr/models/reduce_link400_response.py +++ b/urlr/models/refresh_access_token401_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,19 +18,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class ReduceLink400Response(BaseModel): +class RefreshAccessToken401Response(BaseModel): """ - ReduceLink400Response + RefreshAccessToken401Response """ # noqa: E501 - code: Optional[StrictInt] = Field(default=None, description="HTTP status code") - error: Optional[StrictInt] = Field(default=None, description="Error code") - message: Optional[StrictStr] = Field(default=None, description="Message describing the error") - __properties: ClassVar[List[str]] = ["code", "error", "message"] + code: Optional[StrictInt] = None + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "message"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReduceLink400Response from a JSON string""" + """Create an instance of RefreshAccessToken401Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReduceLink400Response from a dict""" + """Create an instance of RefreshAccessToken401Response from a dict""" if obj is None: return None @@ -84,7 +83,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "code": obj.get("code"), - "error": obj.get("error"), "message": obj.get("message") }) return _obj diff --git a/urlr/models/folder_request.py b/urlr/models/refresh_access_token_request.py similarity index 69% rename from urlr/models/folder_request.py rename to urlr/models/refresh_access_token_request.py index 5fc89d7..8756b3f 100644 --- a/urlr/models/folder_request.py +++ b/urlr/models/refresh_access_token_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class FolderRequest(BaseModel): +class RefreshAccessTokenRequest(BaseModel): """ - FolderRequest + RefreshAccessTokenRequest """ # noqa: E501 - team: StrictInt = Field(description="Team ID (displayed on dashboard)") - __properties: ClassVar[List[str]] = ["team"] + refresh_token: StrictStr = Field(description="Refresh token") + __properties: ClassVar[List[str]] = ["refresh_token"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FolderRequest from a JSON string""" + """Create an instance of RefreshAccessTokenRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FolderRequest from a dict""" + """Create an instance of RefreshAccessTokenRequest from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "team": obj.get("team") + "refresh_token": obj.get("refresh_token") }) return _obj diff --git a/urlr/rest.py b/urlr/rest.py index a24021c..25d4f27 100644 --- a/urlr/rest.py +++ b/urlr/rest.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Developer API - URLR + URLR API Reference - API powering the features of URLR. + API powering the features of URLR.

Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.

Key API principles:
- The version of the OpenAPI document: 0.3 + The version of the OpenAPI document: 1.0 Contact: contact@urlr.me Generated by OpenAPI Generator (https://openapi-generator.tech)