Skip to content

Commit

Permalink
Upgrade Python SDK to spec 1.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
VRCCat committed Jan 5, 2024
1 parent 438a4ea commit b45307f
Show file tree
Hide file tree
Showing 7 changed files with 802 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ docs/License.md
docs/LicenseAction.md
docs/LicenseGroup.md
docs/LicenseType.md
docs/LimitedGroup.md
docs/LimitedUnityPackage.md
docs/LimitedUser.md
docs/LimitedWorld.md
Expand Down Expand Up @@ -234,6 +235,7 @@ vrchatapi/models/license.py
vrchatapi/models/license_action.py
vrchatapi/models/license_group.py
vrchatapi/models/license_type.py
vrchatapi/models/limited_group.py
vrchatapi/models/limited_unity_package.py
vrchatapi/models/limited_user.py
vrchatapi/models/limited_world.py
Expand Down
68 changes: 68 additions & 0 deletions docs/GroupsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Method | HTTP request | Description
[**leave_group**](GroupsApi.md#leave_group) | **POST** /groups/{groupId}/leave | Leave Group
[**remove_group_member_role**](GroupsApi.md#remove_group_member_role) | **DELETE** /groups/{groupId}/members/{userId}/roles/{groupRoleId} | Remove Role from GroupMember
[**respond_group_join_request**](GroupsApi.md#respond_group_join_request) | **PUT** /groups/{groupId}/requests/{userId} | Respond Group Join request
[**search_groups**](GroupsApi.md#search_groups) | **GET** /groups | Search Group
[**unban_group_member**](GroupsApi.md#unban_group_member) | **DELETE** /groups/{groupId}/bans/{userId} | Unban Group Member
[**update_group**](GroupsApi.md#update_group) | **PUT** /groups/{groupId} | Update Group
[**update_group_gallery**](GroupsApi.md#update_group_gallery) | **PUT** /groups/{groupId}/galleries/{groupGalleryId} | Update Group Gallery
Expand Down Expand Up @@ -2433,6 +2434,73 @@ void (empty response body)

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

# **search_groups**
> list[LimitedGroup] search_groups(query=query, offset=offset, n=n)
Search Group

Searches Groups by name or shortCode

### Example

```python
from __future__ import print_function
import time
import vrchatapi
from vrchatapi.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.vrchat.cloud/api/1
# See configuration.py for a list of all supported configuration parameters.
configuration = vrchatapi.Configuration(
host = "https://api.vrchat.cloud/api/1"
)


# Enter a context with an instance of the API client
with vrchatapi.ApiClient() as api_client:
# Create an instance of the API class
api_instance = vrchatapi.GroupsApi(api_client)
query = 'query_example' # str | Query to search for, can be either Group Name or Group shortCode (optional)
offset = 56 # int | A zero-based offset from the default object sorting from where search results start. (optional)
n = 60 # int | The number of objects to return. (optional) (default to 60)

try:
# Search Group
api_response = api_instance.search_groups(query=query, offset=offset, n=n)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupsApi->search_groups: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **str**| Query to search for, can be either Group Name or Group shortCode | [optional]
**offset** | **int**| A zero-based offset from the default object sorting from where search results start. | [optional]
**n** | **int**| The number of objects to return. | [optional] [default to 60]

### Return type

[**list[LimitedGroup]**](LimitedGroup.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Returns a list of LimitedGroup objects. | - |
**401** | Error response due to missing auth cookie. | - |

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

# **unban_group_member**
> GroupMember unban_group_member(group_id, user_id)
Expand Down
27 changes: 27 additions & 0 deletions docs/LimitedGroup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# LimitedGroup


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | | [optional]
**name** | **str** | | [optional]
**short_code** | **str** | | [optional]
**discriminator** | **str** | | [optional]
**description** | **str** | | [optional]
**icon_url** | **str** | | [optional]
**banner_url** | **str** | | [optional]
**owner_id** | **str** | A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed. | [optional]
**rules** | **str** | | [optional]
**icon_id** | **str** | | [optional]
**banner_id** | **str** | | [optional]
**member_count** | **int** | | [optional]
**tags** | **list[str]** | | [optional]
**created_at** | **datetime** | | [optional]
**membership_status** | [**GroupMemberStatus**](GroupMemberStatus.md) | | [optional]
**is_searchable** | **bool** | | [optional]
**galleries** | [**list[GroupGallery]**](GroupGallery.md) | | [optional]

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


1 change: 1 addition & 0 deletions vrchatapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
from vrchatapi.models.license_action import LicenseAction
from vrchatapi.models.license_group import LicenseGroup
from vrchatapi.models.license_type import LicenseType
from vrchatapi.models.limited_group import LimitedGroup
from vrchatapi.models.limited_unity_package import LimitedUnityPackage
from vrchatapi.models.limited_user import LimitedUser
from vrchatapi.models.limited_world import LimitedWorld
Expand Down
155 changes: 155 additions & 0 deletions vrchatapi/api/groups_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4683,6 +4683,161 @@ def respond_group_join_request_with_http_info(self, group_id, user_id, **kwargs)
collection_formats=collection_formats,
_request_auth=local_var_params.get('_request_auth'))

def search_groups(self, **kwargs): # noqa: E501
"""Search Group # noqa: E501
Searches Groups by name or shortCode # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.search_groups(async_req=True)
>>> result = thread.get()
:param query: Query to search for, can be either Group Name or Group shortCode
:type query: str
:param offset: A zero-based offset from the default object sorting from where search results start.
:type offset: int
:param n: The number of objects to return.
:type n: int
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:type _preload_content: bool, optional
: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.
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: list[LimitedGroup]
"""
kwargs['_return_http_data_only'] = True
return self.search_groups_with_http_info(**kwargs) # noqa: E501

def search_groups_with_http_info(self, **kwargs): # noqa: E501
"""Search Group # noqa: E501
Searches Groups by name or shortCode # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.search_groups_with_http_info(async_req=True)
>>> result = thread.get()
:param query: Query to search for, can be either Group Name or Group shortCode
:type query: str
:param offset: A zero-based offset from the default object sorting from where search results start.
:type offset: int
:param n: The number of objects to return.
:type n: int
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
and headers
:type _return_http_data_only: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:type _preload_content: bool, optional
: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.
: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
:type _content_type: string, optional: force content-type for the request
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: tuple(list[LimitedGroup], status_code(int), headers(HTTPHeaderDict))
"""

local_var_params = locals()

all_params = [
'query',
'offset',
'n'
]
all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)

for key, val in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method search_groups" % key
)
local_var_params[key] = val
del local_var_params['kwargs']

if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501
raise ApiValueError("Invalid value for parameter `offset` when calling `search_groups`, must be a value greater than or equal to `0`") # noqa: E501
if self.api_client.client_side_validation and 'n' in local_var_params and local_var_params['n'] > 100: # noqa: E501
raise ApiValueError("Invalid value for parameter `n` when calling `search_groups`, must be a value less than or equal to `100`") # noqa: E501
if self.api_client.client_side_validation and 'n' in local_var_params and local_var_params['n'] < 1: # noqa: E501
raise ApiValueError("Invalid value for parameter `n` when calling `search_groups`, must be a value greater than or equal to `1`") # noqa: E501
collection_formats = {}

path_params = {}

query_params = []
if local_var_params.get('query') is not None: # noqa: E501
query_params.append(('query', local_var_params['query'])) # noqa: E501
if local_var_params.get('offset') is not None: # noqa: E501
query_params.append(('offset', local_var_params['offset'])) # noqa: E501
if local_var_params.get('n') is not None: # noqa: E501
query_params.append(('n', local_var_params['n'])) # noqa: E501

header_params = dict(local_var_params.get('_headers', {}))

form_params = []
local_var_files = {}

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501

response_types_map = {
200: "list[LimitedGroup]",
401: "Error",
}

return self.api_client.call_api(
'/groups', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_types_map=response_types_map,
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats,
_request_auth=local_var_params.get('_request_auth'))

def unban_group_member(self, group_id, user_id, **kwargs): # noqa: E501
"""Unban Group Member # noqa: E501
Expand Down
1 change: 1 addition & 0 deletions vrchatapi/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
from vrchatapi.models.license_action import LicenseAction
from vrchatapi.models.license_group import LicenseGroup
from vrchatapi.models.license_type import LicenseType
from vrchatapi.models.limited_group import LimitedGroup
from vrchatapi.models.limited_unity_package import LimitedUnityPackage
from vrchatapi.models.limited_user import LimitedUser
from vrchatapi.models.limited_world import LimitedWorld
Expand Down
Loading

0 comments on commit b45307f

Please sign in to comment.