22from urlr .rest import ApiException
33from pprint import pprint
44
5- # Authentification
5+ # Access Tokens
66
77with 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
2222)
2323
2424with 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
3736with 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