Skip to content

Commit cfa332e

Browse files
committed
1 parent 27ba417 commit cfa332e

2 files changed

Lines changed: 24 additions & 26 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ import urlr
5454
from urlr.rest import ApiException
5555
from pprint import pprint
5656

57-
# Authentification
57+
# Access Tokens
5858

5959
with urlr.ApiClient() as api_client:
60-
authentification_api = urlr.AuthentificationApi(api_client)
60+
access_tokens_api = urlr.AccessTokensApi(api_client)
6161

62-
authentification_request = urlr.AuthentificationRequest.from_json('{"username": "","password": ""}')
62+
access_tokens_request = urlr.AccessTokensRequest.from_json('{"username": "","password": ""}')
6363

6464
try:
65-
api_response = authentification_api.authentification(authentification_request=authentification_request)
65+
api_response = access_tokens_api.create_access_token(access_tokens_request=access_tokens_request)
6666
except ApiException as e:
67-
print("Exception when calling AuthentificationApi->authentification: %s\n" % e)
67+
print("Exception when calling AccessTokensApi->create_access_token: %s\n" % e)
6868
quit()
6969

7070
# Link shortening
@@ -74,15 +74,15 @@ configuration = urlr.Configuration(
7474
)
7575

7676
with urlr.ApiClient(configuration) as api_client:
77-
link_api = urlr.LinkApi(api_client)
78-
reduce_link_request = urlr.ReduceLinkRequest.from_json('{"url": "","team_id": ""}')
77+
link_api = urlr.LinksApi(api_client)
78+
create_link_request = urlr.CreateLinkRequest.from_json('{"url": "","team_id": ""}')
7979

8080
try:
81-
# Reduce a link
82-
api_response = link_api.reduce_link(reduce_link_request=reduce_link_request)
83-
pprint(api_response)
81+
# Create a link
82+
api_response = link_api.create_link(create_link_request=create_link_request)
83+
print(api_response)
8484
except Exception as e:
85-
print("Exception when calling LinkApi->reduce_link: %s\n" % e)
85+
print("Exception when calling LinksApi->create_link: %s\n" % e)
8686
```
8787

8888
A complete example is [available here](examples/example1.py).

examples/example1.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
from urlr.rest import ApiException
33
from pprint import pprint
44

5-
# Authentification
5+
# Access Tokens
66

77
with urlr.ApiClient() as api_client:
8-
authentification_api = urlr.AuthentificationApi(api_client)
8+
access_tokens_api = urlr.AccessTokensApi(api_client)
99

10-
authentification_request = urlr.AuthentificationRequest.from_json('{"username": "","password": ""}')
10+
access_tokens_request = urlr.AccessTokensRequest.from_json('{"username": "","password": ""}')
1111

1212
try:
13-
api_response = authentification_api.authentification(authentification_request=authentification_request)
13+
api_response = access_tokens_api.create_access_token(access_tokens_request=access_tokens_request)
1414
except ApiException as e:
15-
print("Exception when calling AuthentificationApi->authentification: %s\n" % e)
15+
print("Exception when calling AccessTokensApi->create_access_token: %s\n" % e)
1616
quit()
1717

1818
# Link shortening
@@ -22,25 +22,23 @@
2222
)
2323

2424
with urlr.ApiClient(configuration) as api_client:
25-
link_api = urlr.LinkApi(api_client)
26-
reduce_link_request = urlr.ReduceLinkRequest.from_json('{"url": "","team_id": ""}')
25+
link_api = urlr.LinksApi(api_client)
26+
create_link_request = urlr.CreateLinkRequest.from_json('{"url": "","team_id": ""}')
2727

2828
try:
29-
# Reduce a link
30-
api_response = link_api.reduce_link(reduce_link_request=reduce_link_request)
29+
api_response = link_api.create_link(create_link_request=create_link_request)
3130
pprint(api_response)
3231
except Exception as e:
33-
print("Exception when calling LinkApi->reduce_link: %s\n" % e)
32+
pprint("Exception when calling LinksApi->create_link: %s\n" % e)
3433

3534
# Statistics
3635

3736
with urlr.ApiClient(configuration) as api_client:
38-
stats_api = urlr.StatsApi(api_client)
39-
stats_request = urlr.StatsRequest.from_json('{"code": ""}')
37+
statistics_api = urlr.StatisticsApi(api_client)
38+
statistics_request = urlr.StatisticsRequest.from_json('{"link_id": ""}')
4039

4140
try:
42-
# Reduce a link
43-
api_response = stats_api.stats(stats_request=stats_request)
41+
api_response = statistics_api.statistics(statistics_request=statistics_request)
4442
pprint(api_response)
4543
except Exception as e:
46-
print("Exception when calling StatsApi->stats: %s\n" % e)
44+
print("Exception when calling StatisticsApi->statistics: %s\n" % e)

0 commit comments

Comments
 (0)