Skip to content

Commit f1b42ea

Browse files
committed
Upgrade Python SDK to spec 1.9.0
1 parent d5b5d6f commit f1b42ea

File tree

125 files changed

+364
-139
lines changed

Some content is hidden

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

125 files changed

+364
-139
lines changed

docs/AvatarsApi.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Method | HTTP request | Description
88
[**delete_avatar**](AvatarsApi.md#delete_avatar) | **DELETE** /avatars/{avatarId} | Delete Avatar
99
[**get_avatar**](AvatarsApi.md#get_avatar) | **GET** /avatars/{avatarId} | Get Avatar
1010
[**get_favorited_avatars**](AvatarsApi.md#get_favorited_avatars) | **GET** /avatars/favorites | List Favorited Avatars
11+
[**get_own_avatar**](AvatarsApi.md#get_own_avatar) | **GET** /users/{userId}/avatar | Get Own Avatar
1112
[**search_avatars**](AvatarsApi.md#search_avatars) | **GET** /avatars | Search Avatars
1213
[**select_avatar**](AvatarsApi.md#select_avatar) | **PUT** /avatars/{avatarId}/select | Select Avatar
1314
[**select_fallback_avatar**](AvatarsApi.md#select_fallback_avatar) | **PUT** /avatars/{avatarId}/selectFallback | Select Fallback Avatar
@@ -404,6 +405,94 @@ Name | Type | Description | Notes
404405

405406
[[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)
406407

408+
# **get_own_avatar**
409+
> Avatar get_own_avatar(user_id)
410+
411+
Get Own Avatar
412+
413+
Get the current avatar for the user. This will return an error for any other user than the one logged in.
414+
415+
### Example
416+
417+
* Api Key Authentication (apiKeyCookie):
418+
* Api Key Authentication (authCookie):
419+
420+
```python
421+
import time
422+
import vrchatapi
423+
from vrchatapi.api import avatars_api
424+
from vrchatapi.model.avatar import Avatar
425+
from vrchatapi.model.error import Error
426+
from pprint import pprint
427+
# Defining the host is optional and defaults to https://api.vrchat.cloud/api/1
428+
# See configuration.py for a list of all supported configuration parameters.
429+
configuration = vrchatapi.Configuration(
430+
host = "https://api.vrchat.cloud/api/1"
431+
)
432+
433+
# The client must configure the authentication and authorization parameters
434+
# in accordance with the API server security policy.
435+
# Examples for each auth method are provided below, use the example that
436+
# satisfies your auth use case.
437+
438+
# Configure API key authorization: apiKeyCookie
439+
configuration.api_key['apiKeyCookie'] = 'YOUR_API_KEY'
440+
441+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
442+
# configuration.api_key_prefix['apiKeyCookie'] = 'Bearer'
443+
444+
# Configure API key authorization: authCookie
445+
configuration.api_key['authCookie'] = 'YOUR_API_KEY'
446+
447+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
448+
# configuration.api_key_prefix['authCookie'] = 'Bearer'
449+
450+
# Enter a context with an instance of the API client
451+
with vrchatapi.ApiClient(configuration) as api_client:
452+
# Create an instance of the API class
453+
api_instance = avatars_api.AvatarsApi(api_client)
454+
user_id = "userId_example" # str |
455+
456+
# example passing only required values which don't have defaults set
457+
try:
458+
# Get Own Avatar
459+
api_response = api_instance.get_own_avatar(user_id)
460+
pprint(api_response)
461+
except vrchatapi.ApiException as e:
462+
print("Exception when calling AvatarsApi->get_own_avatar: %s\n" % e)
463+
```
464+
465+
466+
### Parameters
467+
468+
Name | Type | Description | Notes
469+
------------- | ------------- | ------------- | -------------
470+
**user_id** | **str**| |
471+
472+
### Return type
473+
474+
[**Avatar**](Avatar.md)
475+
476+
### Authorization
477+
478+
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
479+
480+
### HTTP request headers
481+
482+
- **Content-Type**: Not defined
483+
- **Accept**: application/json
484+
485+
486+
### HTTP response details
487+
488+
| Status code | Description | Response headers |
489+
|-------------|-------------|------------------|
490+
**200** | Returns a single Avatar object. | - |
491+
**401** | Error response due to missing apiKey or auth cookie. | - |
492+
**403** | Error response when trying to see another users current avatar without sufficient admin permissions. | - |
493+
494+
[[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)
495+
407496
# **search_avatars**
408497
> [Avatar] search_avatars()
409498

docs/PlayerModerationType.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**value** | **str** | | defaults to "showAvatar", must be one of ["mute", "unmute", "block", "unblock", "hideAvatar", "showAvatar", "interactOn", "interactOff", ]
7+
**value** | **str** | | defaults to "unmute", must be one of ["mute", "unmute", "block", "unblock", "interactOn", "interactOff", ]
88

99
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1010

docs/PlayermoderationApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ with vrchatapi.ApiClient(configuration) as api_client:
410410
api_instance = playermoderation_api.PlayermoderationApi(api_client)
411411
moderate_user_request = ModerateUserRequest(
412412
moderated="usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469",
413-
type=PlayerModerationType("showAvatar"),
413+
type=PlayerModerationType("unmute"),
414414
) # ModerateUserRequest | (optional)
415415

416416
# example passing only required values which don't have defaults set
@@ -502,7 +502,7 @@ with vrchatapi.ApiClient(configuration) as api_client:
502502
api_instance = playermoderation_api.PlayermoderationApi(api_client)
503503
moderate_user_request = ModerateUserRequest(
504504
moderated="usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469",
505-
type=PlayerModerationType("showAvatar"),
505+
type=PlayerModerationType("unmute"),
506506
) # ModerateUserRequest | (optional)
507507

508508
# example passing only required values which don't have defaults set

setup.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
```python
3333
# Step 1. We begin with creating a Configuration, which contains the username and password for authentication.
3434
import vrchatapi
35-
from vrchatapi.api import authentication_api, users_api
35+
from vrchatapi.api import authentication_api
36+
from vrchatapi.exceptions import UnauthorizedException
37+
from vrchatapi.model.two_factor_auth_code import TwoFactorAuthCode
3638
3739
configuration = vrchatapi.Configuration(
3840
username = 'username',
@@ -51,9 +53,17 @@
5153
try:
5254
# Step 3. Calling getCurrentUser on Authentication API logs you in if the user isn't already logged in.
5355
current_user = auth_api.get_current_user()
54-
print("Logged in as:", current_user.display_name)
56+
except UnauthorizedException as e:
57+
if UnauthorizedException.status == 200:
58+
# Step 3.5. Calling verify2fa if the account has 2FA enabled
59+
auth_api.verify2_fa(two_factor_auth_code=TwoFactorAuthCode(input("2FA Code: ")))
60+
current_user = auth_api.get_current_user()
61+
else:
62+
print("Exception when calling API: %s\n", e)
5563
except vrchatapi.ApiException as e:
5664
print("Exception when calling API: %s\n", e)
65+
66+
print("Logged in as:", current_user.display_name)
5767
```
5868
5969
See [example.py](https://github.com/vrchatapi/vrchatapi-python/blob/main/example.py) for more example usage on getting started.
@@ -64,7 +74,7 @@
6474
6575
Join the [Discord server](https://discord.gg/Ge2APMhPfD) to get in touch with us.
6676
67-
The version of the OpenAPI document: 1.8.0
77+
The version of the OpenAPI document: 1.9.0
6878
Contact: me@ariesclark.com
6979
Generated by: https://openapi-generator.tech
7080
"""
@@ -73,7 +83,7 @@
7383
from setuptools import setup, find_packages # noqa: H301
7484

7585
NAME = "vrchatapi"
76-
VERSION = "1.8.0"
86+
VERSION = "1.9.0"
7787
# To install the library, run the following
7888
#
7989
# python setup.py install
@@ -132,7 +142,9 @@
132142
```python
133143
# Step 1. We begin with creating a Configuration, which contains the username and password for authentication.
134144
import vrchatapi
135-
from vrchatapi.api import authentication_api, users_api
145+
from vrchatapi.api import authentication_api
146+
from vrchatapi.exceptions import UnauthorizedException
147+
from vrchatapi.model.two_factor_auth_code import TwoFactorAuthCode
136148
137149
configuration = vrchatapi.Configuration(
138150
username = 'username',
@@ -151,9 +163,17 @@
151163
try:
152164
# Step 3. Calling getCurrentUser on Authentication API logs you in if the user isn't already logged in.
153165
current_user = auth_api.get_current_user()
154-
print("Logged in as:", current_user.display_name)
166+
except UnauthorizedException as e:
167+
if UnauthorizedException.status == 200:
168+
# Step 3.5. Calling verify2fa if the account has 2FA enabled
169+
auth_api.verify2_fa(two_factor_auth_code=TwoFactorAuthCode(input("2FA Code: ")))
170+
current_user = auth_api.get_current_user()
171+
else:
172+
print("Exception when calling API: %s\n", e)
155173
except vrchatapi.ApiException as e:
156174
print("Exception when calling API: %s\n", e)
175+
176+
print("Logged in as:", current_user.display_name)
157177
```
158178
159179
See [example.py](https://github.com/vrchatapi/vrchatapi-python/blob/main/example.py) for more example usage on getting started.

vrchatapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
VRChat API Documentation
55
66
7-
The version of the OpenAPI document: 1.8.0
7+
The version of the OpenAPI document: 1.9.0
88
Contact: me@ariesclark.com
99
Generated by: https://openapi-generator.tech
1010
"""

vrchatapi/api/authentication_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VRChat API Documentation
33
44
5-
The version of the OpenAPI document: 1.8.0
5+
The version of the OpenAPI document: 1.9.0
66
Contact: me@ariesclark.com
77
Generated by: https://openapi-generator.tech
88
"""

vrchatapi/api/avatars_api.py

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VRChat API Documentation
33
44
5-
The version of the OpenAPI document: 1.8.0
5+
The version of the OpenAPI document: 1.9.0
66
Contact: me@ariesclark.com
77
Generated by: https://openapi-generator.tech
88
"""
@@ -351,6 +351,58 @@ def __init__(self, api_client=None):
351351
},
352352
api_client=api_client
353353
)
354+
self.get_own_avatar_endpoint = _Endpoint(
355+
settings={
356+
'response_type': (Avatar,),
357+
'auth': [
358+
'apiKeyCookie',
359+
'authCookie'
360+
],
361+
'endpoint_path': '/users/{userId}/avatar',
362+
'operation_id': 'get_own_avatar',
363+
'http_method': 'GET',
364+
'servers': None,
365+
},
366+
params_map={
367+
'all': [
368+
'user_id',
369+
],
370+
'required': [
371+
'user_id',
372+
],
373+
'nullable': [
374+
],
375+
'enum': [
376+
],
377+
'validation': [
378+
]
379+
},
380+
root_map={
381+
'validations': {
382+
},
383+
'allowed_values': {
384+
},
385+
'openapi_types': {
386+
'user_id':
387+
(str,),
388+
},
389+
'attribute_map': {
390+
'user_id': 'userId',
391+
},
392+
'location_map': {
393+
'user_id': 'path',
394+
},
395+
'collection_format_map': {
396+
}
397+
},
398+
headers_map={
399+
'accept': [
400+
'application/json'
401+
],
402+
'content_type': [],
403+
},
404+
api_client=api_client
405+
)
354406
self.search_avatars_endpoint = _Endpoint(
355407
settings={
356408
'response_type': ([Avatar],),
@@ -944,6 +996,72 @@ def get_favorited_avatars(
944996
kwargs['_host_index'] = kwargs.get('_host_index')
945997
return self.get_favorited_avatars_endpoint.call_with_http_info(**kwargs)
946998

999+
def get_own_avatar(
1000+
self,
1001+
user_id,
1002+
**kwargs
1003+
):
1004+
"""Get Own Avatar # noqa: E501
1005+
1006+
Get the current avatar for the user. This will return an error for any other user than the one logged in. # noqa: E501
1007+
This method makes a synchronous HTTP request by default. To make an
1008+
asynchronous HTTP request, please pass async_req=True
1009+
1010+
>>> thread = api.get_own_avatar(user_id, async_req=True)
1011+
>>> result = thread.get()
1012+
1013+
Args:
1014+
user_id (str):
1015+
1016+
Keyword Args:
1017+
_return_http_data_only (bool): response data without head status
1018+
code and headers. Default is True.
1019+
_preload_content (bool): if False, the urllib3.HTTPResponse object
1020+
will be returned without reading/decoding response data.
1021+
Default is True.
1022+
_request_timeout (int/float/tuple): timeout setting for this request. If
1023+
one number provided, it will be total request timeout. It can also
1024+
be a pair (tuple) of (connection, read) timeouts.
1025+
Default is None.
1026+
_check_input_type (bool): specifies if type checking
1027+
should be done one the data sent to the server.
1028+
Default is True.
1029+
_check_return_type (bool): specifies if type checking
1030+
should be done one the data received from the server.
1031+
Default is True.
1032+
_host_index (int/None): specifies the index of the server
1033+
that we want to use.
1034+
Default is read from the configuration.
1035+
async_req (bool): execute request asynchronously
1036+
1037+
Returns:
1038+
Avatar
1039+
If the method is called asynchronously, returns the request
1040+
thread.
1041+
"""
1042+
kwargs['async_req'] = kwargs.get(
1043+
'async_req', False
1044+
)
1045+
kwargs['_return_http_data_only'] = kwargs.get(
1046+
'_return_http_data_only', True
1047+
)
1048+
kwargs['_preload_content'] = kwargs.get(
1049+
'_preload_content', True
1050+
)
1051+
kwargs['_request_timeout'] = kwargs.get(
1052+
'_request_timeout', None
1053+
)
1054+
kwargs['_check_input_type'] = kwargs.get(
1055+
'_check_input_type', True
1056+
)
1057+
kwargs['_check_return_type'] = kwargs.get(
1058+
'_check_return_type', True
1059+
)
1060+
kwargs['_host_index'] = kwargs.get('_host_index')
1061+
kwargs['user_id'] = \
1062+
user_id
1063+
return self.get_own_avatar_endpoint.call_with_http_info(**kwargs)
1064+
9471065
def search_avatars(
9481066
self,
9491067
**kwargs

vrchatapi/api/economy_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VRChat API Documentation
33
44
5-
The version of the OpenAPI document: 1.8.0
5+
The version of the OpenAPI document: 1.9.0
66
Contact: me@ariesclark.com
77
Generated by: https://openapi-generator.tech
88
"""

vrchatapi/api/favorites_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VRChat API Documentation
33
44
5-
The version of the OpenAPI document: 1.8.0
5+
The version of the OpenAPI document: 1.9.0
66
Contact: me@ariesclark.com
77
Generated by: https://openapi-generator.tech
88
"""

vrchatapi/api/files_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VRChat API Documentation
33
44
5-
The version of the OpenAPI document: 1.8.0
5+
The version of the OpenAPI document: 1.9.0
66
Contact: me@ariesclark.com
77
Generated by: https://openapi-generator.tech
88
"""

0 commit comments

Comments
 (0)