2024-01-14 12:30:33 +02:00

2435 lines
101 KiB
Python

# coding: utf-8
"""
PeerTube
The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) which generates a client SDK in the language of your choice - we generate some client SDKs automatically: - [Python](https://framagit.org/framasoft/peertube/clients/python) - [Go](https://framagit.org/framasoft/peertube/clients/go) - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) See the [REST API quick start](https://docs.joinpeertube.org/api/rest-getting-started) for a few examples of using the PeerTube API. # Authentication When you sign up for an account on a PeerTube instance, you are given the possibility to generate sessions on it, and authenticate there using an access token. Only __one access token can currently be used at a time__. ## Roles Accounts are given permissions based on their role. There are three roles on PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin/managing-users#roles) for a detail of their permissions. # Errors The API uses standard HTTP status codes to indicate the success or failure of the API call, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body. ``` HTTP 1.1 404 Not Found Content-Type: application/problem+json; charset=utf-8 { \"detail\": \"Video not found\", \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\", \"status\": 404, \"title\": \"Not Found\", \"type\": \"about:blank\" } ``` We provide error `type` values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/packages/models/src/server/core-error-code.enum.ts), but it is still optional. Types are used to disambiguate errors that bear the same status code and are non-obvious: ``` HTTP 1.1 403 Forbidden Content-Type: application/problem+json; charset=utf-8 { \"detail\": \"Cannot get this video regarding follow constraints\", \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\", \"status\": 403, \"title\": \"Forbidden\", \"type\": \"https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints\" } ``` Here a 403 error could otherwise mean that the video is private or blocklisted. ### Validation errors Each parameter is evaluated on its own against a set of rules before the route validator proceeds with potential testing involving parameter combinations. Errors coming from validation errors appear earlier and benefit from a more detailed error description: ``` HTTP 1.1 400 Bad Request Content-Type: application/problem+json; charset=utf-8 { \"detail\": \"Incorrect request parameters: id\", \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\", \"instance\": \"/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180\", \"invalid-params\": { \"id\": { \"location\": \"params\", \"msg\": \"Invalid value\", \"param\": \"id\", \"value\": \"9c9de5e8-0a1e-484a-b099-e80766180\" } }, \"status\": 400, \"title\": \"Bad Request\", \"type\": \"about:blank\" } ``` Where `id` is the name of the field concerned by the error, within the route definition. `invalid-params.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and `invalid-params.<field>.value` reports the value that didn't pass validation whose `invalid-params.<field>.msg` is about. ### Deprecated error fields Some fields could be included with previous versions. They are still included but their use is deprecated: - `error`: superseded by `detail` - `code`: superseded by `type` (which is now an URI) # Rate limits We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators: | Endpoint (prefix: `/api/v1`) | Calls | Time frame | |------------------------------|---------------|--------------| | `/*` | 50 | 10 seconds | | `POST /users/token` | 15 | 5 minutes | | `POST /users/register` | 2<sup>*</sup> | 5 minutes | | `POST /users/ask-send-verify-email` | 3 | 5 minutes | Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service limit is announced by a `429 Too Many Requests` status code. You can get details about the current state of your rate limit by reading the following headers: | Header | Description | |-------------------------|------------------------------------------------------------| | `X-RateLimit-Limit` | Number of max requests allowed in the current time period | | `X-RateLimit-Remaining` | Number of remaining requests in the current time period | | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp | | `Retry-After` | Seconds to delay after the first `429` is received | # CORS This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/), allowing cross-domain communication from the browser for some routes: | Endpoint | |------------------------- ---| | `/api/*` | | `/download/*` | | `/lazy-static/*` | | `/.well-known/webfinger` | In addition, all routes serving ActivityPub are CORS-enabled for all origins.
The version of the OpenAPI document: 5.2.0
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, StrictInt, StrictStr, field_validator
from typing import List, Optional
from typing_extensions import Annotated
from peertube.models.abuse_state_set import AbuseStateSet
from peertube.models.api_v1_abuses_abuse_id_messages_get200_response import ApiV1AbusesAbuseIdMessagesGet200Response
from peertube.models.api_v1_abuses_abuse_id_messages_post_request import ApiV1AbusesAbuseIdMessagesPostRequest
from peertube.models.api_v1_abuses_abuse_id_put_request import ApiV1AbusesAbuseIdPutRequest
from peertube.models.api_v1_abuses_post200_response import ApiV1AbusesPost200Response
from peertube.models.api_v1_abuses_post_request import ApiV1AbusesPostRequest
from peertube.models.get_my_abuses200_response import GetMyAbuses200Response
from peertube.api_client import ApiClient, RequestSerialized
from peertube.api_response import ApiResponse
from peertube.rest import RESTResponseType
class AbusesApi:
"""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 api_v1_abuses_abuse_id_delete(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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,
) -> None:
"""Delete an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_delete_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
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 api_v1_abuses_abuse_id_delete_with_http_info(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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[None]:
"""Delete an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_delete_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
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 api_v1_abuses_abuse_id_delete_without_preload_content(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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:
"""Delete an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_delete_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_abuse_id_delete_serialize(
self,
abuse_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if abuse_id is not None:
_path_params['abuseId'] = abuse_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# authentication setting
_auth_settings: List[str] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='DELETE',
resource_path='/api/v1/abuses/{abuseId}',
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 api_v1_abuses_abuse_id_messages_abuse_message_id_delete(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
abuse_message_id: Annotated[int, Field(strict=True, ge=1, description="Abuse message 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,
) -> None:
"""Delete an abuse message
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param abuse_message_id: Abuse message id (required)
:type abuse_message_id: int
: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._api_v1_abuses_abuse_id_messages_abuse_message_id_delete_serialize(
abuse_id=abuse_id,
abuse_message_id=abuse_message_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
}
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 api_v1_abuses_abuse_id_messages_abuse_message_id_delete_with_http_info(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
abuse_message_id: Annotated[int, Field(strict=True, ge=1, description="Abuse message 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[None]:
"""Delete an abuse message
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param abuse_message_id: Abuse message id (required)
:type abuse_message_id: int
: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._api_v1_abuses_abuse_id_messages_abuse_message_id_delete_serialize(
abuse_id=abuse_id,
abuse_message_id=abuse_message_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
}
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 api_v1_abuses_abuse_id_messages_abuse_message_id_delete_without_preload_content(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
abuse_message_id: Annotated[int, Field(strict=True, ge=1, description="Abuse message 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:
"""Delete an abuse message
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param abuse_message_id: Abuse message id (required)
:type abuse_message_id: int
: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._api_v1_abuses_abuse_id_messages_abuse_message_id_delete_serialize(
abuse_id=abuse_id,
abuse_message_id=abuse_message_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_abuse_id_messages_abuse_message_id_delete_serialize(
self,
abuse_id,
abuse_message_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if abuse_id is not None:
_path_params['abuseId'] = abuse_id
if abuse_message_id is not None:
_path_params['abuseMessageId'] = abuse_message_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# authentication setting
_auth_settings: List[str] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='DELETE',
resource_path='/api/v1/abuses/{abuseId}/messages/{abuseMessageId}',
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 api_v1_abuses_abuse_id_messages_get(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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,
) -> ApiV1AbusesAbuseIdMessagesGet200Response:
"""List messages of an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_messages_get_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesAbuseIdMessagesGet200Response",
}
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 api_v1_abuses_abuse_id_messages_get_with_http_info(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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[ApiV1AbusesAbuseIdMessagesGet200Response]:
"""List messages of an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_messages_get_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesAbuseIdMessagesGet200Response",
}
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 api_v1_abuses_abuse_id_messages_get_without_preload_content(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse 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:
"""List messages of an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
: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._api_v1_abuses_abuse_id_messages_get_serialize(
abuse_id=abuse_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesAbuseIdMessagesGet200Response",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_abuse_id_messages_get_serialize(
self,
abuse_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if abuse_id is not None:
_path_params['abuseId'] = abuse_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'
]
)
# authentication setting
_auth_settings: List[str] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/api/v1/abuses/{abuseId}/messages',
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 api_v1_abuses_abuse_id_messages_post(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest,
_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,
) -> None:
"""Add message to an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_messages_post_request: (required)
:type api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest
: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._api_v1_abuses_abuse_id_messages_post_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_messages_post_request=api_v1_abuses_abuse_id_messages_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'400': None,
}
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 api_v1_abuses_abuse_id_messages_post_with_http_info(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest,
_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[None]:
"""Add message to an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_messages_post_request: (required)
:type api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest
: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._api_v1_abuses_abuse_id_messages_post_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_messages_post_request=api_v1_abuses_abuse_id_messages_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'400': None,
}
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 api_v1_abuses_abuse_id_messages_post_without_preload_content(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest,
_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:
"""Add message to an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_messages_post_request: (required)
:type api_v1_abuses_abuse_id_messages_post_request: ApiV1AbusesAbuseIdMessagesPostRequest
: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._api_v1_abuses_abuse_id_messages_post_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_messages_post_request=api_v1_abuses_abuse_id_messages_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'400': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_abuse_id_messages_post_serialize(
self,
abuse_id,
api_v1_abuses_abuse_id_messages_post_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if abuse_id is not None:
_path_params['abuseId'] = abuse_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if api_v1_abuses_abuse_id_messages_post_request is not None:
_body_params = api_v1_abuses_abuse_id_messages_post_request
# 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] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/api/v1/abuses/{abuseId}/messages',
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 api_v1_abuses_abuse_id_put(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_put_request: Optional[ApiV1AbusesAbuseIdPutRequest] = 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,
) -> None:
"""Update an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_put_request:
:type api_v1_abuses_abuse_id_put_request: ApiV1AbusesAbuseIdPutRequest
: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._api_v1_abuses_abuse_id_put_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_put_request=api_v1_abuses_abuse_id_put_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
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 api_v1_abuses_abuse_id_put_with_http_info(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_put_request: Optional[ApiV1AbusesAbuseIdPutRequest] = 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[None]:
"""Update an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_put_request:
:type api_v1_abuses_abuse_id_put_request: ApiV1AbusesAbuseIdPutRequest
: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._api_v1_abuses_abuse_id_put_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_put_request=api_v1_abuses_abuse_id_put_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
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 api_v1_abuses_abuse_id_put_without_preload_content(
self,
abuse_id: Annotated[int, Field(strict=True, ge=1, description="Abuse id")],
api_v1_abuses_abuse_id_put_request: Optional[ApiV1AbusesAbuseIdPutRequest] = 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:
"""Update an abuse
:param abuse_id: Abuse id (required)
:type abuse_id: int
:param api_v1_abuses_abuse_id_put_request:
:type api_v1_abuses_abuse_id_put_request: ApiV1AbusesAbuseIdPutRequest
: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._api_v1_abuses_abuse_id_put_serialize(
abuse_id=abuse_id,
api_v1_abuses_abuse_id_put_request=api_v1_abuses_abuse_id_put_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'404': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_abuse_id_put_serialize(
self,
abuse_id,
api_v1_abuses_abuse_id_put_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if abuse_id is not None:
_path_params['abuseId'] = abuse_id
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if api_v1_abuses_abuse_id_put_request is not None:
_body_params = api_v1_abuses_abuse_id_put_request
# 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] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='PUT',
resource_path='/api/v1/abuses/{abuseId}',
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 api_v1_abuses_post(
self,
api_v1_abuses_post_request: ApiV1AbusesPostRequest,
_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,
) -> ApiV1AbusesPost200Response:
"""Report an abuse
:param api_v1_abuses_post_request: (required)
:type api_v1_abuses_post_request: ApiV1AbusesPostRequest
: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._api_v1_abuses_post_serialize(
api_v1_abuses_post_request=api_v1_abuses_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesPost200Response",
'400': None,
}
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 api_v1_abuses_post_with_http_info(
self,
api_v1_abuses_post_request: ApiV1AbusesPostRequest,
_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[ApiV1AbusesPost200Response]:
"""Report an abuse
:param api_v1_abuses_post_request: (required)
:type api_v1_abuses_post_request: ApiV1AbusesPostRequest
: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._api_v1_abuses_post_serialize(
api_v1_abuses_post_request=api_v1_abuses_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesPost200Response",
'400': None,
}
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 api_v1_abuses_post_without_preload_content(
self,
api_v1_abuses_post_request: ApiV1AbusesPostRequest,
_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:
"""Report an abuse
:param api_v1_abuses_post_request: (required)
:type api_v1_abuses_post_request: ApiV1AbusesPostRequest
: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._api_v1_abuses_post_serialize(
api_v1_abuses_post_request=api_v1_abuses_post_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "ApiV1AbusesPost200Response",
'400': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _api_v1_abuses_post_serialize(
self,
api_v1_abuses_post_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, str] = {}
_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 api_v1_abuses_post_request is not None:
_body_params = api_v1_abuses_post_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] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/api/v1/abuses',
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_abuses(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
predefined_reason: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=8)]], Field(description="predefined reason the listed reports should contain")] = None,
search: Annotated[Optional[StrictStr], Field(description="plain search that will match with video titles, reporter names and more")] = None,
state: Optional[AbuseStateSet] = None,
search_reporter: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reporter")] = None,
search_reportee: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reportee")] = None,
search_video: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video")] = None,
search_video_channel: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video channel")] = None,
video_is: Annotated[Optional[StrictStr], Field(description="only list deleted or blocklisted videos")] = None,
filter: Annotated[Optional[StrictStr], Field(description="only list account, comment or video reports")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = 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,
) -> GetMyAbuses200Response:
"""List abuses
:param id: only list the report with this id
:type id: int
:param predefined_reason: predefined reason the listed reports should contain
:type predefined_reason: List[str]
:param search: plain search that will match with video titles, reporter names and more
:type search: str
:param state:
:type state: AbuseStateSet
:param search_reporter: only list reports of a specific reporter
:type search_reporter: str
:param search_reportee: only list reports of a specific reportee
:type search_reportee: str
:param search_video: only list reports of a specific video
:type search_video: str
:param search_video_channel: only list reports of a specific video channel
:type search_video_channel: str
:param video_is: only list deleted or blocklisted videos
:type video_is: str
:param filter: only list account, comment or video reports
:type filter: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
:param sort: Sort abuses by criteria
:type sort: 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_abuses_serialize(
id=id,
predefined_reason=predefined_reason,
search=search,
state=state,
search_reporter=search_reporter,
search_reportee=search_reportee,
search_video=search_video,
search_video_channel=search_video_channel,
video_is=video_is,
filter=filter,
start=start,
count=count,
sort=sort,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
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_abuses_with_http_info(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
predefined_reason: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=8)]], Field(description="predefined reason the listed reports should contain")] = None,
search: Annotated[Optional[StrictStr], Field(description="plain search that will match with video titles, reporter names and more")] = None,
state: Optional[AbuseStateSet] = None,
search_reporter: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reporter")] = None,
search_reportee: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reportee")] = None,
search_video: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video")] = None,
search_video_channel: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video channel")] = None,
video_is: Annotated[Optional[StrictStr], Field(description="only list deleted or blocklisted videos")] = None,
filter: Annotated[Optional[StrictStr], Field(description="only list account, comment or video reports")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = 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[GetMyAbuses200Response]:
"""List abuses
:param id: only list the report with this id
:type id: int
:param predefined_reason: predefined reason the listed reports should contain
:type predefined_reason: List[str]
:param search: plain search that will match with video titles, reporter names and more
:type search: str
:param state:
:type state: AbuseStateSet
:param search_reporter: only list reports of a specific reporter
:type search_reporter: str
:param search_reportee: only list reports of a specific reportee
:type search_reportee: str
:param search_video: only list reports of a specific video
:type search_video: str
:param search_video_channel: only list reports of a specific video channel
:type search_video_channel: str
:param video_is: only list deleted or blocklisted videos
:type video_is: str
:param filter: only list account, comment or video reports
:type filter: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
:param sort: Sort abuses by criteria
:type sort: 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_abuses_serialize(
id=id,
predefined_reason=predefined_reason,
search=search,
state=state,
search_reporter=search_reporter,
search_reportee=search_reportee,
search_video=search_video,
search_video_channel=search_video_channel,
video_is=video_is,
filter=filter,
start=start,
count=count,
sort=sort,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
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_abuses_without_preload_content(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
predefined_reason: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=8)]], Field(description="predefined reason the listed reports should contain")] = None,
search: Annotated[Optional[StrictStr], Field(description="plain search that will match with video titles, reporter names and more")] = None,
state: Optional[AbuseStateSet] = None,
search_reporter: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reporter")] = None,
search_reportee: Annotated[Optional[StrictStr], Field(description="only list reports of a specific reportee")] = None,
search_video: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video")] = None,
search_video_channel: Annotated[Optional[StrictStr], Field(description="only list reports of a specific video channel")] = None,
video_is: Annotated[Optional[StrictStr], Field(description="only list deleted or blocklisted videos")] = None,
filter: Annotated[Optional[StrictStr], Field(description="only list account, comment or video reports")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = 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:
"""List abuses
:param id: only list the report with this id
:type id: int
:param predefined_reason: predefined reason the listed reports should contain
:type predefined_reason: List[str]
:param search: plain search that will match with video titles, reporter names and more
:type search: str
:param state:
:type state: AbuseStateSet
:param search_reporter: only list reports of a specific reporter
:type search_reporter: str
:param search_reportee: only list reports of a specific reportee
:type search_reportee: str
:param search_video: only list reports of a specific video
:type search_video: str
:param search_video_channel: only list reports of a specific video channel
:type search_video_channel: str
:param video_is: only list deleted or blocklisted videos
:type video_is: str
:param filter: only list account, comment or video reports
:type filter: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
:param sort: Sort abuses by criteria
:type sort: 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_abuses_serialize(
id=id,
predefined_reason=predefined_reason,
search=search,
state=state,
search_reporter=search_reporter,
search_reportee=search_reportee,
search_video=search_video,
search_video_channel=search_video_channel,
video_is=video_is,
filter=filter,
start=start,
count=count,
sort=sort,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_abuses_serialize(
self,
id,
predefined_reason,
search,
state,
search_reporter,
search_reportee,
search_video,
search_video_channel,
video_is,
filter,
start,
count,
sort,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
'predefinedReason': 'multi',
}
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if id is not None:
_query_params.append(('id', id))
if predefined_reason is not None:
_query_params.append(('predefinedReason', predefined_reason))
if search is not None:
_query_params.append(('search', search))
if state is not None:
_query_params.append(('state', state.value))
if search_reporter is not None:
_query_params.append(('searchReporter', search_reporter))
if search_reportee is not None:
_query_params.append(('searchReportee', search_reportee))
if search_video is not None:
_query_params.append(('searchVideo', search_video))
if search_video_channel is not None:
_query_params.append(('searchVideoChannel', search_video_channel))
if video_is is not None:
_query_params.append(('videoIs', video_is))
if filter is not None:
_query_params.append(('filter', filter))
if start is not None:
_query_params.append(('start', start))
if count is not None:
_query_params.append(('count', count))
if sort is not None:
_query_params.append(('sort', sort))
# 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'
]
)
# authentication setting
_auth_settings: List[str] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/api/v1/abuses',
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_my_abuses(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
state: Optional[AbuseStateSet] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = 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,
) -> GetMyAbuses200Response:
"""List my abuses
:param id: only list the report with this id
:type id: int
:param state:
:type state: AbuseStateSet
:param sort: Sort abuses by criteria
:type sort: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
: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_my_abuses_serialize(
id=id,
state=state,
sort=sort,
start=start,
count=count,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
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_my_abuses_with_http_info(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
state: Optional[AbuseStateSet] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = 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[GetMyAbuses200Response]:
"""List my abuses
:param id: only list the report with this id
:type id: int
:param state:
:type state: AbuseStateSet
:param sort: Sort abuses by criteria
:type sort: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
: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_my_abuses_serialize(
id=id,
state=state,
sort=sort,
start=start,
count=count,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
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_my_abuses_without_preload_content(
self,
id: Annotated[Optional[StrictInt], Field(description="only list the report with this id")] = None,
state: Optional[AbuseStateSet] = None,
sort: Annotated[Optional[StrictStr], Field(description="Sort abuses by criteria")] = None,
start: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Offset used to paginate results")] = None,
count: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of items to return")] = 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:
"""List my abuses
:param id: only list the report with this id
:type id: int
:param state:
:type state: AbuseStateSet
:param sort: Sort abuses by criteria
:type sort: str
:param start: Offset used to paginate results
:type start: int
:param count: Number of items to return
:type count: int
: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_my_abuses_serialize(
id=id,
state=state,
sort=sort,
start=start,
count=count,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetMyAbuses200Response",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_my_abuses_serialize(
self,
id,
state,
sort,
start,
count,
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if id is not None:
_query_params.append(('id', id))
if state is not None:
_query_params.append(('state', state.value))
if sort is not None:
_query_params.append(('sort', sort))
if start is not None:
_query_params.append(('start', start))
if count is not None:
_query_params.append(('count', count))
# 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'
]
)
# authentication setting
_auth_settings: List[str] = [
'OAuth2'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/api/v1/users/me/abuses',
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
)